Skip to content

Commit

Permalink
Simplify the example program with some more flow (#84)
Browse files Browse the repository at this point in the history
jbirddog authored Jul 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 0adde68 commit 410c708
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 2 additions & 7 deletions blue.asm
Original file line number Diff line number Diff line change
@@ -63,15 +63,10 @@ segment readable
blue_bye:
db '16 base '
db ''
db ': xor-edi (( -- )) 31 b, FF b, ; '
db ': syscall (( ecx num -- )) B8 b, d, 0F b, 05 b, ; '
db ': exit (( edx status -- )) BF b, d, 3C syscall ; '
db ''
db ': ok (( -- )) xor-edi ; '
db ''
db '0A base '
db ''
db ': exit (( -- )) 60 syscall ; '
db ': bye (( -- )) ok exit ; immediate '
db ': bye (( -- )) 0 exit ; immediate '
db ''
db ': _start (( -- )) bye ; entry '
db ''
2 changes: 2 additions & 0 deletions defs.inc
Original file line number Diff line number Diff line change
@@ -51,6 +51,8 @@ _RAX = REG_RAX or _QWORD

_ECX = REG_RCX or _DWORD

_EDX = REG_RDX or _DWORD

_blue:
.tib dq 0
.tib_len dd 0
2 changes: 2 additions & 0 deletions dictionary.inc
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ macro _ose e {
_core_words:
.prev_word = 0

_wi 'edx', 3, se_reg.edx, 0, 0
_wi 'ecx', 3, se_reg.ecx, 0, 0
_wi 'eax', 3, se_reg.eax, 0, 0

@@ -434,3 +435,4 @@ macro _se_reg reg, _REG {
se_reg:
_se_reg eax, _EAX
_se_reg ecx, _ECX
_se_reg edx, _EDX

0 comments on commit 410c708

Please sign in to comment.