Re: A82: Adding 100 (to score-asm)


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

Re: A82: Adding 100 (to score-asm)



Yes, its legal. However, a is an 8 bit register. Therefore, if you want a
9 bit score (say 300, your dead). This will work for much larger numbers:
ld hl, (score)
ld de, 100
add hl, de
ld hl, (score)

Make sure score is 16 bit. (bs1 = TEXTMEm, score=textmem+1,bs2=textmem+3)

ilya winham wrote:

> Is this legal?
>
> ld a,(score)
> add a,100
> ld (score),a
>
> Does that add 100 to the variable score? I am curious because in an 83
> asm game which I am going to *try* to convert to 82asm it uses like 10
> lines of code to add 100 to the score.




References: