small corrections
This commit is contained in:
parent
d03916a3f8
commit
ea3c931992
1 changed files with 28 additions and 10 deletions
34
04b/in03
34
04b/in03
|
@ -209,9 +209,11 @@ align
|
||||||
; store type
|
; store type
|
||||||
1J=R
|
1J=R
|
||||||
J+=d1
|
J+=d1
|
||||||
; store address
|
; increase stack_end, store it in J
|
||||||
D=:stack_end
|
C=:stack_end
|
||||||
D=4D
|
D=4C
|
||||||
|
D+=d8
|
||||||
|
4C=D
|
||||||
4J=D
|
4J=D
|
||||||
J+=d4
|
J+=d4
|
||||||
; store null terminator
|
; store null terminator
|
||||||
|
@ -241,6 +243,7 @@ align
|
||||||
reserve d8
|
reserve d8
|
||||||
|
|
||||||
:handle_global
|
:handle_global
|
||||||
|
xcc
|
||||||
; ignore if this is the second pass
|
; ignore if this is the second pass
|
||||||
C=:second_pass
|
C=:second_pass
|
||||||
C=1C
|
C=1C
|
||||||
|
@ -303,6 +306,10 @@ align
|
||||||
C=:local_variables_end
|
C=:local_variables_end
|
||||||
8C=D
|
8C=D
|
||||||
|
|
||||||
|
; reset stack_end
|
||||||
|
D=:stack_end
|
||||||
|
8D=0
|
||||||
|
|
||||||
; go read the next line
|
; go read the next line
|
||||||
!:read_line
|
!:read_line
|
||||||
|
|
||||||
|
@ -399,15 +406,18 @@ align
|
||||||
|
|
||||||
|
|
||||||
:handle_return
|
:handle_return
|
||||||
; @TODO: handle argument
|
I=:line
|
||||||
|
; "return " is 7 chars long
|
||||||
|
I+=d7
|
||||||
|
|
||||||
|
call :set_rax_to_term
|
||||||
|
|
||||||
J=d4
|
J=d4
|
||||||
I=:function_epilogue
|
I=:function_epilogue
|
||||||
D=d15
|
D=d15
|
||||||
syscall x1
|
syscall x1
|
||||||
|
|
||||||
; go read the next lines
|
; go read the next line
|
||||||
!:read_line
|
!:read_line
|
||||||
|
|
||||||
:mov_rsp_rbp
|
:mov_rsp_rbp
|
||||||
|
@ -450,8 +460,8 @@ align
|
||||||
:ident_lookup
|
:ident_lookup
|
||||||
C=:second_pass
|
C=:second_pass
|
||||||
C=1C
|
C=1C
|
||||||
; use default of 0 on first pass
|
; use default of 1 on first pass
|
||||||
?C!0:return_0
|
?C=0:return_1
|
||||||
|
|
||||||
C=:ident_lookup_sep
|
C=:ident_lookup_sep
|
||||||
8C=D
|
8C=D
|
||||||
|
@ -463,12 +473,19 @@ align
|
||||||
I=8I
|
I=8I
|
||||||
call :ident=
|
call :ident=
|
||||||
C=A
|
C=A
|
||||||
; move past terminator
|
; move past terminator of identifier in table
|
||||||
|
:ident_finish_loop
|
||||||
|
D=1J
|
||||||
J+=d1
|
J+=d1
|
||||||
|
A=xa
|
||||||
|
?D!A:ident_finish_loop
|
||||||
|
; check if this was it
|
||||||
?C!0:return_J
|
?C!0:return_J
|
||||||
|
; nope. keep going
|
||||||
C=:ident_lookup_sep
|
C=:ident_lookup_sep
|
||||||
C=8C
|
C=8C
|
||||||
J+=C
|
J+=C
|
||||||
|
; check if reached the end of the table
|
||||||
C=1J
|
C=1J
|
||||||
?C=0:return_0
|
?C=0:return_0
|
||||||
!:ident_lookup_loop
|
!:ident_lookup_loop
|
||||||
|
@ -509,6 +526,7 @@ align
|
||||||
; variable
|
; variable
|
||||||
J=:local_variables
|
J=:local_variables
|
||||||
D=d5
|
D=d5
|
||||||
|
xcc
|
||||||
call :ident_lookup
|
call :ident_lookup
|
||||||
C=A
|
C=A
|
||||||
?C=0:rax2term_try_global
|
?C=0:rax2term_try_global
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue