diff --git a/src/convert.asm b/src/convert.asm index ea08c7c..306851e 100644 --- a/src/convert.asm +++ b/src/convert.asm @@ -109,6 +109,7 @@ udec2str: ; rcx* Counts length of created string ; r8* Dividor for div ; r9* Store arg rsi (uppercase) +; r11* Amount to add to number (for ASCII conversion, lowercase or uppercase) hex2str: mov r9, rsi mov rsi, cnvtBuff @@ -122,19 +123,20 @@ hex2str: .notZero: mov rax, rdi xor rcx, rcx + + mov r8, 87 + test r9, r9 + cmovz r11, r8 + test r9, r9 + jz .convert + mov r11, 55 .convert: xor rdx, rdx mov r8, 16 div r8 cmp rdx, 10 jb .num - test r9, r9 - jz .lower - ;.upper: - add rdx, 55 - jmp .push - .lower: - add rdx, 87 + add rdx, r11 jmp .push .num: add rdx, '0'