Skip to content

Commit

Permalink
Make stack effects parsing words (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbirddog authored Jul 20, 2024
1 parent 5c2d87e commit 0adde68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion blue.asm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ blue_bye:
db '16 base '
db ''
db ': xor-edi (( -- )) 31 b, FF b, ; '
db ': syscall (( num ecx -- )) B8 b, d, 0F b, 05 b, ; '
db ': syscall (( ecx num -- )) B8 b, d, 0F b, 05 b, ; '
db ''
db ': ok (( -- )) xor-edi ; '
db ''
Expand Down
14 changes: 7 additions & 7 deletions dictionary.inc
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,9 @@ seX_i_parse:
cmp rax, _core_words.seX_o_parse
je seX_o_parse

call parser_next_word
cmp [_blue.word_len], 0
je se_bad

mov rdi, _core_words.se_reg_latest
call _find_from

test rax, rax
jz se_bad

Expand Down Expand Up @@ -415,9 +411,12 @@ seX_parse_end:

ret

se_reg:
macro _se_reg reg, _REG {
.##reg:
call parser_next_word
cmp [_blue.word_len], 0
je se_bad
mov rax, _REG
mov rdi, [_dictionary.here]
stosq
Expand All @@ -431,6 +430,7 @@ macro _se_reg reg, _REG {
ret
}

se_reg:
_se_reg eax, _EAX
_se_reg ecx, _ECX
8 changes: 4 additions & 4 deletions kernel_test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ seX_empty:

ise_1:
.blue:
db ': syscall (( num eax -- )) ; '
db ': syscall (( eax num -- )) ; '
db ': _ 60 syscall ; entry '
.blue_length = $ - .blue

Expand All @@ -225,7 +225,7 @@ ise_1:

ise_1a:
.blue:
db ': syscall (( num ecx -- )) ; '
db ': syscall (( ecx num -- )) ; '
db ': _ 60 syscall ; entry '
.blue_length = $ - .blue

Expand All @@ -241,7 +241,7 @@ ise_1a:
ise_1b:
.blue:
db '16 base '
db ': syscall (( num ecx -- )) B8 b, d, 0F b, 05 b, ; immediate '
db ': syscall (( ecx num -- )) B8 b, d, 0F b, 05 b, ; immediate '
db '0A base '
db ': _ 60 syscall ; entry '
.blue_length = $ - .blue
Expand All @@ -255,7 +255,7 @@ ise_1b:

ise_2:
.blue:
db ': myd, (( num eax -- )) d, ; immediate '
db ': myd, (( eax num -- )) d, ; immediate '
db ': _ 7 myd, ; entry '
.blue_length = $ - .blue

Expand Down

0 comments on commit 0adde68

Please sign in to comment.