Jump to content
  • Advertisement

Archived

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

Xtremehobo

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!