From 14f1270fc7ea6d4bc82ce84ef4896f016ce40289 Mon Sep 17 00:00:00 2001
From: Christian Cunningham <cc@localhost>
Date: Sun, 14 Jul 2024 09:18:10 -0700
Subject: Simplification of Main Binary

---
 main.asm | 24 +++++++-----------------
 1 file 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
@@ -103,6 +89,10 @@ _main:
 	call	ffread
 	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
-- 
cgit v1.2.1