diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-03-25 22:39:06 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-03-25 22:39:06 -0400 |
commit | f3a773c750181f8f3d52fd672587814275a04bd7 (patch) | |
tree | 8c37ae892960f0988aa6006661beef4ff8b8e8e5 /tnslc/copy.tnsl | |
parent | 0bc05b40d541483d16445b98ea0841d1912a8198 (diff) |
Remove old parser files
Diffstat (limited to 'tnslc/copy.tnsl')
-rw-r--r-- | tnslc/copy.tnsl | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/tnslc/copy.tnsl b/tnslc/copy.tnsl deleted file mode 100644 index 0050d1a..0000000 --- a/tnslc/copy.tnsl +++ /dev/null @@ -1,39 +0,0 @@ -:include "c_wrap_linux.tnsl" -# :include "utils.tnsl" - - -{}uint8 wrong_args = "Usage: copy [from] [to]" -{}uint8 write_one = "\0\n\0" - -# Proof of concept copy program -/; main (int argc, ~~uint8 argv) [int] - asm "mov r8, rdi" - asm "mov r9, rsi" - - /; if (argc < 3) - _printf(~wrong_args{0}) - return 1 - ;/ - - ~void read_handle = _open_file(argv{1}) - ~void write_handle = _create_file(argv{2}) - - _print_num(~_dec{0}, read_handle) - _print_num(~_dec{0}, write_handle) - - uint8 buf = 0 - int read_count = 0 - /; loop - read_count = _read_byte(read_handle, ~buf) - /; if (read_count == 0) - break - ;/ - _write_byte(write_handle, ~buf) - read_count = 0 - ;/ - - _close_file(read_handle) - _close_file(write_handle) - - return 0 -;/ |