summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-11-28 21:24:44 +0100
committerNao Pross <naopross@thearcway.org>2018-11-28 21:24:44 +0100
commitb92ae73df00266f668abc10f6a492aad30692a31 (patch)
tree72360aedad2bb30dec6a8bab43f50ca2dc961707
parentUse 4 spaces for indent, update comments, change input buffer shift direction (diff)
downloadbase32asm-b92ae73df00266f668abc10f6a492aad30692a31.tar.gz
base32asm-b92ae73df00266f668abc10f6a492aad30692a31.zip
Add main loop to read more than 5 bytes
-rw-r--r--b32e.asm11
1 files changed, 11 insertions, 0 deletions
diff --git a/b32e.asm b/b32e.asm
index 9c136dd..af02dc3 100644
--- a/b32e.asm
+++ b/b32e.asm
@@ -77,9 +77,20 @@ b32e:
_start:
nop
+
+.loop:
+ ; try to read 5 bytes
call read_input
+ ; read nothing
+ cmp rax, 0
+ je .exit
+
+ ; convert to base 32
call b32e
+ ; print
call write_output
+ jmp .loop
+
.exit:
; linux x64 exit(0)
mov rax, 60