error line numbers!

This commit is contained in:
pommicket 2021-11-13 14:48:26 -05:00
parent c664b4e61b
commit e539081fdd

131
03/in02
View file

@ -36,6 +36,21 @@ im
sy sy
// read next line // read next line
::rl ::rl
// first, increment line number
im
--L#
BA
lq
BA
im
##1.
+B
BA
im
--L#
xc
sq
// okay, now read the line
im im
--LI --LI
RA rbp pointer to line buffer RA rbp pointer to line buffer
@ -2329,6 +2344,45 @@ im
DA DA
jm jm
:-er :-er
// convert digit rcx of line number to string
::2s
DC
AC
<I
02
CA multiply rcx by 4 to get shift
im
--L#
BA
lq
>C
BA
CD restore rcx as digit index
im
##f.
&B
BA
im
--XD
+B
BA
zA
lb
DA
im
--#S
BA
im
##3.
+B
BA
AC
nA
+B compute pointer to digit char as #S + 3 - digit_idx
BA
AD
sb
re
::er error -- write error message in rsi with length in rdx ::er error -- write error message in rsi with length in rdx
im im
##2. stderr ##2. stderr
@ -2337,6 +2391,43 @@ im
##1. write ##1. write
sy sy
im im
##0.
CA
im
--2s
cl
im
##1.
CA
im
--2s
cl
im
##2.
CA
im
--2s
cl
im
##3.
CA
im
--2s
cl
// write line number
im
##2. stderr
JA
im
--#S
IA
im
##5. length
DA
im
##1. write
sy
im
##1. ##1.
jm jm
:-ex :-ex
@ -2473,7 +2564,7 @@ jm
'b 'b
'e 'e
'r 'r
\n 20
::!L bad label error message ::!L bad label error message
'B 'B
'a 'a
@ -2484,7 +2575,7 @@ jm
'b 'b
'e 'e
'l 'l
\n 20
::!R bad register error message ::!R bad register error message
'B 'B
'a 'a
@ -2498,7 +2589,7 @@ jm
't 't
'e 'e
'r 'r
\n 20
::!J bad jump error message ::!J bad jump error message
'B 'B
'a 'a
@ -2508,7 +2599,7 @@ jm
'u 'u
'm 'm
'p 'p
\n 20
::!I bad instruction message ::!I bad instruction message
'B 'B
'a 'a
@ -2525,7 +2616,39 @@ jm
'i 'i
'o 'o
'n 'n
20
::L# line number
00
00
00
00
00
00
00
00
::#S line number string
'0
'0
'0
'0
\n \n
::XD hexadecimal digits
'0
'1
'2
'3
'4
'5
'6
'7
'8
'9
'a
'b
'c
'd
'e
'f
::BU buffer for miscellaneous purposes ::BU buffer for miscellaneous purposes
~~ ~~
::LI line buffer ::LI line buffer