summaryrefslogtreecommitdiff
path: root/asm/assembler.ml
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-10 16:56:20 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-10 16:56:20 +0100
commit70a040d0c327ef1fa8fa73da70f245dedbf8bf2e (patch)
treec17ff1a97e7126194b5ba6081aeb353435d54cd3 /asm/assembler.ml
parent6de7ebfc3fa320b639a292a174f213005d5ce2c2 (diff)
parentb840059a7f2fb0e3796414f30f1e241d03b44dbf (diff)
downloadSystDigit-Projet-70a040d0c327ef1fa8fa73da70f245dedbf8bf2e.tar.gz
SystDigit-Projet-70a040d0c327ef1fa8fa73da70f245dedbf8bf2e.zip
Merge branch 'emile'
Diffstat (limited to 'asm/assembler.ml')
-rw-r--r--asm/assembler.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/asm/assembler.ml b/asm/assembler.ml
index 8c8ff97..35395e0 100644
--- a/asm/assembler.ml
+++ b/asm/assembler.ml
@@ -116,7 +116,8 @@ let print_program p =
sprintf "liuz %s %s" (rts r) (its i)
| Hlt -> (0b01111 lsl 11),"hlt"
| Word w -> (byte 16 w), ""
- | Byte b -> byte 8 b, "" in
+ | Byte b -> byte 8 b, ""
+ | Wlab l -> fst (Imap.find l p.lbls), l in
let n = List.fold_left (fun n i -> size i + n) 0 p.text in
let rev_lbls = Array.make n "" in
Imap.iter (fun l (v,t) ->
@@ -133,7 +134,8 @@ let print_program p =
else printf "\n";
pc := !pc + 2
) else (
- printf "%s\n" (bts w) ) in
+ printf "%s\n" (bts w);
+ incr pc ) in
printf "%d %d\n" (n) 8;
List.iter f p.text;
printf "\n"