summaryrefslogtreecommitdiff
path: root/03/in02
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2021-11-13 14:32:00 -0500
committerpommicket <pommicket@gmail.com>2021-11-13 14:32:00 -0500
commitc664b4e61b54bed0bd55924c97fcad9d5ad97e21 (patch)
treebcc3ef0cd3263d08a7a5fd0629f14b11aef4c424 /03/in02
parent2507f4b19677e73521e1f03b3a915e1d0c5fcee1 (diff)
pretty much done 03 compiler!
Diffstat (limited to '03/in02')
-rw-r--r--03/in02140
1 files changed, 139 insertions, 1 deletions
diff --git a/03/in02 b/03/in02
index 0eb608b..a1a4b32 100644
--- a/03/in02
+++ b/03/in02
@@ -278,8 +278,64 @@ im
##1.
je
:-al
+im
+--U* "mul"
+IA
+im
+--LI
+JA
+im
+--s=
+cl
+BA
+im
+##1.
+je
+:-u*
+im
+--S* "imul"
+IA
+im
+--LI
+JA
+im
+--s=
+cl
+BA
+im
+##1.
+je
+:-s*
+im
+--U/ "div"
+IA
+im
+--LI
+JA
+im
+--s=
+cl
+BA
+im
+##1.
+je
+:-u/
+im
+--S/ "idiv"
+IA
+im
+--LI
+JA
+im
+--s=
+cl
+BA
+im
+##1.
+je
+:-s/
jm
-:-ex
+:-!i
// handle += instruction
::+=
im
@@ -2165,6 +2221,66 @@ jm
:-rl next line
::Rt
re
+// deal with "mul"
+::u*
+im
+--+*
+IA
+im
+##3.
+DA
+im
+--wr
+cl
+jm
+:-rl next line
+// deal with "imul"
+::s*
+im
+---*
+IA
+im
+##3.
+DA
+im
+--wr
+cl
+jm
+:-rl next line
+// deal with "div"
+::u/
+im
+--+/
+IA
+im
+##3.
+DA
+im
+--wr
+cl
+jm
+:-rl next line
+// deal with "idiv"
+::s/
+im
+---/
+IA
+im
+##3.
+DA
+im
+--wr
+cl
+jm
+:-rl next line
+::+*
++*
+::-*
+-*
+::+/
++/
+::-/
+-/
// bad instruction
::!i
im
@@ -2311,6 +2427,28 @@ jm
'g
'n
\n
+::U* "mul" text
+'m
+'u
+'l
+\n
+::S* "imul" text
+'i
+'m
+'u
+'l
+\n
+::U/ "div" text
+'d
+'i
+'v
+\n
+::S/ "idiv" text
+'i
+'d
+'i
+'v
+\n
::IF input file name
'i
'n