#### Archived

This topic is now archived and is closed to further replies.

# Opcodes and ASM

This topic is 5563 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
Everything you want to know about the Z80:

http://www.geocities.com/SiliconValley/Peaks/3938/z80_home.htm

##### Share on other sites
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.

ahhh =D

##### Share on other sites
/me fires up visual c++''s hex editor

##### Share on other sites
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

##### Share on other sites
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...)

##### Share on other sites
oh nevermind
I DID have 24 in there
Whats the two empty spaces between 24 and 76 then? thx

##### Share on other sites
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.

##### Share on other sites
Actually, I was unfamilier with this new hex editor (hex workshop). I''ve been using Visual c++ to edit hex files in the past, and it breaks it up in two-digit blocks. Hex workshop breaks it up in four.

• 11
• 20
• 12
• 10
• 34
• ### Forum Statistics

• Total Topics
631399
• Total Posts
2999854
×