diff options
author | Nao Pross <naopross@thearcway.org> | 2018-11-27 22:07:14 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-11-27 22:07:14 +0100 |
commit | c85e31163227216e4f33857ddf878142549a3435 (patch) | |
tree | ef65b351d2308e17a3f07822fff23065eb05b51e /b32e.asm | |
parent | Add Intel IA32 x64 instruction set manual (diff) | |
download | base32asm-c85e31163227216e4f33857ddf878142549a3435.tar.gz base32asm-c85e31163227216e4f33857ddf878142549a3435.zip |
Set input buffer to be 8 bytes to fit in a register for shl
Diffstat (limited to 'b32e.asm')
-rw-r--r-- | b32e.asm | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |