__INTERNAL_fmt: write_format_data writes to array directly; do not strcat __fmt_Buff to array
This commit is contained in:
@@ -524,14 +524,6 @@ __INTERNAL_fmt:
|
|||||||
test rbx, rbx
|
test rbx, rbx
|
||||||
jz .wrapup_print
|
jz .wrapup_print
|
||||||
mov byte [r15+r10+1], EOS
|
mov byte [r15+r10+1], EOS
|
||||||
lea rdi, [r15]
|
|
||||||
lea rsi, [rel __fmt_Buff]
|
|
||||||
mov rdx, rbx
|
|
||||||
sub rsp, SIZE_QWORD
|
|
||||||
push r11
|
|
||||||
call strcat
|
|
||||||
pop rax
|
|
||||||
add rsp, SIZE_QWORD
|
|
||||||
jmp .quit
|
jmp .quit
|
||||||
.wrapup_print:
|
.wrapup_print:
|
||||||
mov rax, NR_write
|
mov rax, NR_write
|
||||||
|
@@ -85,6 +85,7 @@ extern strcat
|
|||||||
extern strclr
|
extern strclr
|
||||||
extern strcmp
|
extern strcmp
|
||||||
extern strfind
|
extern strfind
|
||||||
|
extern format
|
||||||
;convert.asm
|
;convert.asm
|
||||||
extern atoi
|
extern atoi
|
||||||
extern itoa
|
extern itoa
|
||||||
@@ -421,7 +422,11 @@ section .rodata
|
|||||||
addTest(fgetmod2, "fgetmod(statbuff2)")
|
addTest(fgetmod2, "fgetmod(statbuff2)")
|
||||||
fgetmodStr db "\t- File permissions of file '%s': %04o\n",EOS
|
fgetmodStr db "\t- File permissions of file '%s': %04o\n",EOS
|
||||||
|
|
||||||
|
fmt_str db "%s",EOS
|
||||||
|
|
||||||
section .bss
|
section .bss
|
||||||
|
fmt_out resb 5
|
||||||
|
fmt_over resb 64
|
||||||
inputBuffer_4 resb 4
|
inputBuffer_4 resb 4
|
||||||
inputBuffer_32 resb 32
|
inputBuffer_32 resb 32
|
||||||
strBuff1 resb 64
|
strBuff1 resb 64
|
||||||
@@ -1660,6 +1665,16 @@ _start:
|
|||||||
sub rcx, r14
|
sub rcx, r14
|
||||||
call printf
|
call printf
|
||||||
|
|
||||||
|
lea rdi, [rel fmt_out]
|
||||||
|
mov rsi, 5
|
||||||
|
lea rdx, [rel fmt_str]
|
||||||
|
xor rcx, rcx
|
||||||
|
call format
|
||||||
|
lea rdi, [rel fmt_out]
|
||||||
|
call puts
|
||||||
|
lea rdi, [rel fmt_over]
|
||||||
|
call puts
|
||||||
|
|
||||||
;--- exit()
|
;--- exit()
|
||||||
xor rdi, rdi
|
xor rdi, rdi
|
||||||
call exit
|
call exit
|
||||||
|
Reference in New Issue
Block a user