15 lines
261 B
Python
15 lines
261 B
Python
|
from assembler.opcodes import make_opcodes
|
||
|
|
||
|
|
||
|
def test_make_opcodes():
|
||
|
mnemonics = ["ldi", "ld", "st", "add", "mul"]
|
||
|
|
||
|
opcodes = make_opcodes(mnemonics)
|
||
|
|
||
|
assert opcodes == {"ldi": 32704
|
||
|
, "ld" : 16320
|
||
|
, "st": 49088
|
||
|
, "add": 8128
|
||
|
, "mul": 24512
|
||
|
}
|