From 02c8a5688feefb2226f9b02e2ec241d569d5a362 Mon Sep 17 00:00:00 2001 From: Gentoo Date: Tue, 31 Aug 2021 12:15:25 +1000 Subject: corrected spelling --- cat.asm | 8 +++++--- 1 file 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 -- cgit v1.2.3