Thorn Avery 2be553db25 | hace 4 años | |
---|---|---|
old-code | hace 4 años | |
.gitignore | hace 4 años | |
README.md | hace 4 años | |
vm.rkt | hace 4 años |
very early days for now.
in the racket repl:
(run-lines (list
(8b-ld-reg-imm 4 #x01)
(8b-ld-reg-imm 5 #x50)
(8b-ld-reg-imm 7 #x69)
(8b-ld-reg-reg 6 7)
(8b-ld-reg-reg 7 4)
(8b-ld-reg-imm 5 #x51)
(8b-ld-reg-reg 6 7)))
will evaluate to:
PC: $07, SP: $00, Flags: %00000000
BC: $0000, DE: $0000
HL: $0151, AF: $0100
(HL): $01
$0150 > $69 $01 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 < $0160
which is the equivilent of:
LD H, $01
LD L, $50
LD A, $69
LD (HL), A
LD A, H
LD L, $51
LD (HL), A
register numbering is following how the LR35902 decodes instructions, as such: