[TI ASM] Simple question about stored pointers

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

[TI ASM] Simple question about stored pointers

Post 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 :)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Least significant byte first. The Z80 is little-endian.
Spencer
Extreme Poster
Posts: 346
Joined: Mon 17 Jan, 2005 8:56 am
Location: Indiana

Post 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. :wink:
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Heheh :P

Thank you both, I had already figured it out but thanks a lot anyway :)

(It's working! It's working! It's working! Woot :mrgreen:)

By the way, I use Brass ;)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

ZOMFG!!! CLASH OF THE ASSEMBLERS!!!!!
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Jim e wrote:ZOMFG!!! CLASH OF THE ASSEMBLERS!!!!!
Heh, I've pretty much given up on Brass now, it's redundant.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Nooooo!! Don't give up on it! I love Brass :(
Besides, I still need someone to get me greyscale picture include ;)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Just save each layer individually as B&W and use the ordinary include?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post 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 :modest: :yes:
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

..or just use Jim's package :P
Life is getting better.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post 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...
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Most people promote it more than I do....:?
Image
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

Most people wnat you to release it...!
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
Post Reply