Ejemplo n.º 1
0
def test_immediate():
    bytecode = translate_instruction('LDA #$C2')
    assert bytecode == [0x20, 0xC2]
Ejemplo n.º 2
0
def test_implied():
    bytecode = translate_instruction('HLT')
    assert bytecode == [0xFF]
Ejemplo n.º 3
0
def test_indirect():
    bytecode = translate_instruction('LDA ($C2)')
    assert bytecode == [0x10, 0xC2]
Ejemplo n.º 4
0
def test_indirect_branching():
    bytecode = translate_instruction('JMP ($C2)')
    assert bytecode == [0x44, 0xC2]
Ejemplo n.º 5
0
def test_absolute_branching():
    bytecode = translate_instruction('JMP $C2')
    assert bytecode == [0x34, 0xC2]
Ejemplo n.º 6
0
def test_absolute():
    bytecode = translate_instruction('LDA $C2')
    assert bytecode == [0x00, 0xC2]