summaryrefslogtreecommitdiff
path: root/asm/asmlex.mll
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-08 18:10:01 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-08 18:10:01 +0100
commitb2c5356b3f6d2e0a836a19b4cae1791d350785d3 (patch)
treec84011df6867b5fa9e4c211f300dbc0421683f93 /asm/asmlex.mll
parentfb4a33dfbbfd3d85e3ecee65bdee36b12c4f9937 (diff)
downloadSystDigit-Projet-b2c5356b3f6d2e0a836a19b4cae1791d350785d3.tar.gz
SystDigit-Projet-b2c5356b3f6d2e0a836a19b4cae1791d350785d3.zip
Assembler kind of works ; created simple assembly program that prints Tick! every second.
Diffstat (limited to 'asm/asmlex.mll')
-rw-r--r--asm/asmlex.mll4
1 files changed, 2 insertions, 2 deletions
diff --git a/asm/asmlex.mll b/asm/asmlex.mll
index 98caa26..726b732 100644
--- a/asm/asmlex.mll
+++ b/asm/asmlex.mll
@@ -53,8 +53,8 @@
let v =
let c = Char.code n.[i] in
if c >= Char.code '0' && c <= Char.code '9' then c - (Char.code '0')
- else if c >= Char.code 'a' && c <= Char.code 'f' then c - (Char.code 'a')
- else c - (Char.code 'A') in
+ else if c >= Char.code 'a' && c <= Char.code 'f' then c - (Char.code 'a') + 10
+ else c - (Char.code 'A') + 10 in
res := !res + v
done;
!res