Author Topic: question about hexadecimal  (Read 5162 times)

0 Members and 1 Guest are viewing this topic.

Offline TiAddict

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +0/-0
    • View Profile
question about hexadecimal
« 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

Ashbad

  • Guest
Re: question about hexadecimal
« Reply #1 on: May 27, 2011, 01:49:13 pm »
Well, the z80 microprocessor is little-endian, so it makes sense ;)

SirCmpwn

  • Guest
Re: question about hexadecimal
« Reply #2 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.
« Last Edit: May 27, 2011, 01:49:47 pm by SirCmpwn »

Offline TiAddict

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +0/-0
    • View Profile
Re: question about hexadecimal
« Reply #3 on: May 27, 2011, 01:51:35 pm »
well i dont get how they are easier to read :P

SirCmpwn

  • Guest
Re: question about hexadecimal
« Reply #4 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.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: question about hexadecimal
« Reply #5 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 ^^

Ashbad

  • Guest
Re: question about hexadecimal
« Reply #6 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.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: question about hexadecimal
« Reply #7 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.
« Last Edit: May 27, 2011, 02:10:45 pm by Deep Thought »




Offline TiAddict

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +0/-0
    • View Profile
Re: question about hexadecimal
« Reply #8 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

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: question about hexadecimal
« Reply #9 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.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline TiAddict

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +0/-0
    • View Profile
Re: question about hexadecimal
« Reply #10 on: May 27, 2011, 02:57:21 pm »
wow thats interesting. that makes me want to design my own processor :D

SirCmpwn

  • Guest
Re: question about hexadecimal
« Reply #11 on: May 27, 2011, 02:58:35 pm »
Have you ever heard of Logisim?  It lets you do just that.

Offline TiAddict

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +0/-0
    • View Profile
Re: question about hexadecimal
« Reply #12 on: May 27, 2011, 03:03:23 pm »
it looks....really complicated haha :P harder than i thought it would be