Re: A82: Start Me Up


[Prev][Next][Index][Thread]

Re: A82: Start Me Up




In a message dated 98-01-17 18:37:27 EST, you write:

> Down to business; what I need:
>  How do you do if then's?
You can only do two types of if-then statements. You can check to see if the
carry flag is set, or the zero flag is set and then do a jump.
So
ld a, 0
cp 0
jr z, nextpart
is the same as
0-->A
if A=0
goto X
in basic
>  How do you do add/subtraction?
add a, b
is the same as
A+B-->A
in basic
and 
sub b
is the same as
A-B-->A
in basic
>  How do you do labels?
label1:
  ld a, 0
  cp 0
  jr z, label1
>  How do you do for loops?
djnz-- decreases the b register by one and jumps if the b reg doesn't equal
zero
ld b, 10
label1:
djnz label1
is the same as
0-->B
for(b,1,10)
end
in basic
>  How do you do output text/ variable values?
ld hl, string
call D_ZT_STR
displays a string stored at the label hl

string:

 .db "You are now an ASM programmer",0;<--has to have a zero at the end