CHIP-8游戏的字节数为奇数 [英] CHIP-8 game has an odd number of bytes

查看:67
本文介绍了CHIP-8游戏的字节数为奇数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究CHIP8仿真器,并且正在notepad ++中使用十六进制编辑器来查看十六进制值。我碰巧注意到,某些游戏(例如David Winter的 Blitz)具有奇数个字节。

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.

在CHIP8中,每个操作码长2个字节,所以应该有偶数个字节,对吧?

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

推荐答案

如您所见,在十六进制转储中,作者将字符串 BLITZ作者David WINTER 嵌入到ROM中。也许这个字符串显示在游戏中的某个地方,或者只是他签名创作的小方法。

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.

该字符串长21个字符,这就是为什么最终

游戏以指令 0x1217 开始,该指令跳转到地址 0x217 。这对应于字符串后的第一个字节,因为游戏已加载到地址 0x200 的内存中。

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.

这篇关于CHIP-8游戏的字节数为奇数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆