summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGentoo <installgentoo@endianness.com>2021-08-31 12:15:25 +1000
committerGentoo <installgentoo@endianness.com>2021-08-31 12:15:25 +1000
commit02c8a5688feefb2226f9b02e2ec241d569d5a362 (patch)
treeb799c278fe918a7c98031e204e5348b791f31095
parent2f5888e7cd4503698280282b15117736f166c19e (diff)
downloadcat-asm-02c8a5688feefb2226f9b02e2ec241d569d5a362.tar.gz
cat-asm-02c8a5688feefb2226f9b02e2ec241d569d5a362.tar.bz2
cat-asm-02c8a5688feefb2226f9b02e2ec241d569d5a362.zip
corrected spelling
-rw-r--r--cat.asm8
1 files changed, 5 insertions, 3 deletions
diff --git a/cat.asm b/cat.asm
index abd7144..79c25ed 100644
--- a/cat.asm
+++ b/cat.asm
@@ -17,6 +17,7 @@ pop rsi ;Pop number of args from the stack
cmp esi,1
je stdin ;go to stdin mode if there are no arguments
+
pop rsi ;discard argv[0]
nextarg:
@@ -40,7 +41,7 @@ open:
copy:
mov edi, eax ;move the fd to rdi for read
- mov r15, rax ;copy the fd to an AMD64 addittional register for safekeeping
+ mov r15, rax ;copy the fd to an AMD64 additional register for safekeeping
call read
output:
@@ -68,8 +69,8 @@ stdin:
xor edi, edi ;stdin == 0
call read
- test eax,eax ; Check if the return value was 0
- je exit ; Jump to exit on EOF recieved
+ test eax,eax ;Check if the return value was 0
+ je exit ;Jump to exit on EOF recieved
mov edi, 1 ;file descriptor = stdout
mov edx, eax ;move num bytes read to number of bytes to write
@@ -79,6 +80,7 @@ stdin:
+
; read function, takes rdi as an argument (a fd)
read:
mov edx, bufflen ;read up to bufflen bytes at once