working...1
This commit is contained in:
parent
bc78a83838
commit
61bb14b9e3
21 changed files with 1054 additions and 12 deletions
10
ass2/SICocaml/sicxeDune/lib/decoder.ml
Normal file
10
ass2/SICocaml/sicxeDune/lib/decoder.ml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(*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"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue