diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-12-13 16:10:14 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-12-13 16:10:14 -0500 |
commit | 61e1e5ce377719c8e9e437e5ba79ba06fc1de4ba (patch) | |
tree | 10ad1cbb37ab6fc2cbfc6971f9d00c8610b77f70 /tnslc/compile/outbuf.tnsl | |
parent | 8bcb71c01fffa6cb576ad77f90ff3efe5c4c8fca (diff) |
Type generation for compile modulesorigin
Diffstat (limited to 'tnslc/compile/outbuf.tnsl')
-rw-r--r-- | tnslc/compile/outbuf.tnsl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tnslc/compile/outbuf.tnsl b/tnslc/compile/outbuf.tnsl new file mode 100644 index 0000000..7394feb --- /dev/null +++ b/tnslc/compile/outbuf.tnsl @@ -0,0 +1,31 @@ +struct OutBuf { + utils.Vector + hsec, + dsec, + csec +} + +/; method OutBuf + /; init + self.hsec.init(1) + self.dsec.init(1) + self.csec.init(1) + ;/ + + /; write_to_file (~utils.File fout) + fout`.open() + fout`.write_cstr("bits 64\n\0") + fout`.write_cstr(self.hsec.as_cstr()) + fout`.write_cstr("\nsection .data\n\0") + fout`.write_cstr(self.dsec.as_cstr()) + fout`.write_cstr("\nsection .text\n\0") + fout`.write_cstr(self.csec.as_cstr()) + fout`.close() + ;/ + + /; end + self.hsec.end() + self.dsec.end() + self.csec.end() + ;/ +;/ |