CHIP-8 game has an odd number of bytes

岁酱吖の 提交于 2019-12-08 01:44:49

问题


I have been working on a CHIP8 emulator and am using the hex-editor in notepad++ to view the hex values. I happened to notice that some of the games like "Blitz" by David Winter have an odd number of bytes.

In CHIP8, each opcode is 2 bytes long, so there should be an even number of bytes, right?


回答1:


As you can see in the hex dump, the author has embedded the string BLITZ By David WINTER into the ROM. Maybe this string is shown somewhere in the game, or maybe it's just his little way of signing his creation.

The string is 21 characters long, which is why you end up with an odd file size.
The game begins with the instruction 0x1217, which is a jump to address 0x217. That corresponds to the first byte following the string, since games are loaded into memory at address 0x200.



来源:https://stackoverflow.com/questions/15787729/chip-8-game-has-an-odd-number-of-bytes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!