Level 27: Hello, Ports!
Task
Change the constants in the program so the pixel lights up at X=4, Y=12.
I/O ports: 252=X-coordinate, 253=Y-coordinate, 255=write pixel.
Solution
LDA loads an IMMEDIATE VALUE (the operand) into the accumulator. STA writes the accumulator value TO THE ADDRESS of the operand.
The template uses LDA 8. You need to change the values 8 to 4 and 12: replace the first LDA 8 with LDA 4, and the second LDA 8 with LDA 12.
1. Open the "Assembler" tab in the right panel. 2. Replace the first LDA 8 with LDA 4 (X=4). 3. Replace the second LDA 8 with LDA 12 (Y=12). 4. Click "Run". 5. Click "Checkpoint 1" — the pixel on the display should light up at (4,12).