From 49327432b456c3110064556ac4613b49be54b925 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 3 Nov 2023 23:24:50 +0200 Subject: Fix character code mapping --- asm/ext_string_io.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'asm/ext_string_io.py') diff --git a/asm/ext_string_io.py b/asm/ext_string_io.py index 7b026ba..dd17123 100644 --- a/asm/ext_string_io.py +++ b/asm/ext_string_io.py @@ -2,8 +2,7 @@ from asm_ops import * from ext_std import expand_addi def to_char_code(c: str): - if c == " " or c == "%SPACE": return 0 - else: return ord(c) - 64 + return ord(c) _counter = 0 def get_unique_name(prefix: str): @@ -17,7 +16,7 @@ def expand_put_char(cursor_reg: str, scratch_reg: str, c: str) -> ExpandResult: return [ ["ldi", str(to_char_code(c)), scratch_reg], ["str", scratch_reg, cursor_reg], - *expand_addi("RA", "1", "RA"), + *expand_addi(cursor_reg, "1", cursor_reg), ] def expand_put_string(cursor_reg: str, scratch_reg: str, *rest: str) -> ExpandResult: -- cgit v1.3