Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ii:assignments:s2:chip8 [2023/03/28 11:00]
radu.mantu [FAQ]
ii:assignments:s2:chip8 [2023/04/26 11:37] (current)
florin.stancu
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
  
-====== CHIP-8 Emulator ======+====== CHIP-8 Emulator ​(bonus) ​======
  
 ===== Context ===== ===== Context =====
Line 118: Line 118:
 **Q: How do I read the instruction codes in the specification?​** \\ **Q: How do I read the instruction codes in the specification?​** \\
 A: In the spec, the instructions are represented as 4 characters, each signifying a nibble (4 bits). Hex digits (''​0-9A-F''​) are invariants and you should try to match them exactly. E.g. ''​00EE''​ (''​RET''​) is composed of 4 constant nibbles. Whenever you see ''​X''​ or ''​Y'',​ that part of the opcode is variable and it represents what general purpose register (''​V''​) is involved in that operation. E.g. ''​FX65''​ (''​LD Vx, [I]''​) will load in register ''​Vx''​ the value located at the memory address stored in register ''​I'';​ basically, it's dereferencing a pointer. Finally, whenever you see a sequence of ''​K''​ or ''​N''​ characters (notation can differ), know that these are //immediate values//. These are basically arguments for the instructions that are embedded in the opcode itself. E.g. ''​6XKK''​ (''​LD Vx, byte''​) will load the value ''​KK''​ into ''​Vx''​. So for ''​614F'',​ we will have ''​V1 = 0x4F''​. A: In the spec, the instructions are represented as 4 characters, each signifying a nibble (4 bits). Hex digits (''​0-9A-F''​) are invariants and you should try to match them exactly. E.g. ''​00EE''​ (''​RET''​) is composed of 4 constant nibbles. Whenever you see ''​X''​ or ''​Y'',​ that part of the opcode is variable and it represents what general purpose register (''​V''​) is involved in that operation. E.g. ''​FX65''​ (''​LD Vx, [I]''​) will load in register ''​Vx''​ the value located at the memory address stored in register ''​I'';​ basically, it's dereferencing a pointer. Finally, whenever you see a sequence of ''​K''​ or ''​N''​ characters (notation can differ), know that these are //immediate values//. These are basically arguments for the instructions that are embedded in the opcode itself. E.g. ''​6XKK''​ (''​LD Vx, byte''​) will load the value ''​KK''​ into ''​Vx''​. So for ''​614F'',​ we will have ''​V1 = 0x4F''​.
 +
 +**Q: There are so many CHIP-8 emulators out there. What if I'm tempted to "take inspiration"​ from some of them?** \\
 +A: Once you come up with a solution of your own //and implement it//, it's ok to look at other approaches. After all, to write good code you first need to read good code. However, taking inspiration and "​taking inspiration"​ are two different things. In addition to a manual review, we'll also perform an AST comparison of your submitted code, against each other and as many public CHIP-8 projects as we can find. Just keep that in mind :p
  
 <​note>​ <​note>​
 **TODO:** Collect questions from Teams / lab and add them here. **TODO:** Collect questions from Teams / lab and add them here.
 </​note>​ </​note>​
ii/assignments/s2/chip8.1679990440.txt.gz ยท Last modified: 2023/03/28 11:00 by radu.mantu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0