RE: A86: Byte order


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

RE: A86: Byte order



Copied from Cyber Optics TI-86 ASM Tutorial, part 3:
"When storing 16-bit values (words), the Least Significant Byte (LSB)
  is stored first and the Most Significant Byte (MSB) is stored last.
 This appears to make 16-bit LD's look backwards. For example,

 LD BC, $569A ; puts $56 into C and $9A into B."

This is the opposite of what you just told me, isn't it?

Who is right?, you or Cyber Optic?

Stud. tech. Martin Blix Grydeland, Computer Science NTNU
E-mail: grydelan@stud.ntnu.no
Web: http://www.stud.ntnu.no/~grydelan


-----Original Message-----
From:	Dan Eble [SMTP:eble@cis.ohio-state.edu]
Sent:	28. september 1997 18:45
To:	TI-86 Assembly Mailing List (E-mail)
Subject:	Re: A86: Byte order

On Sun, 28 Sep 1997, Martin Blix Grydeland wrote:

> But this never worked, and for fun I tried the more common sense method:
> ld de,$0010		;$00->e, $10->d
> add hl,de		;hl=hl+$10
> 
> This works excellent. Could somebody please tell me why the second version does not add $0100 to hl???


Words in memory have swapped bytes; registers do not.  Your method above
is correct, but your comments are not right.

	ld de, $0010	; $00->d, $10->e

--------
Dan Eble <eble@cis.ohio-state.edu>
         (http://www.cis.ohio-state.edu/~eble)

"Behold, how great a matter a little fire kindleth!" - James 3:5

Warning
Could not process part with given Content-Type: application/ms-tnef

Follow-Ups: