diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2023-11-04 10:40:11 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2023-11-04 10:40:11 +0200 |
| commit | 97bf5a802262bb47675fb6f4cd9d1e1522eaef5d (patch) | |
| tree | c50a38c39190f43233ceb4e8b2c05e9eddea77ae | |
| parent | 49327432b456c3110064556ac4613b49be54b925 (diff) | |
Add new_line macro
| -rw-r--r-- | asm/ext_string_io.py | 12 | ||||
| -rw-r--r-- | asm/text_mode.atk16 | 8 | ||||
| -rw-r--r-- | digital/atk16_mem.dig | 16 |
3 files changed, 22 insertions, 14 deletions
diff --git a/asm/ext_string_io.py b/asm/ext_string_io.py index dd17123..519077d 100644 --- a/asm/ext_string_io.py +++ b/asm/ext_string_io.py @@ -1,5 +1,5 @@ from asm_ops import * -from ext_std import expand_addi +from ext_std import * def to_char_code(c: str): return ord(c) @@ -41,8 +41,16 @@ def expand_cursor_to_line(cursor_reg: str, line: int) -> ExpandResult: ["ldr", cursor_reg, cursor_reg], ] +def expand_new_line(cursor_reg: str) -> ExpandResult: + return [ + *expand_slri(cursor_reg, "6", cursor_reg), + *expand_addi(cursor_reg, "1", cursor_reg), + *expand_slli(cursor_reg, "6", cursor_reg), + ] + expansions: OpExpansionDict = { "put_char": expand_put_char, "cursor_to_line": expand_cursor_to_line, "put_string": expand_put_string, -}
\ No newline at end of file + "new_line": expand_new_line, +} diff --git a/asm/text_mode.atk16 b/asm/text_mode.atk16 index 7ec9fef..335f71c 100644 --- a/asm/text_mode.atk16 +++ b/asm/text_mode.atk16 @@ -10,9 +10,10 @@ @label main cursor_to_line RC 1 put_string RC RB " HELLO CORECAMP" - cursor_to_line RC 2 + new_line RC put_string RC RB " BY JAN" - cursor_to_line RC 4 + new_line RC + new_line RC put_string RC RB " > " set_graphics_mode gr_text_mode @@ -29,7 +30,6 @@ ldr RB RB ; RB := Terminal peripheral address deref str RA RC - mov RA RD addi RC 1 RC subi RA 5 RA @@ -39,7 +39,7 @@ @label keyboard_isr_clear ; cursor_to_line RC 4 ; put_string RC RB " " - cursor_to_line RC 4 + new_line RC put_string RC RB " > " @label keyboard_isr_end stack_restore RA RB diff --git a/digital/atk16_mem.dig b/digital/atk16_mem.dig index 34d3292..555abb6 100644 --- a/digital/atk16_mem.dig +++ b/digital/atk16_mem.dig @@ -35,18 +35,18 @@ </entry> <entry> <string>Data</string> - <data>4014,2a00,6019,13*8000,7d,1a,1a,1a,8000,e000,e001,e002,e800,f800 + <data>4014,2a00,6019,13*8000,7e,1a,1a,1a,8000,e000,e001,e002,e800,f800 ,4855,f000,4017,2000,4200,3008,6000,6001,f840,4422,2480,4220,3088 ,1488,4248,3088,1488,4245,3088,1488,424c,3088,1488,424c,3088,1488 ,424f,3088,1488,4220,3088,1488,4243,3088,1488,424f,3088,1488,4252 ,3088,1488,4245,3088,1488,4243,3088,1488,4241,3088,1488,424d,3088 -,1488,4250,3088,1488,6001,f880,4453,2480,4220,3088,1488,4242,3088 -,1488,4259,3088,1488,4220,3088,1488,424a,3088,1488,4241,3088,1488 -,424e,3088,1488,6001,f900,446c,2480,4220,3088,1488,423e,3088,1488 -,4220,3088,1488,4017,2000,4201,3008,61ff,3140,1b48,3148,1b48,4016 -,2000,2000,4215,2240,3080,1600,1488,1029,1029,8401,600d,6001,f900 -,448e,2480,4220,3088,1488,423e,3088,1488,4220,3088,1488,3148,1b48 -,3140,1b48,e000</data> +,1488,4250,3088,1488,14b5,1488,14b7,4220,3088,1488,4242,3088,1488 +,4259,3088,1488,4220,3088,1488,424a,3088,1488,4241,3088,1488,424e +,3088,1488,14b5,1488,14b7,14b5,1488,14b7,4220,3088,1488,423e,3088 +,1488,4220,3088,1488,4017,2000,4201,3008,61ff,3140,1b48,3148,1b48 +,4016,2000,2000,4215,2240,3080,1488,1029,1029,8401,600c,14b5,1488 +,14b7,4220,3088,1488,423e,3088,1488,4220,3088,1488,3148,1b48,3140 +,1b48,e000</data> </entry> </elementAttributes> <pos x="740" y="100"/> |
