From 778c56cc6009383d0debbddf058320f6def75880 Mon Sep 17 00:00:00 2001 From: julianb0 Date: Mon, 15 Jul 2019 20:46:00 +0200 Subject: [PATCH] stuff --- fs/abcdef.txt | 9 +++++++++ fs/empty.txt | 0 ka/crt/fmt/doprnt.k | 22 ++++++++++------------ ka/crt/fmt/printf.k | 2 -- ka/usr/cmd/main.k | 1 + vm/la/kvisc.lang | 11 +++++------ 6 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 fs/abcdef.txt create mode 100644 fs/empty.txt diff --git a/fs/abcdef.txt b/fs/abcdef.txt new file mode 100644 index 0000000..91bf19d --- /dev/null +++ b/fs/abcdef.txt @@ -0,0 +1,9 @@ +abc +def +ghi +jkl +mno +pqr +stu +vwx +yz$ diff --git a/fs/empty.txt b/fs/empty.txt new file mode 100644 index 0000000..e69de29 diff --git a/ka/crt/fmt/doprnt.k b/ka/crt/fmt/doprnt.k index 7e28529..b50fcec 100644 --- a/ka/crt/fmt/doprnt.k +++ b/ka/crt/fmt/doprnt.k @@ -6,7 +6,6 @@ ; int doprnt(PUTC putc, int n, const char *fmt, va_list ap) ; doprnt: - dump 0 enter 8 mov q[rbp-8], rbx @@ -30,9 +29,9 @@ doprnt: mov rdi, rbx scasb.rep.nz rdi, '%' -.print_regular: ; everything below rdi is a regular character; print it - b.e rbx, rdi, .check_modf +.print_regular: + b.z rbx, rdi, .check_modf mov ax0, b[rbx] call .doput @@ -49,14 +48,14 @@ doprnt: mov rax, b[rbx+1] add rbx, 2 - b.e rax, 's', .modf_s - b.e rax, 'c', .modf_c - b.e rax, 'p', .modf_p - b.e rax, 'x', .modf_x - b.e rax, 'd', .modf_d - b.e rax, 'o', .modf_o - b.e rax, 'b', .modf_b - b.e rax, '%', .modf_percent + b.z rax, 's', .modf_s + b.z rax, 'c', .modf_c + b.z rax, 'p', .modf_p + b.z rax, 'x', .modf_x + b.z rax, 'd', .modf_d + b.z rax, 'o', .modf_o + b.z rax, 'b', .modf_b + b.z rax, '%', .modf_percent ; unrecognized jmp .bad_modifier @@ -176,7 +175,6 @@ doprnt: mov rsi, q[rbp-48] mov nx3, q[rbp-56] leave - dump 1 ret ; ; prints ax0 diff --git a/ka/crt/fmt/printf.k b/ka/crt/fmt/printf.k index a14cbb2..6279299 100644 --- a/ka/crt/fmt/printf.k +++ b/ka/crt/fmt/printf.k @@ -13,7 +13,6 @@ putc: ; int printf(const char *fmt, ...) ; printf: - dump 0 mov ax2, ax0 mov ax0, putc mov ax1, STRLEN_MAX @@ -24,7 +23,6 @@ printf: ; int nprintf(const char *fmt, int n, ...) ; nprintf: - dump 0 mov ax2, ax0 mov ax0, putc lea ax3, b[rsp+8] diff --git a/ka/usr/cmd/main.k b/ka/usr/cmd/main.k index b2b0fb2..e03f426 100644 --- a/ka/usr/cmd/main.k +++ b/ka/usr/cmd/main.k @@ -30,6 +30,7 @@ main: .input_loop: pause pause + pause ; Fill .buf with user input scan rax diff --git a/vm/la/kvisc.lang b/vm/la/kvisc.lang index 9002bc3..710101e 100644 --- a/vm/la/kvisc.lang +++ b/vm/la/kvisc.lang @@ -55,18 +55,17 @@ match-empty-string-at-end = "TRUE"> - (inv|flg|[re]?pc) - [re]?[abcd]xl? - [re]?[sd]il? - [re]?[sbi]pl? + (inv|flg|[re]pc) + [re][abcdfg]x + [re][sd]i + [re][sbi]p [a-z]x?[0-9]+[bwdlq]? [c-gs]s [re]flags ([gil]d)tr - [x-z]mm[0-9]+ - [re]?[a-d][xhl] + [x-z]?mmx?[0-9]+ (s[at]|[dc]r)[0-9]+