diff --git a/dictionary.inc b/dictionary.inc index 0db2179..1f5f344 100644 --- a/dictionary.inc +++ b/dictionary.inc @@ -409,6 +409,9 @@ seX_parse_end: or al, DE_SE_KNOWN stosb + mov rax, [_dictionary.latest] + call push_flow_in + ret se_reg_eax: diff --git a/flow.inc b/flow.inc index ca736ed..7f98eda 100644 --- a/flow.inc +++ b/flow.inc @@ -19,6 +19,7 @@ flow_in: cmp eax, _IMMEDIATE jne .flow_reg + .flow_lit: mov al, 0xb8 add al, bl call b_comma @@ -29,11 +30,47 @@ flow_in: jmp .loop .flow_reg: - die ERR_NO_IMPL + and ebx, 7 + shl ebx, 3 + + and rax, REG_MASK + shr rax, REG_OFFSET + and eax, 7 + + or ebx, eax + or ebx, 0xc0 + + mov al, 0x89 + call b_comma + + mov al, bl + call b_comma + + jmp .loop .done: ret +; +; expects +; - word in rax +; +push_flow_in: + call word_input_stack_effects + + .loop: + dec ecx + js .done + + lea rax, [rsi + (rcx * 8)] + mov rax, [rax] + + call data_stack_push + jmp .loop + + .done: + ret + ; ; expects ; - word in rax diff --git a/kernel_test.inc b/kernel_test.inc index e57962c..8411290 100644 --- a/kernel_test.inc +++ b/kernel_test.inc @@ -130,6 +130,7 @@ kernel_test: tc1 user_empty_words tc1 seX_empty tc1 ise_1 + tc1 ise_2 tc2 bogus @@ -220,6 +221,18 @@ ise_1: db 0xc3 .expected_length = $ - .expected +ise_2: + .blue: + db ': myd, (( num eax -- )) d, ; immediate ' + db ': _ 7 myd, ; entry ' + .blue_length = $ - .blue + + .expected: + db 0xc3 + dd 0x07 + db 0xc3 + .expected_length = $ - .expected + entry_0: .blue: db ': 1b 1 b, ; entry '