Get rid of unneeded function prologues/epilogues

This commit is contained in:
2025-06-26 07:23:29 +02:00
parent 3730086281
commit fc28643c1a
4 changed files with 6 additions and 103 deletions

View File

@ -21,9 +21,6 @@ section .text
;----- fopen(const char *filename, const char mode) -----;
; return value: pointer to file or value < 0 (neg errno) if file failed to open
fopen:
push rbp
mov rbp, rsp
cmp sil, 'r'
je .setMode_r
cmp sil, 'w'
@ -63,14 +60,10 @@ fopen:
syscall
.quit:
leave
ret
;----- fclose(FILE* fp) -----;
; return value: 0 on success, below 0 otherwise (neg errno)
fclose:
push rbp
mov rbp, rsp
cmp rdi, 3
jl .ebadf
@ -82,15 +75,11 @@ fclose:
mov rax, -9
.quit:
leave
ret
;----- fwrite(FILE* fp, char* str) -----;
; writes a string to opened file
; return value: amount of written characters on success, below 0 otherwise (neg errno)
fwrite:
push rbp
mov rbp, rsp
cmp rdi, 3
jl .ebadf
@ -107,5 +96,4 @@ fwrite:
mov rax, -9
.quit:
leave
ret