From 0adde6854536bca2f111416724ce0aea8bfbe057 Mon Sep 17 00:00:00 2001 From: jbirddog <100367399+jbirddog@users.noreply.github.com> Date: Sat, 20 Jul 2024 08:32:32 -0400 Subject: [PATCH] Make stack effects parsing words (#83) --- blue.asm | 2 +- dictionary.inc | 14 +++++++------- kernel_test.inc | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/blue.asm b/blue.asm index cc78b94..38216d2 100644 --- a/blue.asm +++ b/blue.asm @@ -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 '' diff --git a/dictionary.inc b/dictionary.inc index 0648f0b..d5e2471 100644 --- a/dictionary.inc +++ b/dictionary.inc @@ -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 @@ -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 @@ -431,6 +430,7 @@ macro _se_reg reg, _REG { ret } - + +se_reg: _se_reg eax, _EAX _se_reg ecx, _ECX diff --git a/kernel_test.inc b/kernel_test.inc index 225ae33..749f1e5 100644 --- a/kernel_test.inc +++ b/kernel_test.inc @@ -210,7 +210,7 @@ seX_empty: ise_1: .blue: - db ': syscall (( num eax -- )) ; ' + db ': syscall (( eax num -- )) ; ' db ': _ 60 syscall ; entry ' .blue_length = $ - .blue @@ -225,7 +225,7 @@ ise_1: ise_1a: .blue: - db ': syscall (( num ecx -- )) ; ' + db ': syscall (( ecx num -- )) ; ' db ': _ 60 syscall ; entry ' .blue_length = $ - .blue @@ -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 @@ -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