SPO_JakaFurlan/ass2/SICocaml/SICXE/_build/default/lib/decoder.ml
2025-11-29 16:12:58 +01:00

10 lines
321 B
OCaml

(*decoderjeva naloga je pridobiti mnemonic in tip ukaza iz prvega byta z pogledom v hash-table*)
let table = OpcodeTable.table
let decoder (byte1 : char) : OpcodeTable.info =
let opcode = (Char.code byte1) land 0xFC in
try
Hashtbl.find OpcodeTable.table opcode
with
| Not_found -> failwith "invalid opcode"