aprentice
Moderator
http://msdn.microsoft.com/library/d...s/vclang/html/_pluslang_fundamental_types.asp
1111 (4bit) = 15 decimal or 0xF hex
11111111 (8bit) = 255 decimal or 0xFF hex
111111111111 (12bit) = 4095 or 0xFFF hex
Every chip 8 opcode is 16 bits (unsigned short).
X and Y are used to illustrate the register index. it is 4 bit because the chip 8 only has 15 general purpose registers.
KK is the data stored in the op
NNN is the jump address stored in the opcode
Example: Opcode 4XKK
bits 12-16 is the opcode, you could mask the bits out then shift them right 12 bits: opcode = (data&0xF000)>>12
bits 8-12 is the register index, register_index = (data&0x0F00)>>8
bits 0-8 is the data we do a compare on: misc_data=(data&0x00FF)
edit: if someone can explain this better than me, feel free to do so, i dont have the time or patience to explain this more in dept
1111 (4bit) = 15 decimal or 0xF hex
11111111 (8bit) = 255 decimal or 0xFF hex
111111111111 (12bit) = 4095 or 0xFFF hex
Every chip 8 opcode is 16 bits (unsigned short).
X and Y are used to illustrate the register index. it is 4 bit because the chip 8 only has 15 general purpose registers.
KK is the data stored in the op
NNN is the jump address stored in the opcode
Example: Opcode 4XKK
bits 12-16 is the opcode, you could mask the bits out then shift them right 12 bits: opcode = (data&0xF000)>>12
bits 8-12 is the register index, register_index = (data&0x0F00)>>8
bits 0-8 is the data we do a compare on: misc_data=(data&0x00FF)
edit: if someone can explain this better than me, feel free to do so, i dont have the time or patience to explain this more in dept
Last edited: