Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: TiAddict on May 27, 2011, 01:48:00 pm

Title: question about hexadecimal
Post by: TiAddict on May 27, 2011, 01:48:00 pm
So im trying to create like a on-calc assembler, but why does ti83.inc putted in little-endian? for example, why dont they put it has 7045h instead of 4570h? doesnt that just makes the assembler harder to assemble? :P
Title: Re: question about hexadecimal
Post by: Ashbad on May 27, 2011, 01:49:13 pm
Well, the z80 microprocessor is little-endian, so it makes sense ;)
Title: Re: question about hexadecimal
Post by: SirCmpwn on May 27, 2011, 01:49:31 pm
So im trying to create like a on-calc assembler, but why does ti83.inc putted in little-endian? for example, why dont they put it has 7045h instead of 4570h? doesnt that just makes the assembler harder to assemble? :P
More difficult to assemble, but easier to read.  Plus what Ashbad said.
Title: Re: question about hexadecimal
Post by: TiAddict on May 27, 2011, 01:51:35 pm
well i dont get how they are easier to read :P
Title: Re: question about hexadecimal
Post by: SirCmpwn on May 27, 2011, 01:52:15 pm
Well, 0x3412 looks like 3412 when I read it, but if it was in little endian it would really be 0x1234.  It's about standards, and what people are used to reading.
Title: Re: question about hexadecimal
Post by: Builderboy on May 27, 2011, 01:52:46 pm
Lol I don't see how they are easier to read either, I think the only reason is because thats how the z80 works ^^
Title: Re: question about hexadecimal
Post by: Ashbad on May 27, 2011, 01:55:14 pm
Lol I don't see how they are easier to read either, I think the only reason is because thats how the z80 works ^^

When you get used to using z80 assembly, you also get used to reading in little endian ;) Ask Kerm what the meaning of life and everything in the universe is, and most likely he'll say 24.
Title: Re: question about hexadecimal
Post by: Deep Toaster on May 27, 2011, 02:08:40 pm
Lol I don't see how they are easier to read either, I think the only reason is because thats how the z80 works ^^

When you get used to using z80 assembly, you also get used to reading in little endian ;) Ask Kerm what the meaning of life and everything in the universe is, and most likely he'll say 24.

2A00 :P

EDIT: By the way, an advantage to having little-endian is that you can load either a one-byte value or a two-byte value using the same address. Example:

Code: (Z80 ASM) [Select]
    LD HL,42
    LD ($8000),HL
    LD A,($8000)    ; A is now 42

That way you don't have to worry about adding one to get the lower 8 bits.
Title: Re: question about hexadecimal
Post by: TiAddict on May 27, 2011, 02:18:44 pm
oh i see. Oh well then, i guess it will take me more time to finish the assembler :P
Title: Re: question about hexadecimal
Post by: AngelFish on May 27, 2011, 02:38:26 pm
Lol I don't see how they are easier to read either, I think the only reason is because thats how the z80 works ^^

Litttle Endian actually makes the processor easier to build :p

Back in the days when the z80 was designed, it the semiconductor technology obviously wasn't as advanced, so they used every shortcut they could in processors to cut production costs.
Title: Re: question about hexadecimal
Post by: TiAddict on May 27, 2011, 02:57:21 pm
wow thats interesting. that makes me want to design my own processor :D
Title: Re: question about hexadecimal
Post by: SirCmpwn on May 27, 2011, 02:58:35 pm
Have you ever heard of Logisim (http://ozark.hendrix.edu/~burch/logisim/)?  It lets you do just that.
Title: Re: question about hexadecimal
Post by: TiAddict on May 27, 2011, 03:03:23 pm
it looks....really complicated haha :P harder than i thought it would be