diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-06-10 23:09:30 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-06-10 23:09:30 -0700 |
commit | 7dac9ade153d736b7a183d073d83b7a17b22b4cc (patch) | |
tree | f19ba4be87306ae53caa0ba8c61e5202899cee48 /050_write.subx | |
parent | 72d893b6b1c0dcaea5c4a38dd6fd83fd0569dd79 (diff) | |
download | mu-7dac9ade153d736b7a183d073d83b7a17b22b4cc.tar.gz |
6507 - use syscall names everywhere
Diffstat (limited to '050_write.subx')
-rw-r--r-- | 050_write.subx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/050_write.subx b/050_write.subx index 24acf888..2567f444 100644 --- a/050_write.subx +++ b/050_write.subx @@ -6,10 +6,8 @@ # . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes Entry: # just exit; can't test _write just yet - # . syscall(exit, 0) bb/copy-to-ebx 0/imm32 - b8/copy-to-eax 1/imm32/exit - cd/syscall 0x80/imm8 + e8/call syscall_exit/disp32 _write: # fd: int, s: (addr array byte) # . prologue @@ -30,8 +28,7 @@ _write: # fd: int, s: (addr array byte) 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 2/r32/edx 0xc/disp8 . # copy *(ebp+12) to edx 8b/copy 0/mod/indirect 2/rm32/edx . . . 2/r32/edx . . # copy *edx to edx # . syscall - b8/copy-to-eax 4/imm32/write - cd/syscall 0x80/imm8 + e8/call syscall_write/disp32 # if (eax < 0) abort 3d/compare-eax-with 0/imm32 0f 8c/jump-if-< $_write:abort/disp32 @@ -50,8 +47,7 @@ $_write:abort: # can't write a message here for risk of an infinite loop, so we'll use a special exit code instead # . syscall(exit, 255) bb/copy-to-ebx 0xff/imm32 - b8/copy-to-eax 1/imm32/exit - cd/syscall 0x80/imm8 + e8/call syscall_exit/disp32 # never gets here # . . vim:nowrap:textwidth=0 |