diff options
Diffstat (limited to 'prototypes')
58 files changed, 362 insertions, 362 deletions
diff --git a/prototypes/browse/1-print-file.mu b/prototypes/browse/1-print-file.mu index 58e65171..e89f1cec 100644 --- a/prototypes/browse/1-print-file.mu +++ b/prototypes/browse/1-print-file.mu @@ -26,7 +26,7 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } } diff --git a/prototypes/browse/10.mu b/prototypes/browse/10.mu index cd0f748b..834fec90 100644 --- a/prototypes/browse/10.mu +++ b/prototypes/browse/10.mu @@ -9,7 +9,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -44,7 +44,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color-on-screen 0xec, 7 # 236 = darkish gray + start-color 0, 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -64,7 +64,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= @@ -75,7 +75,7 @@ $line-loop: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -95,7 +95,7 @@ $check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $check-state } @@ -103,7 +103,7 @@ $check-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $check-state } @@ -115,7 +115,7 @@ $check-state: { { break-if-!= # r->current-state == 1 && c == '*' => normal text - reset-formatting-on-screen + reset-formatting 0 copy-to *state, 0 break $check-state } @@ -123,7 +123,7 @@ $check-state: { { break-if-!= # r->current-state == 1 && c == '_' => normal text - reset-formatting-on-screen + reset-formatting 0 copy-to *state, 0 break $check-state } @@ -138,11 +138,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -171,6 +171,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/11.mu b/prototypes/browse/11.mu index b4fa36ce..73e1b21e 100644 --- a/prototypes/browse/11.mu +++ b/prototypes/browse/11.mu @@ -7,7 +7,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -42,7 +42,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color-on-screen 0xec, 7 # 236 = darkish gray + start-color 0, 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -64,7 +64,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col $char-loop: { compare col, rightcol break-if->= @@ -79,7 +79,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $update-attributes:check-state } @@ -87,7 +87,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $update-attributes:check-state } @@ -99,8 +99,8 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '*' => normal text - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 break $update-attributes:check-state } @@ -108,8 +108,8 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '_' => normal text - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 break $update-attributes:check-state } @@ -119,7 +119,7 @@ $update-attributes:check-state: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -134,11 +134,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -167,6 +167,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/12.mu b/prototypes/browse/12.mu index a8ba3f99..ec93564c 100644 --- a/prototypes/browse/12.mu +++ b/prototypes/browse/12.mu @@ -6,7 +6,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -41,7 +41,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color-on-screen 0xec, 7 # 236 = darkish gray + start-color 0, 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -63,7 +63,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col $char-loop: { compare col, rightcol break-if->= @@ -78,7 +78,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $update-attributes:check-state } @@ -86,7 +86,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $update-attributes:check-state } @@ -98,10 +98,10 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '*' => print c, then normal text - print-byte-to-screen c + print-byte 0, c col <- increment - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -109,10 +109,10 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '_' => print c, then normal text - print-byte-to-screen c + print-byte 0, c col <- increment - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -122,7 +122,7 @@ $update-attributes:check-state: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -137,11 +137,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -170,6 +170,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/13.mu b/prototypes/browse/13.mu index 48e9c112..c0371954 100644 --- a/prototypes/browse/13.mu +++ b/prototypes/browse/13.mu @@ -6,7 +6,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -41,7 +41,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color-on-screen 0xec, 7 # 236 = darkish gray + start-color 0, 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -63,7 +63,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col $char-loop: { compare col, rightcol break-if->= @@ -78,7 +78,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $update-attributes:check-state } @@ -86,7 +86,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $update-attributes:check-state } @@ -99,10 +99,10 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '*' => print c, then normal text - print-byte-to-screen c + print-byte 0, c col <- increment - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -110,10 +110,10 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '_' => print c, then normal text - print-byte-to-screen c + print-byte 0, c col <- increment - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -123,7 +123,7 @@ $update-attributes:check-state: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -138,11 +138,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -171,6 +171,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/14.mu b/prototypes/browse/14.mu index 9bcc3751..0ad5d5c3 100644 --- a/prototypes/browse/14.mu +++ b/prototypes/browse/14.mu @@ -4,7 +4,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -39,7 +39,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color-on-screen 0xec, 7 # 236 = darkish gray + start-color 0, 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -61,7 +61,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col $char-loop: { compare col, rightcol break-if->= @@ -76,7 +76,7 @@ $change-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $change-state } @@ -84,7 +84,7 @@ $change-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $change-state } @@ -97,10 +97,10 @@ $change-state: { { break-if-!= # r->current-state == 1 && c == '*' => print c, then normal text - print-byte-to-screen c + print-byte 0, c col <- increment - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -108,10 +108,10 @@ $change-state: { { break-if-!= # r->current-state == 1 && c == '_' => print c, then normal text - print-byte-to-screen c + print-byte 0, c col <- increment - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -121,7 +121,7 @@ $change-state: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -136,11 +136,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -169,6 +169,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/15-headers-broken.mu b/prototypes/browse/15-headers-broken.mu index 59566e56..c9c722e4 100644 --- a/prototypes/browse/15-headers-broken.mu +++ b/prototypes/browse/15-headers-broken.mu @@ -9,7 +9,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -49,7 +49,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color-on-screen 0xec, 7 # 236 = darkish gray + start-color 0, 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -71,7 +71,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col $char-loop: { compare col, rightcol break-if->= @@ -86,7 +86,7 @@ $change-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $change-state } @@ -94,7 +94,7 @@ $change-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 break $change-state } @@ -121,10 +121,10 @@ $change-state: { { break-if-!= # r->current-state == 1 && c == '*' => print c, then normal text - print-byte-to-screen c + print-byte 0, c col <- increment - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -132,10 +132,10 @@ $change-state: { { break-if-!= # r->current-state == 1 && c == '_' => print c, then normal text - print-byte-to-screen c + print-byte 0, c col <- increment - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -150,8 +150,8 @@ $change-state: { var s/eax: (addr boolean) <- get r, start-of-line? copy-to *s, 1 # true # switch to normal text - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray # no need to print newlines break $char-loop } @@ -163,7 +163,7 @@ $change-state: { copy-to *s, 0 # false } # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } @@ -178,11 +178,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -211,6 +211,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/16-screen-state-broken.mu b/prototypes/browse/16-screen-state-broken.mu index d0817bdf..3ea359f2 100644 --- a/prototypes/browse/16-screen-state-broken.mu +++ b/prototypes/browse/16-screen-state-broken.mu @@ -26,7 +26,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-keyboard-immediate-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 var screen-position-state-storage: screen-position-state var screen-position-state: (addr screen-position-state) init-screen-position-state screen-position-state, nrows, ncols @@ -68,8 +68,8 @@ fn render-normal in: (addr buffered-file), state: (addr screen-position-state) { # if (c == EOF) break compare c, 0xffffffff # EOF marker break-if-= - # if (c == '*') start-bold-on-screen, render-until-asterisk(in, state), reset - # else if (c == '_') start-bold-on-screen, render-until-underscore(in, state), reset + # if (c == '*') start-bold 0,, render-until-asterisk(in, state), reset + # else if (c == '_') start-bold 0,, render-until-underscore(in, state), reset # else if (c == '#') compute-color, start color, render-header-line(in, state), reset # else add-char(state, c) } @@ -183,6 +183,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/17-file-state-broken/file-state.mu b/prototypes/browse/17-file-state-broken/file-state.mu index 66b8c6c4..cf39e9d8 100644 --- a/prototypes/browse/17-file-state-broken/file-state.mu +++ b/prototypes/browse/17-file-state-broken/file-state.mu @@ -28,6 +28,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/17-file-state-broken/main.mu b/prototypes/browse/17-file-state-broken/main.mu index 44eccc2e..a273c0fe 100644 --- a/prototypes/browse/17-file-state-broken/main.mu +++ b/prototypes/browse/17-file-state-broken/main.mu @@ -10,7 +10,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { # initialize screen state from screen size var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 var screen-position-state-storage: screen-position-state var screen-position-state: (addr screen-position-state) init-screen-position-state screen-position-state, nrows, ncols @@ -44,8 +44,8 @@ fn render-normal fs: (addr file-state), state: (addr screen-position-state) { # if (c == EOF) break compare c, 0xffffffff # EOF marker break-if-= - # if (c == '*') start-bold-on-screen, render-until-asterisk(fs, state), reset - # else if (c == '_') start-bold-on-screen, render-until-underscore(fs, state), reset + # if (c == '*') start-bold 0,, render-until-asterisk(fs, state), reset + # else if (c == '_') start-bold 0,, render-until-underscore(fs, state), reset # else if (c == '#' and fs is at start of line) compute-color, start color, render-header-line(fs, state), reset # else add-char(state, c) } diff --git a/prototypes/browse/18/file-state.mu b/prototypes/browse/18/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/18/file-state.mu +++ b/prototypes/browse/18/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/18/main.mu b/prototypes/browse/18/main.mu index 21e3f0c7..4320a460 100644 --- a/prototypes/browse/18/main.mu +++ b/prototypes/browse/18/main.mu @@ -19,7 +19,7 @@ fn render-normal fs: (addr file-state) { compare c, 0xffffffff # EOF marker break-if-= # - print-byte-to-screen c + print-byte 0, c # loop } diff --git a/prototypes/browse/19/file-state.mu b/prototypes/browse/19/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/19/file-state.mu +++ b/prototypes/browse/19/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/19/screen-position-state.mu b/prototypes/browse/19/screen-position-state.mu index 99d51a4a..543f1871 100644 --- a/prototypes/browse/19/screen-position-state.mu +++ b/prototypes/browse/19/screen-position-state.mu @@ -18,7 +18,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -63,7 +63,7 @@ fn start-drawing _self: (addr screen-position-state) { fn add-char _self: (addr screen-position-state), c: byte { var self/esi: (addr screen-position-state) <- copy _self # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -131,5 +131,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/2.mu b/prototypes/browse/2.mu index 0c31e82a..52245b6c 100644 --- a/prototypes/browse/2.mu +++ b/prototypes/browse/2.mu @@ -25,7 +25,7 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } } diff --git a/prototypes/browse/20/file-state.mu b/prototypes/browse/20/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/20/file-state.mu +++ b/prototypes/browse/20/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/20/screen-position-state.mu b/prototypes/browse/20/screen-position-state.mu index 187b81b6..41ad2705 100644 --- a/prototypes/browse/20/screen-position-state.mu +++ b/prototypes/browse/20/screen-position-state.mu @@ -18,7 +18,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -71,7 +71,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -140,5 +140,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/21/file-state.mu b/prototypes/browse/21/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/21/file-state.mu +++ b/prototypes/browse/21/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/21/screen-position-state.mu b/prototypes/browse/21/screen-position-state.mu index 841b70d8..2316d3ae 100644 --- a/prototypes/browse/21/screen-position-state.mu +++ b/prototypes/browse/21/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -70,7 +70,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -139,5 +139,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/22/file-state.mu b/prototypes/browse/22/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/22/file-state.mu +++ b/prototypes/browse/22/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/22/screen-position-state.mu b/prototypes/browse/22/screen-position-state.mu index 2201e019..245f834e 100644 --- a/prototypes/browse/22/screen-position-state.mu +++ b/prototypes/browse/22/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -70,7 +70,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -159,5 +159,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/23-multiple-pages/file-state.mu b/prototypes/browse/23-multiple-pages/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/23-multiple-pages/file-state.mu +++ b/prototypes/browse/23-multiple-pages/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/23-multiple-pages/screen-position-state.mu b/prototypes/browse/23-multiple-pages/screen-position-state.mu index a8faf9fd..6fe1ad93 100644 --- a/prototypes/browse/23-multiple-pages/screen-position-state.mu +++ b/prototypes/browse/23-multiple-pages/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -39,7 +39,7 @@ fn start-drawing _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var tmp/eax: (addr int) <- copy 0 var tmp2/ecx: int <- copy 0 - clear-screen + clear-screen 0 # self->leftcol = page-margin tmp <- get self, leftcol copy-to *tmp, 5 # left-margin @@ -71,7 +71,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -160,5 +160,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/24-bold/file-state.mu b/prototypes/browse/24-bold/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/24-bold/file-state.mu +++ b/prototypes/browse/24-bold/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/24-bold/main.mu b/prototypes/browse/24-bold/main.mu index 2362e695..393eb29f 100644 --- a/prototypes/browse/24-bold/main.mu +++ b/prototypes/browse/24-bold/main.mu @@ -43,7 +43,7 @@ $render-normal:body: { compare c, 0x2a # '*' { break-if-!= - start-bold-on-screen + start-bold 0 render-until-asterisk fs, state normal-text loop $render-normal:body @@ -52,11 +52,11 @@ $render-normal:body: { compare c, 0x5f # '_' { break-if-!= - start-color-on-screen 0xec, 7 # 236 = darkish gray - start-bold-on-screen + start-color 0, 0xec, 7 # 236 = darkish gray + start-bold 0 render-until-underscore fs, state - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray loop $render-normal:body } # @@ -115,6 +115,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/24-bold/screen-position-state.mu b/prototypes/browse/24-bold/screen-position-state.mu index a8faf9fd..6fe1ad93 100644 --- a/prototypes/browse/24-bold/screen-position-state.mu +++ b/prototypes/browse/24-bold/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -39,7 +39,7 @@ fn start-drawing _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var tmp/eax: (addr int) <- copy 0 var tmp2/ecx: int <- copy 0 - clear-screen + clear-screen 0 # self->leftcol = page-margin tmp <- get self, leftcol copy-to *tmp, 5 # left-margin @@ -71,7 +71,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -160,5 +160,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/25-soft-newlines/file-state.mu b/prototypes/browse/25-soft-newlines/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/25-soft-newlines/file-state.mu +++ b/prototypes/browse/25-soft-newlines/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/25-soft-newlines/main.mu b/prototypes/browse/25-soft-newlines/main.mu index ef1a898f..af19faa2 100644 --- a/prototypes/browse/25-soft-newlines/main.mu +++ b/prototypes/browse/25-soft-newlines/main.mu @@ -87,7 +87,7 @@ $render-normal:flush-buffered-newline: { compare c, 0x2a # '*' { break-if-!= - start-bold-on-screen + start-bold 0 render-until-asterisk fs, state normal-text loop $render-normal:loop @@ -96,11 +96,11 @@ $render-normal:flush-buffered-newline: { compare c, 0x5f # '_' { break-if-!= - start-color-on-screen 0xec, 7 # 236 = darkish gray - start-bold-on-screen + start-color 0, 0xec, 7 # 236 = darkish gray + start-bold 0 render-until-underscore fs, state - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray loop $render-normal:loop } # @@ -159,6 +159,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/25-soft-newlines/screen-position-state.mu b/prototypes/browse/25-soft-newlines/screen-position-state.mu index afaf713e..dec8b502 100644 --- a/prototypes/browse/25-soft-newlines/screen-position-state.mu +++ b/prototypes/browse/25-soft-newlines/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0xa var ncols/ecx: int <- copy 0x20 - nrows, ncols <- screen-size # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. + nrows, ncols <- screen-size 0 # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -39,7 +39,7 @@ fn start-drawing _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var tmp/eax: (addr int) <- copy 0 var tmp2/ecx: int <- copy 0 - clear-screen + clear-screen 0 # self->leftcol = page-margin tmp <- get self, leftcol copy-to *tmp, 5 # left-margin @@ -72,7 +72,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -167,5 +167,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/26-headers/file-state.mu b/prototypes/browse/26-headers/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/26-headers/file-state.mu +++ b/prototypes/browse/26-headers/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/26-headers/main.mu b/prototypes/browse/26-headers/main.mu index 68b662bf..b87f1416 100644 --- a/prototypes/browse/26-headers/main.mu +++ b/prototypes/browse/26-headers/main.mu @@ -96,7 +96,7 @@ $render-normal:flush-buffered-newline: { compare c, 0x2a # '*' { break-if-!= - start-bold-on-screen + start-bold 0 render-until-asterisk fs, state normal-text loop $render-normal:loop @@ -105,11 +105,11 @@ $render-normal:flush-buffered-newline: { compare c, 0x5f # '_' { break-if-!= - start-color-on-screen 0xec, 7 # 236 = darkish gray - start-bold-on-screen + start-color 0, 0xec, 7 # 236 = darkish gray + start-bold 0 render-until-underscore fs, state - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray loop $render-normal:loop } # @@ -169,32 +169,32 @@ $render-header-line:body: { # colors for a light background, going from bright to dark (meeting up with bold-text) fn start-heading header-level: int { $start-heading:body: { - start-bold-on-screen + start-bold 0 compare header-level, 1 { break-if-!= - start-color-on-screen 0xa0, 7 + start-color 0, 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color-on-screen 0x7c, 7 + start-color 0, 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color-on-screen 0x58, 7 + start-color 0, 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color-on-screen 0x34, 7 + start-color 0, 0x34, 7 break $start-heading:body } - start-color-on-screen 0xe8, 7 + start-color 0, 0xe8, 7 } } @@ -247,6 +247,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/26-headers/screen-position-state.mu b/prototypes/browse/26-headers/screen-position-state.mu index afaf713e..dec8b502 100644 --- a/prototypes/browse/26-headers/screen-position-state.mu +++ b/prototypes/browse/26-headers/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0xa var ncols/ecx: int <- copy 0x20 - nrows, ncols <- screen-size # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. + nrows, ncols <- screen-size 0 # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -39,7 +39,7 @@ fn start-drawing _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var tmp/eax: (addr int) <- copy 0 var tmp2/ecx: int <- copy 0 - clear-screen + clear-screen 0 # self->leftcol = page-margin tmp <- get self, leftcol copy-to *tmp, 5 # left-margin @@ -72,7 +72,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -167,5 +167,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/27/file-state.mu b/prototypes/browse/27/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/27/file-state.mu +++ b/prototypes/browse/27/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/27/main.mu b/prototypes/browse/27/main.mu index 8f698454..9d578ccc 100644 --- a/prototypes/browse/27/main.mu +++ b/prototypes/browse/27/main.mu @@ -103,7 +103,7 @@ $render-normal:flush-buffered-newline: { compare c, 0x2a # '*' { break-if-!= - start-bold-on-screen + start-bold 0 render-until-asterisk fs, state normal-text loop $render-normal:loop @@ -112,11 +112,11 @@ $render-normal:flush-buffered-newline: { compare c, 0x5f # '_' { break-if-!= - start-color-on-screen 0xec, 7 # 236 = darkish gray - start-bold-on-screen + start-color 0, 0xec, 7 # 236 = darkish gray + start-bold 0 render-until-underscore fs, state - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray loop $render-normal:loop } # @@ -176,32 +176,32 @@ $render-header-line:body: { # colors for a light background, going from bright to dark (meeting up with bold-text) fn start-heading header-level: int { $start-heading:body: { - start-bold-on-screen + start-bold 0 compare header-level, 1 { break-if-!= - start-color-on-screen 0xa0, 7 + start-color 0, 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color-on-screen 0x7c, 7 + start-color 0, 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color-on-screen 0x58, 7 + start-color 0, 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color-on-screen 0x34, 7 + start-color 0, 0x34, 7 break $start-heading:body } - start-color-on-screen 0xe8, 7 + start-color 0, 0xe8, 7 } } @@ -254,6 +254,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/27/screen-position-state.mu b/prototypes/browse/27/screen-position-state.mu index afaf713e..dec8b502 100644 --- a/prototypes/browse/27/screen-position-state.mu +++ b/prototypes/browse/27/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0xa var ncols/ecx: int <- copy 0x20 - nrows, ncols <- screen-size # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. + nrows, ncols <- screen-size 0 # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -39,7 +39,7 @@ fn start-drawing _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var tmp/eax: (addr int) <- copy 0 var tmp2/ecx: int <- copy 0 - clear-screen + clear-screen 0 # self->leftcol = page-margin tmp <- get self, leftcol copy-to *tmp, 5 # left-margin @@ -72,7 +72,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -167,5 +167,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/28/file-state.mu b/prototypes/browse/28/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/28/file-state.mu +++ b/prototypes/browse/28/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/28/main.mu b/prototypes/browse/28/main.mu index f61e80f9..a3e207d2 100644 --- a/prototypes/browse/28/main.mu +++ b/prototypes/browse/28/main.mu @@ -104,7 +104,7 @@ $render-normal:flush-buffered-newline: { compare c, 0x2a # '*' { break-if-!= - start-bold-on-screen + start-bold 0 render-until-asterisk fs, state normal-text break $render-normal:loop-body @@ -113,11 +113,11 @@ $render-normal:flush-buffered-newline: { compare c, 0x5f # '_' { break-if-!= - start-color-on-screen 0xec, 7 # 236 = darkish gray - start-bold-on-screen + start-color 0, 0xec, 7 # 236 = darkish gray + start-bold 0 render-until-underscore fs, state - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray break $render-normal:loop-body } # @@ -178,32 +178,32 @@ $render-header-line:body: { # colors for a light background, going from bright to dark (meeting up with bold-text) fn start-heading header-level: int { $start-heading:body: { - start-bold-on-screen + start-bold 0 compare header-level, 1 { break-if-!= - start-color-on-screen 0xa0, 7 + start-color 0, 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color-on-screen 0x7c, 7 + start-color 0, 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color-on-screen 0x58, 7 + start-color 0, 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color-on-screen 0x34, 7 + start-color 0, 0x34, 7 break $start-heading:body } - start-color-on-screen 0xe8, 7 + start-color 0, 0xe8, 7 } } @@ -256,6 +256,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/28/screen-position-state.mu b/prototypes/browse/28/screen-position-state.mu index afaf713e..dec8b502 100644 --- a/prototypes/browse/28/screen-position-state.mu +++ b/prototypes/browse/28/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0xa var ncols/ecx: int <- copy 0x20 - nrows, ncols <- screen-size # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. + nrows, ncols <- screen-size 0 # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -39,7 +39,7 @@ fn start-drawing _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var tmp/eax: (addr int) <- copy 0 var tmp2/ecx: int <- copy 0 - clear-screen + clear-screen 0 # self->leftcol = page-margin tmp <- get self, leftcol copy-to *tmp, 5 # left-margin @@ -72,7 +72,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -167,5 +167,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/29/file-state.mu b/prototypes/browse/29/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/29/file-state.mu +++ b/prototypes/browse/29/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/29/main.mu b/prototypes/browse/29/main.mu index 067e21ff..748bdaed 100644 --- a/prototypes/browse/29/main.mu +++ b/prototypes/browse/29/main.mu @@ -113,7 +113,7 @@ $render-normal:whitespace-separated-regions: { compare c, 0x2a # '*' { break-if-!= - start-bold-on-screen + start-bold 0 render-until-asterisk fs, state normal-text break $render-normal:loop-body @@ -122,11 +122,11 @@ $render-normal:whitespace-separated-regions: { compare c, 0x5f # '_' { break-if-!= - start-color-on-screen 0xec, 7 # 236 = darkish gray - start-bold-on-screen + start-color 0, 0xec, 7 # 236 = darkish gray + start-bold 0 render-until-underscore fs, state - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray break $render-normal:loop-body } } @@ -188,32 +188,32 @@ $render-header-line:body: { # colors for a light background, going from bright to dark (meeting up with bold-text) fn start-heading header-level: int { $start-heading:body: { - start-bold-on-screen + start-bold 0 compare header-level, 1 { break-if-!= - start-color-on-screen 0xa0, 7 + start-color 0, 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color-on-screen 0x7c, 7 + start-color 0, 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color-on-screen 0x58, 7 + start-color 0, 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color-on-screen 0x34, 7 + start-color 0, 0x34, 7 break $start-heading:body } - start-color-on-screen 0xe8, 7 + start-color 0, 0xe8, 7 } } @@ -266,6 +266,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/29/screen-position-state.mu b/prototypes/browse/29/screen-position-state.mu index afaf713e..dec8b502 100644 --- a/prototypes/browse/29/screen-position-state.mu +++ b/prototypes/browse/29/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var nrows/eax: int <- copy 0xa var ncols/ecx: int <- copy 0x20 - nrows, ncols <- screen-size # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. + nrows, ncols <- screen-size 0 # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below. var dest/edx: (addr int) <- copy 0 # self->nrows = nrows dest <- get self, nrows @@ -39,7 +39,7 @@ fn start-drawing _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var tmp/eax: (addr int) <- copy 0 var tmp2/ecx: int <- copy 0 - clear-screen + clear-screen 0 # self->leftcol = page-margin tmp <- get self, leftcol copy-to *tmp, 5 # left-margin @@ -72,7 +72,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -167,5 +167,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } diff --git a/prototypes/browse/3.mu b/prototypes/browse/3.mu index b3b731de..297ce470 100644 --- a/prototypes/browse/3.mu +++ b/prototypes/browse/3.mu @@ -24,6 +24,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/4-render-page.mu b/prototypes/browse/4-render-page.mu index 57f6063b..130f17e5 100644 --- a/prototypes/browse/4-render-page.mu +++ b/prototypes/browse/4-render-page.mu @@ -21,7 +21,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= @@ -29,7 +29,7 @@ $line-loop: { compare c, 0xffffffff # EOF marker break-if-= $line-loop # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -44,11 +44,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -76,6 +76,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/5.mu b/prototypes/browse/5.mu index 118325e0..24a323a8 100644 --- a/prototypes/browse/5.mu +++ b/prototypes/browse/5.mu @@ -21,7 +21,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= @@ -31,7 +31,7 @@ $line-loop: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -46,11 +46,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -78,6 +78,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/6.mu b/prototypes/browse/6.mu index 4e1f33db..cb7e55ee 100644 --- a/prototypes/browse/6.mu +++ b/prototypes/browse/6.mu @@ -32,7 +32,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= @@ -42,7 +42,7 @@ $line-loop: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -57,11 +57,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -89,6 +89,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/7.mu b/prototypes/browse/7.mu index 4012eef5..0ea581a4 100644 --- a/prototypes/browse/7.mu +++ b/prototypes/browse/7.mu @@ -4,7 +4,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -36,7 +36,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= @@ -46,7 +46,7 @@ $line-loop: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -61,11 +61,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -94,6 +94,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/8-multiple-pages.mu b/prototypes/browse/8-multiple-pages.mu index c6453d48..e049fd37 100644 --- a/prototypes/browse/8-multiple-pages.mu +++ b/prototypes/browse/8-multiple-pages.mu @@ -4,7 +4,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -52,7 +52,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= @@ -62,7 +62,7 @@ $line-loop: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -77,11 +77,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -110,6 +110,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/9-bold.mu b/prototypes/browse/9-bold.mu index aec805c8..2d7312aa 100644 --- a/prototypes/browse/9-bold.mu +++ b/prototypes/browse/9-bold.mu @@ -4,7 +4,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int { enable-screen-grid-mode var nrows/eax: int <- copy 0 var ncols/ecx: int <- copy 0 - nrows, ncols <- screen-size + nrows, ncols <- screen-size 0 enable-keyboard-immediate-mode { render file, nrows, ncols @@ -39,7 +39,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color-on-screen 0xec, 7 # 236 = darkish gray + start-color 0, 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -59,7 +59,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= @@ -70,7 +70,7 @@ $line-loop: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte-to-screen c + print-byte 0, c col <- increment loop } # $char-loop @@ -90,7 +90,7 @@ $check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold-on-screen + start-bold 0 copy-to *state, 1 } break $check-state @@ -101,7 +101,7 @@ $check-state: { { break-if-!= # r->current-state == 1 && c == '*' => normal text - reset-formatting-on-screen + reset-formatting 0 copy-to *state, 0 } } @@ -114,11 +114,11 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, rightcol break-if->= - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -147,6 +147,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/tile/1.mu b/prototypes/tile/1.mu index 42c1f08b..4c0f8a6d 100644 --- a/prototypes/tile/1.mu +++ b/prototypes/tile/1.mu @@ -10,9 +10,9 @@ # https://archive.org/details/akkartik-2min-2020-07-01 fn main -> exit-status/ebx: int { - clear-screen - move-cursor-on-screen 5, 5 - print-string-to-screen "_________" + clear-screen 0 + move-cursor 0, 5, 5 + print-string 0, "_________" enable-keyboard-immediate-mode var dummy/eax: byte <- read-key var row/eax: int <- copy 5 @@ -26,7 +26,7 @@ fn main -> exit-status/ebx: int { } var dummy/eax: byte <- read-key enable-keyboard-type-mode - clear-screen + clear-screen 0 exit-status <- copy 0 } @@ -35,11 +35,11 @@ fn animate row: int { { compare col, 0xe break-if-= - move-cursor-on-screen row, col - print-string-to-screen " " + move-cursor 0, row, col + print-string 0, " " increment row - move-cursor-on-screen row, col - print-string-to-screen "_" + move-cursor 0, row, col + print-string 0, "_" decrement row col <- increment loop diff --git a/prototypes/tile/10.mu b/prototypes/tile/10.mu index a20e50ef..a9a4c85c 100644 --- a/prototypes/tile/10.mu +++ b/prototypes/tile/10.mu @@ -75,7 +75,7 @@ $main:loop: { render root-addr, cursor-addr loop } - clear-screen + clear-screen 0 enable-keyboard-type-mode exit-status <- copy 0 } @@ -199,7 +199,7 @@ fn create-child node: (handle cell) { ####################################################### fn render root: (addr cell), cursor: (addr cell) { - clear-screen + clear-screen 0 var depth/eax: int <- tree-depth root var viewport-width/ecx: int <- copy 0x65 # col2 viewport-width <- subtract 5 # col1 @@ -318,11 +318,11 @@ fn draw-hatching row1: int, col1: int, row2: int, col2: int { fn draw-horizontal-line row: int, col1: int, col2: int { var col/eax: int <- copy col1 - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, col2 break-if->= - print-string-to-screen "-" + print-string 0, "-" col <- increment loop } @@ -333,8 +333,8 @@ fn draw-vertical-line row1: int, row2: int, col: int { { compare row, row2 break-if->= - move-cursor-on-screen row, col - print-string-to-screen "|" + move-cursor 0, row, col + print-string 0, "|" row <- increment loop } @@ -346,8 +346,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # x = next power-of-2 multiple of _dr after _nr var x/ecx: int <- copy 1 { -#? print-int32-hex-to-screen x -#? print-string-to-screen "\n" +#? print-int32-hex 0, x +#? print-string 0, "\n" var tmp/edx: int <- copy _dr tmp <- multiply x compare tmp, _nr @@ -355,7 +355,7 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { x <- shift-left 1 loop } -#? print-string-to-screen "--\n" +#? print-string 0, "--\n" # min, max = x/2, x var max/ecx: int <- copy x var min/edx: int <- copy max @@ -363,8 +363,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # narrow down result between min and max var i/eax: int <- copy min { -#? print-int32-hex-to-screen i -#? print-string-to-screen "\n" +#? print-int32-hex 0, i +#? print-string 0, "\n" var foo/ebx: int <- copy _dr foo <- multiply i compare foo, _nr @@ -374,9 +374,9 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { } result <- copy i result <- decrement -#? print-string-to-screen "=> " -#? print-int32-hex-to-screen result -#? print-string-to-screen "\n" +#? print-string 0, "=> " +#? print-int32-hex 0, result +#? print-string 0, "\n" } fn test-try-divide-1 { diff --git a/prototypes/tile/2.mu b/prototypes/tile/2.mu index aa0cd05e..c6daa971 100644 --- a/prototypes/tile/2.mu +++ b/prototypes/tile/2.mu @@ -9,7 +9,7 @@ fn main -> exit-status/ebx: int { var num-lines/ecx: int <- copy 0x10 - clear-screen + clear-screen 0 # open a file var f: (addr buffered-file) { @@ -36,7 +36,7 @@ fn main -> exit-status/ebx: int { enable-keyboard-type-mode } # clean up - clear-screen + clear-screen 0 exit-status <- copy 0 } @@ -48,11 +48,11 @@ $render:clear-loop: { break-if-<= decrement start-row var col/eax: int <- copy 1 - move-cursor-on-screen start-row, col + move-cursor 0, start-row, col { compare col, num-cols break-if-> - print-string-to-screen " " + print-string 0, " " col <- increment loop } @@ -61,7 +61,7 @@ $render:clear-loop: { # render rest of screen below var row/edx: int <- copy start-row var col/ebx: int <- copy 1 - move-cursor-on-screen row, col + move-cursor 0, row, col $render:render-loop: { compare row, num-rows break-if->= @@ -73,10 +73,10 @@ $render:render-loop: { break-if-!= row <- increment col <- copy 0 - move-cursor-on-screen row, col + move-cursor 0, row, col loop $render:render-loop } - print-byte-to-screen c + print-byte 0, c col <- increment loop } diff --git a/prototypes/tile/3.mu b/prototypes/tile/3.mu index 3ee274de..8f234f21 100644 --- a/prototypes/tile/3.mu +++ b/prototypes/tile/3.mu @@ -7,7 +7,7 @@ fn main -> exit-status/ebx: int { var num-lines/ecx: int <- copy 0x64 # 100 - clear-screen + clear-screen 0 # open a file var f: (addr buffered-file) { @@ -36,14 +36,14 @@ fn main -> exit-status/ebx: int { var t3/esi: int <- copy t2 t3 <- subtract t1 # clean up - clear-screen + clear-screen 0 # results - print-int32-hex-to-screen t1 - print-string-to-screen "\n" - print-int32-hex-to-screen t2 - print-string-to-screen "\n" - print-int32-hex-to-screen t3 - print-string-to-screen "\n" + print-int32-hex 0, t1 + print-string 0, "\n" + print-int32-hex 0, t2 + print-string 0, "\n" + print-int32-hex 0, t3 + print-string 0, "\n" # exit-status <- copy 0 } @@ -53,7 +53,7 @@ fn render f: (addr buffered-file), num-rows: int { # render screen var row/edx: int <- copy 1 var col/ebx: int <- copy 1 - move-cursor-on-screen row, col + move-cursor 0, row, col $render:render-loop: { compare row, num-rows break-if->= @@ -65,10 +65,10 @@ $render:render-loop: { break-if-!= row <- increment col <- copy 0 - move-cursor-on-screen row, col + move-cursor 0, row, col loop $render:render-loop } - print-byte-to-screen c + print-byte 0, c col <- increment loop } diff --git a/prototypes/tile/4.mu b/prototypes/tile/4.mu index 660dbfbc..bd2bd77c 100644 --- a/prototypes/tile/4.mu +++ b/prototypes/tile/4.mu @@ -7,7 +7,7 @@ # $ ./a.elf fn main -> exit-status/ebx: int { - clear-screen + clear-screen 0 enable-keyboard-immediate-mode var dummy/eax: byte <- read-key draw-box 5, 5, 0x23, 0x23 # 35, 35 @@ -19,12 +19,12 @@ fn main -> exit-status/ebx: int { draw-box 5, 5, 0x23, 0xaf # 35, 175 var dummy/eax: byte <- read-key enable-keyboard-type-mode - clear-screen + clear-screen 0 exit-status <- copy 0 } fn draw-box row1: int, col1: int, row2: int, col2: int { - clear-screen + clear-screen 0 draw-horizontal-line row1, col1, col2 draw-vertical-line row1, row2, col1 draw-horizontal-line row2, col1, col2 @@ -33,11 +33,11 @@ fn draw-box row1: int, col1: int, row2: int, col2: int { fn draw-horizontal-line row: int, col1: int, col2: int { var col/eax: int <- copy col1 - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, col2 break-if->= - print-string-to-screen "-" + print-string 0, "-" col <- increment loop } @@ -48,8 +48,8 @@ fn draw-vertical-line row1: int, row2: int, col: int { { compare row, row2 break-if->= - move-cursor-on-screen row, col - print-string-to-screen "|" + move-cursor 0, row, col + print-string 0, "|" row <- increment loop } diff --git a/prototypes/tile/5.mu b/prototypes/tile/5.mu index c7785df6..941f132e 100644 --- a/prototypes/tile/5.mu +++ b/prototypes/tile/5.mu @@ -41,7 +41,7 @@ $main:loop: { render root-addr loop } - clear-screen + clear-screen 0 enable-keyboard-type-mode exit-status <- copy 0 } @@ -67,7 +67,7 @@ fn create-child node: (addr cell) { ####################################################### fn render root: (addr cell) { - clear-screen + clear-screen 0 var depth/eax: int <- tree-depth root var viewport-width/ecx: int <- copy 0x64 # col2 viewport-width <- subtract 5 # col1 @@ -134,11 +134,11 @@ fn draw-box row1: int, col1: int, row2: int, col2: int { fn draw-horizontal-line row: int, col1: int, col2: int { var col/eax: int <- copy col1 - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, col2 break-if->= - print-string-to-screen "-" + print-string 0, "-" col <- increment loop } @@ -149,8 +149,8 @@ fn draw-vertical-line row1: int, row2: int, col: int { { compare row, row2 break-if->= - move-cursor-on-screen row, col - print-string-to-screen "|" + move-cursor 0, row, col + print-string 0, "|" row <- increment loop } diff --git a/prototypes/tile/6.mu b/prototypes/tile/6.mu index 4cf1d4c2..ecd22ae4 100644 --- a/prototypes/tile/6.mu +++ b/prototypes/tile/6.mu @@ -68,7 +68,7 @@ $main:loop: { render root-addr loop } - clear-screen + clear-screen 0 enable-keyboard-type-mode exit-status <- copy 0 } @@ -83,7 +83,7 @@ fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) { var c2/eax: (addr cell) <- lookup *c1 var c3/edx: (addr cell) <- copy c2 { - print-string-to-screen "iter\n" + print-string 0, "iter\n" var tmp/ebx: (addr handle cell) <- get c3, first-child var tmp2/eax: (addr cell) <- lookup *tmp compare tmp2, 0 @@ -106,7 +106,7 @@ fn create-child node: (addr cell) { ####################################################### fn render root: (addr cell) { - clear-screen + clear-screen 0 var depth/eax: int <- tree-depth root var viewport-width/ecx: int <- copy 0x64 # col2 viewport-width <- subtract 5 # col1 @@ -161,11 +161,11 @@ fn draw-box row1: int, col1: int, row2: int, col2: int { fn draw-horizontal-line row: int, col1: int, col2: int { var col/eax: int <- copy col1 - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, col2 break-if->= - print-string-to-screen "-" + print-string 0, "-" col <- increment loop } @@ -176,8 +176,8 @@ fn draw-vertical-line row1: int, row2: int, col: int { { compare row, row2 break-if->= - move-cursor-on-screen row, col - print-string-to-screen "|" + move-cursor 0, row, col + print-string 0, "|" row <- increment loop } @@ -189,8 +189,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # x = next power-of-2 multiple of _dr after _nr var x/ecx: int <- copy 1 { -#? print-int32-hex-to-screen x -#? print-string-to-screen "\n" +#? print-int32-hex 0, x +#? print-string 0, "\n" var tmp/edx: int <- copy _dr tmp <- multiply x compare tmp, _nr @@ -198,7 +198,7 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { x <- shift-left 1 loop } -#? print-string-to-screen "--\n" +#? print-string 0, "--\n" # min, max = x/2, x var max/ecx: int <- copy x var min/edx: int <- copy max @@ -206,8 +206,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # narrow down result between min and max var i/eax: int <- copy min { -#? print-int32-hex-to-screen i -#? print-string-to-screen "\n" +#? print-int32-hex 0, i +#? print-string 0, "\n" var foo/ebx: int <- copy _dr foo <- multiply i compare foo, _nr @@ -217,9 +217,9 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { } result <- copy i result <- decrement -#? print-string-to-screen "=> " -#? print-int32-hex-to-screen result -#? print-string-to-screen "\n" +#? print-string 0, "=> " +#? print-int32-hex 0, result +#? print-string 0, "\n" } fn test-try-divide-1 { diff --git a/prototypes/tile/7.mu b/prototypes/tile/7.mu index 3cec67b6..42182745 100644 --- a/prototypes/tile/7.mu +++ b/prototypes/tile/7.mu @@ -72,7 +72,7 @@ $main:loop: { render root-addr loop } - clear-screen + clear-screen 0 enable-keyboard-type-mode exit-status <- copy 0 } @@ -105,7 +105,7 @@ fn create-child node: (addr cell) { ####################################################### fn render root: (addr cell) { - clear-screen + clear-screen 0 var depth/eax: int <- tree-depth root var viewport-width/ecx: int <- copy 0x64 # col2 viewport-width <- subtract 5 # col1 @@ -175,11 +175,11 @@ fn draw-box row1: int, col1: int, row2: int, col2: int { fn draw-horizontal-line row: int, col1: int, col2: int { var col/eax: int <- copy col1 - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, col2 break-if->= - print-string-to-screen "-" + print-string 0, "-" col <- increment loop } @@ -190,8 +190,8 @@ fn draw-vertical-line row1: int, row2: int, col: int { { compare row, row2 break-if->= - move-cursor-on-screen row, col - print-string-to-screen "|" + move-cursor 0, row, col + print-string 0, "|" row <- increment loop } @@ -203,8 +203,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # x = next power-of-2 multiple of _dr after _nr var x/ecx: int <- copy 1 { -#? print-int32-hex-to-screen x -#? print-string-to-screen "\n" +#? print-int32-hex 0, x +#? print-string 0, "\n" var tmp/edx: int <- copy _dr tmp <- multiply x compare tmp, _nr @@ -212,7 +212,7 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { x <- shift-left 1 loop } -#? print-string-to-screen "--\n" +#? print-string 0, "--\n" # min, max = x/2, x var max/ecx: int <- copy x var min/edx: int <- copy max @@ -220,8 +220,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # narrow down result between min and max var i/eax: int <- copy min { -#? print-int32-hex-to-screen i -#? print-string-to-screen "\n" +#? print-int32-hex 0, i +#? print-string 0, "\n" var foo/ebx: int <- copy _dr foo <- multiply i compare foo, _nr @@ -231,9 +231,9 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { } result <- copy i result <- decrement -#? print-string-to-screen "=> " -#? print-int32-hex-to-screen result -#? print-string-to-screen "\n" +#? print-string 0, "=> " +#? print-int32-hex 0, result +#? print-string 0, "\n" } fn test-try-divide-1 { diff --git a/prototypes/tile/8.mu b/prototypes/tile/8.mu index 9b7df0f8..d86f3f8e 100644 --- a/prototypes/tile/8.mu +++ b/prototypes/tile/8.mu @@ -72,7 +72,7 @@ $main:loop: { render root-addr loop } - clear-screen + clear-screen 0 enable-keyboard-type-mode exit-status <- copy 0 } @@ -105,7 +105,7 @@ fn create-child node: (addr cell) { ####################################################### fn render root: (addr cell) { - clear-screen + clear-screen 0 var depth/eax: int <- tree-depth root var viewport-width/ecx: int <- copy 0x64 # col2 viewport-width <- subtract 5 # col1 @@ -205,11 +205,11 @@ fn draw-box row1: int, col1: int, row2: int, col2: int { fn draw-horizontal-line row: int, col1: int, col2: int { var col/eax: int <- copy col1 - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, col2 break-if->= - print-string-to-screen "-" + print-string 0, "-" col <- increment loop } @@ -220,8 +220,8 @@ fn draw-vertical-line row1: int, row2: int, col: int { { compare row, row2 break-if->= - move-cursor-on-screen row, col - print-string-to-screen "|" + move-cursor 0, row, col + print-string 0, "|" row <- increment loop } @@ -233,8 +233,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # x = next power-of-2 multiple of _dr after _nr var x/ecx: int <- copy 1 { -#? print-int32-hex-to-screen x -#? print-string-to-screen "\n" +#? print-int32-hex 0, x +#? print-string 0, "\n" var tmp/edx: int <- copy _dr tmp <- multiply x compare tmp, _nr @@ -242,7 +242,7 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { x <- shift-left 1 loop } -#? print-string-to-screen "--\n" +#? print-string 0, "--\n" # min, max = x/2, x var max/ecx: int <- copy x var min/edx: int <- copy max @@ -250,8 +250,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # narrow down result between min and max var i/eax: int <- copy min { -#? print-int32-hex-to-screen i -#? print-string-to-screen "\n" +#? print-int32-hex 0, i +#? print-string 0, "\n" var foo/ebx: int <- copy _dr foo <- multiply i compare foo, _nr @@ -261,9 +261,9 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { } result <- copy i result <- decrement -#? print-string-to-screen "=> " -#? print-int32-hex-to-screen result -#? print-string-to-screen "\n" +#? print-string 0, "=> " +#? print-int32-hex 0, result +#? print-string 0, "\n" } fn test-try-divide-1 { diff --git a/prototypes/tile/9.mu b/prototypes/tile/9.mu index 91637afb..298db795 100644 --- a/prototypes/tile/9.mu +++ b/prototypes/tile/9.mu @@ -71,7 +71,7 @@ $main:loop: { render root-addr, cursor-addr loop } - clear-screen + clear-screen 0 enable-keyboard-type-mode exit-status <- copy 0 } @@ -183,7 +183,7 @@ fn create-child node: (addr cell) { ####################################################### fn render root: (addr cell), cursor: (addr cell) { - clear-screen + clear-screen 0 var depth/eax: int <- tree-depth root var viewport-width/ecx: int <- copy 0x64 # col2 viewport-width <- subtract 5 # col1 @@ -283,11 +283,11 @@ fn draw-box row1: int, col1: int, row2: int, col2: int { fn draw-horizontal-line row: int, col1: int, col2: int { var col/eax: int <- copy col1 - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, col2 break-if->= - print-string-to-screen "-" + print-string 0, "-" col <- increment loop } @@ -298,8 +298,8 @@ fn draw-vertical-line row1: int, row2: int, col: int { { compare row, row2 break-if->= - move-cursor-on-screen row, col - print-string-to-screen "|" + move-cursor 0, row, col + print-string 0, "|" row <- increment loop } @@ -311,8 +311,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # x = next power-of-2 multiple of _dr after _nr var x/ecx: int <- copy 1 { -#? print-int32-hex-to-screen x -#? print-string-to-screen "\n" +#? print-int32-hex 0, x +#? print-string 0, "\n" var tmp/edx: int <- copy _dr tmp <- multiply x compare tmp, _nr @@ -320,7 +320,7 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { x <- shift-left 1 loop } -#? print-string-to-screen "--\n" +#? print-string 0, "--\n" # min, max = x/2, x var max/ecx: int <- copy x var min/edx: int <- copy max @@ -328,8 +328,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # narrow down result between min and max var i/eax: int <- copy min { -#? print-int32-hex-to-screen i -#? print-string-to-screen "\n" +#? print-int32-hex 0, i +#? print-string 0, "\n" var foo/ebx: int <- copy _dr foo <- multiply i compare foo, _nr @@ -339,9 +339,9 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { } result <- copy i result <- decrement -#? print-string-to-screen "=> " -#? print-int32-hex-to-screen result -#? print-string-to-screen "\n" +#? print-string 0, "=> " +#? print-int32-hex 0, result +#? print-string 0, "\n" } fn test-try-divide-1 { |