From c85e31163227216e4f33857ddf878142549a3435 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 27 Nov 2018 22:07:14 +0100 Subject: Set input buffer to be 8 bytes to fit in a register for shl --- b32e.asm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/b32e.asm b/b32e.asm index 04ce671..ada7ff0 100644 --- a/b32e.asm +++ b/b32e.asm @@ -4,7 +4,7 @@ rfc4648 db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' section .bss -input_buffer resb 5 +input_buffer resb 8 output_buffer resb 8 section .text @@ -43,9 +43,12 @@ b32e: ; get 5 bits from the input xor rbx, rbx mov bl, byte [input_buffer] - and bl, 0x1f + ; mask and shift to convert to a number 0 ~ 32 + and bl, 0xf8 + shr bl, 3 ; rshift the input buffer + shl qword [input_buffer], 5 ; convert to base32 add rbx, rfc4648 -- cgit v1.2.1