Author |
Message |
|
Matt
Member
Joined: 11 Jun 2003 Posts: 169
|
|
Back to top |
|
|
DigiTan Unregistered HyperCam 2
Super Elite (Last Title)
Joined: 10 Nov 2003 Posts: 4468
|
Posted: 04 Dec 2003 07:12:48 pm Post subject: |
|
|
I'd start by printing out the entire tutorial first for future reference. (I still use my copy today). |
|
Back to top |
|
|
Tyler
Advanced Member
Joined: 29 May 2003 Posts: 352
|
Posted: 04 Dec 2003 07:18:06 pm Post subject: |
|
|
If you've never programmed another low-level language ...
Don't bother doing assembler! |
|
Back to top |
|
|
NETWizz Byte by bit
Bandwidth Hog
Joined: 20 May 2003 Posts: 2369
|
Posted: 04 Dec 2003 11:58:02 pm Post subject: |
|
|
What seems to be the problem?
All he is talking about is binary numbers and registers.
1 = 1
10 = 2
100 = 4
1000 =8
...
1001 = 9
get it?
ld a,5
A will contain
00000101 in binary
set bit 7,a
A will now be
100000101
bits are
76543210
values are
128|64|32|16|8|4|2|1 for an 8 bit number
now, hl is a 16-bit register hence, it has 16 bits (1's and 0's)
ld h,0
ld l,1
00000000|00000001 will be the value of hl
inc h
HL will now be
00000001|00000001 or 257
As you may know, you can load 16-bit registers directly
ld hl, 27045 for example
Get it?
Now, he also talked about various tests you can do for logic.
I.e.
ld a,3
cp 3
here is how this works:
a is 3 cp 3 means take away 3 but do not store the result.
3-3 = 0
So, the Zero flag is set in the flag register (A is still 3)
so
ld a,2
inc a
cp 3
jp nz,somewhere
jp z,label
since the z flag is set, you will jump to "label" and not somewhere.
BTW, if Z is set, NZ is not set and vice versa.
So
jp z,label
jp elsewhere
or
jp nz,lable
jp somewhere
is okay since if it isn't nz it is Z. |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 05 Dec 2003 12:07:08 am Post subject: |
|
|
Tyler wrote: If you've never programmed another low-level language ...
Don't bother doing assembler!
hey! 4 different forms of basic then asm is what i did. it wasnt that hard. i even found out how a gameshark works. |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 05 Dec 2003 06:15:26 pm Post subject: |
|
|
it just constantly changes the value of a memory location during gameplay... |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 05 Dec 2003 06:51:41 pm Post subject: |
|
|
i know that now... |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 05 Dec 2003 07:27:03 pm Post subject: |
|
|
Tyler wrote: If you've never programmed another low-level language ...
Don't bother doing assembler!
What other low-level language do you have in mind? Hexadecimal numbers? |
|
Back to top |
|
|
DigiTan Unregistered HyperCam 2
Super Elite (Last Title)
Joined: 10 Nov 2003 Posts: 4468
|
Posted: 06 Dec 2003 12:51:36 am Post subject: |
|
|
Going from BASIC to ASM isn't impossible, I'd say the most difficult part of adjusting is the lack of an "IF" statement--among other things. People often say that ASM programming requires a better awareness of computer hardware; things like knowing what memory and addresses are and how a computer would use them. If you've studied pointers in C, C++, VBasic, etc., then you shouldn't have too much trouble with ASM. The key is to have patience and not get discouraged by any minor setbacks (ASM programming can also be very frustraiting). |
|
Back to top |
|
|
Justin W. Shattered Silence
Advanced Member
Joined: 24 May 2003 Posts: 429
|
Posted: 06 Dec 2003 01:29:49 am Post subject: |
|
|
Tyler wrote: If you've never programmed another low-level language ...
Don't bother doing assembler!
I must object to that statement completely. Programming in asm just requires a different perspective than basic does. My first programming language was TI83+ Basic and I went from it straight to assembler. I'm an advanced assembly programmer now. It is more than possible to go to asm without any previous knowledge of low level languages. When I started asm I didn't even know what a byte was. |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 06 Dec 2003 04:20:29 am Post subject: |
|
|
I agree with Justin, asm is different but certainly not impossible to learn as one's first low-level language. Once you've got yourself used to it a bit it's no different than learning any other programming language although it is harder to memorize because it isn't as based on the english language like, say, basic.
I also agree with DigiTan on the memory/pointers bit, having learned to work with pointers in C++ is really helping out with learning asm. |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 06 Dec 2003 01:13:18 pm Post subject: |
|
|
yes, learn C++ or similar language first, and then ASM will *probably* come smoother...
oh, as a side note, i have a friend who only knows TI-Basic (no other languages) and I recommened ti83p28d to him, and he read through the ENTIRE tutorial and didnt get a single thing out of it! :o
but then again, he probably expected it to be like a novel... not a tutorial... |
|
Back to top |
|
|
|