Page 1 of 1
[TI ASM] Simple question about stored pointers
Posted: Fri 03 Mar, 2006 4:42 pm
by Timendus
Are pointers store LSB or MSB first? I'm trying to do this:
Code: Select all
ld hl,data
ld d,(hl) ; or should it be ld e,(hl)?
inc hl
ld e,(hl) ; or should it be ld d,(hl)?
ex de,hl
; hl = pointer to picture
; display it or whatever
ret
data:
.dw picture
picture:
; picture data
I've got a bug in my code, so both ways give unexpected results. It would be nice to be sure about this before I try to work that bug out, otherwise I'd have to change my code in four places two times for each testrun
Posted: Fri 03 Mar, 2006 5:19 pm
by benryves
Least significant byte first. The Z80 is little-endian.
Posted: Fri 03 Mar, 2006 5:19 pm
by Spencer
By default, TASM will store it LSB first. You can change this with a directive if needed. The code in your comments is the correct code, then.
If you get fed up with TASM's slowness, my assembler will always store the pointer LSB first.
Posted: Fri 03 Mar, 2006 5:51 pm
by Timendus
Heheh
Thank you both, I had already figured it out but thanks a lot anyway
(It's working! It's working! It's working! Woot
)
By the way, I use Brass
Posted: Fri 03 Mar, 2006 6:37 pm
by Jim e
ZOMFG!!! CLASH OF THE ASSEMBLERS!!!!!
Posted: Fri 03 Mar, 2006 6:47 pm
by benryves
Jim e wrote:ZOMFG!!! CLASH OF THE ASSEMBLERS!!!!!
Heh, I've pretty much given up on Brass now, it's redundant.
Posted: Fri 03 Mar, 2006 7:42 pm
by Timendus
Nooooo!! Don't give up on it! I love Brass
Besides, I still need someone to get me greyscale picture include
Posted: Sat 04 Mar, 2006 7:37 am
by tr1p1ea
Just save each layer individually as B&W and use the ordinary include?
Posted: Sat 04 Mar, 2006 12:07 pm
by Timendus
Yes, that's what I do now, but it's more work than it should be in my opinion. On the other hand it's a bit too much work to write a script for it too
Having the include command convert a greyscale image to two layers of binary data would be perfect
Posted: Sun 05 Mar, 2006 12:13 am
by Shadow Phoenix
..or just use Jim's package
Posted: Sun 05 Mar, 2006 1:37 am
by Timendus
Why do people keep saying that on random occasions?
Obviously I already use the RGP, since it takes me about two mouseclicks to embed it into any of my programs thanks to the API...
Posted: Sun 05 Mar, 2006 1:53 am
by Jim e
Most people promote it more than I do....
Posted: Sun 05 Mar, 2006 4:10 pm
by KevinJB
Most people wnat you to release it...!