diff options
author | Christian Cunningham <cc@localhost> | 2024-07-13 23:27:06 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2024-07-13 23:27:06 -0700 |
commit | 28fbc837eaff40b0f992233e583f8352f13dddfe (patch) | |
tree | 6f0bdf26310217cf9770162156799f9da43a241c /file.inc | |
parent | 0a4608eb004ebe720068cc538158bda3156948f2 (diff) |
Dynamic allocation for file data!
Diffstat (limited to 'file.inc')
-rw-r--r-- | file.inc | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,6 +1,7 @@ %ifndef FILE_INC %define FILE_INC -%define FBUF_DEFAULT_SIZE 1024*32 +%define FBUF_DEFAULT_SIZE 16 +%define FBUF_ALLOC_SIZE 1024*32 %ifndef SYS_INC %include "sys.inc" %endif @@ -96,6 +97,20 @@ ffopen: pop rbp ret +ffread: + push rbp + mov rbp, rsp + mov rdi, [rax + fd] + mov rdi, [rdi] + mov rsi, [rax + buffer] + mov rdx, [rax + size] + mov rax, SYS_READ + syscall + ;; + mov rsp, rbp + pop rbp + ret + print_filedata: push rbp mov rbp, rsp |