convert.asm: MOV -> LEA

This commit is contained in:
2025-07-10 00:56:56 +02:00
parent 467b5b7a0b
commit 2b3439c380

View File

@@ -18,7 +18,7 @@ section .text
; rsi* Points to cnvtBuff for writing characters ; rsi* Points to cnvtBuff for writing characters
; r8* Dividor for div ; r8* Dividor for div
dec2str: dec2str:
mov rsi, cnvtBuff lea rsi, [rel cnvtBuff]
test rdi, rdi test rdi, rdi
jnz .notZero jnz .notZero
mov byte [rsi], '0' mov byte [rsi], '0'
@@ -54,7 +54,7 @@ dec2str:
mov byte [rsi], EOS mov byte [rsi], EOS
.quit: .quit:
mov rax, cnvtBuff lea rax, [rel cnvtBuff]
ret ret
;----- udec2str(uint) -----; ;----- udec2str(uint) -----;
@@ -68,7 +68,7 @@ dec2str:
; rsi* Points to cnvtBuff for writing characters ; rsi* Points to cnvtBuff for writing characters
; r8* Dividor for div ; r8* Dividor for div
udec2str: udec2str:
mov rsi, cnvtBuff lea rsi, [rel cnvtBuff]
test rdi, rdi test rdi, rdi
jnz .notZero jnz .notZero
mov byte [rsi], '0' mov byte [rsi], '0'
@@ -95,7 +95,7 @@ udec2str:
mov byte [rsi], EOS mov byte [rsi], EOS
.quit: .quit:
mov rax, cnvtBuff lea rax, [rel cnvtBuff]
ret ret
;----- hex2str(uint, bool uppercase) -----; ;----- hex2str(uint, bool uppercase) -----;
@@ -112,7 +112,7 @@ udec2str:
; r11* Amount to add to number (for ASCII conversion, lowercase or uppercase) ; r11* Amount to add to number (for ASCII conversion, lowercase or uppercase)
hex2str: hex2str:
mov r9, rsi mov r9, rsi
mov rsi, cnvtBuff lea rsi, [rel cnvtBuff]
test rdi, rdi test rdi, rdi
jnz .notZero jnz .notZero
mov word [rsi], '0x' mov word [rsi], '0x'
@@ -156,5 +156,5 @@ hex2str:
mov byte [rsi], EOS mov byte [rsi], EOS
.quit: .quit:
mov rax, cnvtBuff lea rax, [rel cnvtBuff]
ret ret