diff options
-rwxr-xr-x | subx/apps/crenshaw2-1 | bin | 304 -> 333 bytes | |||
-rw-r--r-- | subx/apps/crenshaw2-1.subx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/subx/apps/crenshaw2-1 b/subx/apps/crenshaw2-1 index 826d5776..d85b2556 100755 --- a/subx/apps/crenshaw2-1 +++ b/subx/apps/crenshaw2-1 Binary files differdiff --git a/subx/apps/crenshaw2-1.subx b/subx/apps/crenshaw2-1.subx index 2b46f07f..32436bad 100644 --- a/subx/apps/crenshaw2-1.subx +++ b/subx/apps/crenshaw2-1.subx @@ -92,6 +92,22 @@ write_stderr: # s : (address array byte) -> <void> # end c3/return +write_stdout: # s : (address array byte) -> <void> + # write(1/stdout, (data) s+4, (size) *s) + # fd = 1 (stdout) + bb/copy . . . . . . . 1/imm32 # copy 1 to EBX + # x = s+4 + 8b/copy 1/mod/*+disp8 4/rm32/SIB 4/base/ESP 4/index/none . 1/r32/ECX 4/disp8 . # copy *(ESP+4) to ECX + 81 0/subop/add 3/mod/direct 1/rm32/ECX . . . . . 4/imm32 # add 4 to ECX + # size = *s + 8b/copy 1/mod/*+disp8 4/rm32/SIB 4/base/ESP 4/index/none . 2/r32/EDX 4/disp8 . # copy *(ESP+4) to EDX + 8b/copy 0/mod/indirect 2/rm32/EDX . . . 2/r32/EDX . . # copy *EDX to EDX + # call write() + b8/copy . . . . . . . 4/imm32/write # copy 1 to EAX + cd/syscall . . . . . . . 0x80/imm8 # int 80h + # end + c3/return + == data Newline: # size |