Opcodes and ASM
Hey,
Im looking at a list of opcodes for the Zilog z80 CPU.
I noticed that the HALT assembly command''s opcode (in hex) is 76.
I tried assembling some code that had just the HALT command in it, but instead of the assembled file having 76 (opcode for HALT), it had ''v''. Now, am I not understanding something? (is a binary executable file NOT a big long string of the CPU''s Opcodes?)?
Thanks
Everything you want to know about the Z80:
http://www.geocities.com/SiliconValley/Peaks/3938/z80_home.htm
http://www.geocities.com/SiliconValley/Peaks/3938/z80_home.htm
v is 0x76. You''re obviously viewing the binary file through a text editor. If you want to see the hex values for each character you should use a hex editor.
What Im trying to do is write an operating system that will run on my gameboy pocket
Since the Gameboy''s CPU is a lot like the z80, Im using the z80 as a reference. My OS is going to have an assembler (and I might make a c-like compiler for it) so I can develop software on it too
Since the Gameboy''s CPU is a lot like the z80, Im using the z80 as a reference. My OS is going to have an assembler (and I might make a c-like compiler for it) so I can develop software on it too
I have another question now..
When I do:
inc h
it shows up as a $ in notepad (and just plain old 24 in my hex editor).
Infact, heres my entire ASM code:
di
inc h
halt
and heres what it looks like in notepad:
ó$v
and heres what it looks like in hex:
F324 76
Im just wondering where the ''h'' is stored when I did inc (INC H is suppose to be 24 in the opcodes...)
When I do:
inc h
it shows up as a $ in notepad (and just plain old 24 in my hex editor).
Infact, heres my entire ASM code:
di
inc h
halt
and heres what it looks like in notepad:
ó$v
and heres what it looks like in hex:
F324 76
Im just wondering where the ''h'' is stored when I did inc (INC H is suppose to be 24 in the opcodes...)
hex editors tend to break up 2, 4, 8, or 16-digit blocks of hexadecimal, for ease in visually parsing the hex.
I have to say, if you are unfamiliar with hexadecimal, as well as with executable file formats, and yet are planning to write an OS, you are most likely biting off much much more than you can chew.
How appropriate. You fight like a cow.
I have to say, if you are unfamiliar with hexadecimal, as well as with executable file formats, and yet are planning to write an OS, you are most likely biting off much much more than you can chew.
How appropriate. You fight like a cow.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement