Start here
Boot camp
Everything you need before your first mission, in about a minute.
On this page
The mission loop
- 1ConfigureWalk the register rooms and flip the bits.
- 2ProgramPPress P to write it into ROM.
- 3ExecuteEPress E and watch the CPU run it.
- 4RepairRight values: the system comes back.
Inside the chip you walk between rooms, and each room is a register: eight switches (bits) that turn a piece of hardware on, off or into a mode. When you press E, the CPU fetches, decodes and executes your program step by step, and you can watch every value travel. Get every register right and the system comes back.
Start the clock
Nothing in a chip moves without a clock, so every mission begins with OSCCON: switch the internal oscillator on (bit 0, SCS0 = 1) and pick a speed (bits 2:1, IRCF). Any speed wins; the speed only changes how fast the CPU runs your program.
| OSCCON | Clock | Note |
|---|---|---|
| 0x01 | 1 MHz | slowest run |
| 0x03 | 2 MHz | |
| 0x05 | 4 MHz | used in these docs |
| 0x07 | 8 MHz | fastest run |
How 0x05 breaks down
| Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Value | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
| Field | — | IRCF | SCS0 | |||||
- IRCF (bits 2:1) =
10→ 4 MHz - SCS0 (bit 0) =
1→ Internal oscillator on - Every remaining bit is
0: those bits are not needed for this level, but they must stay clear for the value to match.
Writing the program
Two instructions do everything: MOVLW k loads a value into the working register W, and MOVWF f copies W into the register at address f. One pair per register:
MOVLW 0x05
MOVWF 0x20 ; OSCCONReading hex and binary
Registers are 8 bits and written in hex. One hex digit is exactly four bits, and bit 0 is the rightmost. That's all you need.
Need a refresher?
| Hex | Upper digit | Lower digit | Binary |
|---|---|---|---|
| 0x05 | 0 = 0000 | 5 = 0101 | 0000 0101 |
| 0x49 | 4 = 0100 | 9 = 1001 | 0100 1001 |
| 0xFF | F = 1111 | F = 1111 | 1111 1111 |
Bit weights from bit 7 down to bit 0 are 128, 64, 32, 16, 8, 4, 2 and 1.
Register map
Every register in the game and the levels that use it. Full bit details are in the register reference.
| Address | Register | Used in |
|---|---|---|
| 0x20 | OSCCON | All levels |
| 0x21 | TRISA | Level 1 |
| 0x22 | PORTA | Level 1 |
| 0x23 | TRISB | Level 1 |
| 0x24 | PORTB | Level 1 |
| 0x25 | ADCON0 | Level 2 |
| 0x26 | ADCON1 | Level 2 |
| 0x27 | T0CON | Level 3 |
| 0x28 | T1CON | Level 3 |
| 0x29 | EECON0 | Level 4 |
| 0x2A | EECON1 | Level 4 |
| 0x2B | TXSTA | Level 5 |
| 0x2C | RCSTA | Level 5 |
| 0x2D | SSPCON0 | Level 6 |
| 0x2E | SSPCON1 | Level 6 |
| 0x2F | I2CCON0 | Level 7 |
| 0x30 | I2CCON1 | Level 7 |
What the game simplifies
- You configure, the game feeds the data. Once a peripheral is on, it generates its own demo data (a repeating
0x00 → 0xFFsequence, or the word “EmbeddedPlayX” in EEPROM), so you never write data registers yourself. - Slowed down to be seen. Animations run far slower than real hardware so you can follow every bit.
Wrong value?
The peripheral simply doesn't do what the mission needs, so there's no Target Reached. Every mission page has a “Stuck?” list that matches what you see to the fix.
Try it yourself
Build 0x05, the clock every mission starts with:
0 of 1 register match.
OSCCON 0x20
✗ Not yet – 2 bits differHex 0x00 Binary 0000 0000 Target 0x05 (0000 0101)
- IRCF (bits 2:1) = 00 → 1 MHz
- SCS0 (bit 0) = 0 → Internal oscillator not enabled