aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2024-07-14 09:18:10 -0700
committerChristian Cunningham <cc@localhost>2024-07-14 09:18:10 -0700
commit14f1270fc7ea6d4bc82ce84ef4896f016ce40289 (patch)
tree6275427e404f1ecaea79f01a9c4ebdb2061dd639
parentd0f1cf7f3759dfdb2fc41bd2316471a0cd1a7946 (diff)
Simplification of Main Binary
-rw-r--r--main.asm24
1 files changed, 7 insertions, 17 deletions
diff --git a/main.asm b/main.asm
index 9a2f7ee..56e36c2 100644
--- a/main.asm
+++ b/main.asm
@@ -1,5 +1,6 @@
%include "sys.inc"
%include "alloc.inc"
+%include "linked_list.inc"
;; TODO: Monad bind functions need to return a monad
%include "monad.inc"
%include "lstring.inc"
@@ -10,7 +11,7 @@
section .data
make_lstring test_lstring, "LString Test: Ok",10
- m_make test_lstring, test_lstring_len_b, 1
+ m_make test_lstring, test_lstring_len, 1
make_zstring test_zstring, "ZString Test: Ok",10
m_make test_zstring, test_zstring, 1
@@ -29,7 +30,7 @@
_TEST: dq "kO"
make_fbuffer "input.txt", test_file, FBUF_DEFAULT_SIZE
- m_make test_file, test_file_filedata, 1
+ m_make test_file, test_file_filedata, 1
global _main
@@ -70,21 +71,6 @@ _main:
m_bind data_to_zstring_mh
m_call print_zstring
- ;; m_call ffopen, rel m_test_file
- ;; flen test_file
- ;; push rax
- ;; m_return rel m_test_mdots
- ;; m_bind data_to_zstring_md
- ;; m_call print_zstring
- ;; pop rax
- ;; cmp rax, FBUF_DEFAULT_SIZE
- ;; ja .error.exit
- ;; fbegin test_file
- ;; fread test_file
- ;; fclose test_file
-
- ;; m_call print_filedata, rel m_test_file
-
alloc FBUF_ALLOC_SIZE
mov rbx, rax
m_call ffopen, rel m_test_file
@@ -104,6 +90,10 @@ _main:
fclose test_file
mov rax, [rel test_file_filedata + buffer]
+ mov rcx, 0
+ add rax, 54
+ mov [rax], rcx
+ mov rax, [rel test_file_filedata + buffer]
call print_zstring
free rbx, FBUF_ALLOC_SIZE