Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more tests around user defined input stack effects #82

Merged
merged 3 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions blue.asm
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ blue_bye:
db '16 base '
db ''
db ': xor-edi (( -- )) 31 b, FF b, ; '
db ': mov-eax-60 (( -- )) B8 b, 3C d, ; '
db ': syscall (( -- )) 0F b, 05 b, ; '
db ': syscall (( num ecx -- )) B8 b, d, 0F b, 05 b, ; '
db ''
db ': ok (( -- )) xor-edi ; '
db ': exit (( -- )) mov-eax-60 syscall ; '
db ''
db '0A base '
db ''
db ': exit (( -- )) 60 syscall ; '
db ': bye (( -- )) ok exit ; immediate '
db ''
db ': _start (( -- )) bye ; entry '
Expand Down
2 changes: 1 addition & 1 deletion flow.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ flow_in:

.flow_reg:
and ebx, 7
shl ebx, 3

and rax, REG_MASK
shr rax, REG_OFFSET
and eax, 7
shl eax, 3

or ebx, eax
or ebx, 0xc0
Expand Down
32 changes: 32 additions & 0 deletions kernel_test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ kernel_test:
tc1 user_empty_words
tc1 seX_empty
tc1 ise_1
tc1 ise_1a
tc1 ise_1b
tc1 ise_2

tc2 bogus
Expand Down Expand Up @@ -221,6 +223,36 @@ ise_1:
db 0xc3
.expected_length = $ - .expected

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

.expected:
db 0xc3
db 0xb9
dd 0x3c
db 0xe8
db 0xf5, 0xff, 0xff, 0xff
db 0xc3
.expected_length = $ - .expected

ise_1b:
.blue:
db '16 base '
db ': syscall (( num ecx -- )) B8 b, d, 0F b, 05 b, ; immediate '
db '0A base '
db ': _ 60 syscall ; entry '
.blue_length = $ - .blue

.expected:
db 0xb8
dd 0x3c
db 0x0f, 0x05
db 0xc3
.expected_length = $ - .expected

ise_2:
.blue:
db ': myd, (( num eax -- )) d, ; immediate '
Expand Down
Loading