[A83] Re: Displaying Registers


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

[A83] Re: Displaying Registers




well you were probably taught when loading the currow to do something like:

ld hl,$0000
ld (currow),hl
or something like:
ld hl,$0301
ld (currow),hl
[just to give another example]

Think of it this way.  A 1 byte register [a,b,c,d,e,f,etc] can hold 0-255 and 
a two byte register can hold 0-66535, which is 256*256...  so say you wanted 
to load 5 into d and 0 into e.  instead of trying to math, you can just do ld 
de,5*256  <-- right?  Then, just add to that what you want in e...
so if you want to display something at (20,35) you can do something like:
ld de,35*256+20
ld (penCol),de

-Joel