I'm writing a chip-8 interpreter. I have my mock hardware, instruction execution, UI, etc.. all good to go, so I started actually loading and executing real chip8 programs.
In the zip archive I found on the web there are several games in there that seem to have illegal jump calls.
From CowGod's specification it says:
All instructions are 2 bytes long and are stored most-significant-byte first. In memory, the first byte of each instruction should be located at an even addresses. If a program includes sprite data, it should be padded so any instructions following it will be properly situated in RAM.
This seems very insistent that it's impossible to have an instruction that executes from an odd memory address, and therefore I coded my interpreter to fail is we end up trying to go to an odd memory address (mostly because I assume that I"m reading something wrong if this occurred).
However two of the games in my pack (INVADERS, and BLITZ) seem to immediately start with a jump call (they signed the roms with their names in ascii so the first instruction is a call to jump after the signature.
The former starts with 0x12 0x25 and the second starts with 0x12 0x17. Both of these point to jump calls to odd addresses (0x225 and 0x217 respectively) which then fail in my emulator. Looking at those addresses they are pointing to they look like they contain valid instructions (byte 25 in the former contains 0x6000 (LD V0, 00) and byte 17 in the latter points to 0xA341 (LD I, 341).
Am I just interpreting the specifications too strictly and it's expected that real applications won't be padded and can be run on odd addresses?
The answer to the question is (based on the comments): the Chip-8 specification apparently intended to include the requirement that instructions start on even addresses, however, due to its not being specified very strongly (the spec mentions it only in passing using the term "should" instead of "must"), and the fact that the instruction set works fine with instructions that aren't at even addresses (e.g., the jump instruction can jump to any address, not just even ones), emulator developers tended to ignore the requirement. Consequently, a number of binaries exist for Chip-8 that have instructions at odd addresses, making it unlikely that future emulators will enforce this requirement.