Skip to content

Latest commit

 

History

History
50 lines (38 loc) · 1.17 KB

ProgrammerNotes.md

File metadata and controls

50 lines (38 loc) · 1.17 KB

Programmer notes

For writing the emulator and decompiler, I needed code snippets and test code. Altho not complete, here are some notes I made along the way.

test codes

$0600 a9 01 LDA #$01 $0602 8d 00 02 STA $0200 $0605 a9 05 LDA #$05 $0607 8d 01 02 STA $0201 $060a a9 08 LDA #$08 $060c 8d 02 02 STA $0202

mem.mem[10] = 0xa9;
mem.mem[11] = 0x01;
mem.mem[12] = 0x8d;
mem.mem[13] = 0x00;
mem.mem[14] = 0x02;
mem.mem[15] = 0xa9;
mem.mem[16] = 0x05;
mem.mem[17] = 0x8d;
mem.mem[18] = 0x01;
mem.mem[19] = 0x02;

Address Hexdump Dissassembly

$0600 a9 c0 LDA #$c0 ;Load the hex value $c0 into the A register $0602 aa TAX ;Transfer the value in the A register to X $0603 e8 INX ;Increment the value in the X register $0604 69 c4 ADC #$c4 ;Add the hex value $c4 to the A register $0606 00 BRK ;Break - we're done

In the simulator below type (don’t paste) the following code:

LDA #$80 STA $01 ADC $01

mem.mem[1] = 0x43;
mem.mem[2] = 's';
mem.mem[3] = 0x45;
mem.mem[4] = 0x46;
mem.mem[5] = 0x47;
mem.mem[6] = 0x48;
mem.mem[7] = 0x49;