From b2c5356b3f6d2e0a836a19b4cae1791d350785d3 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Wed, 8 Jan 2014 18:10:01 +0100 Subject: Assembler kind of works ; created simple assembly program that prints Tick! every second. --- asm/asmlex.mll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'asm/asmlex.mll') 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 -- cgit v1.2.3