aboutsummaryrefslogtreecommitdiffstats
path: root/asm/test_py_src.py
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2023-11-12 16:15:40 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2023-11-12 16:15:40 +0200
commite2b7385b03a6dc9c8c39dde5c049cd74b0768bd1 (patch)
tree817c9dc2c23f72bd5b0e36ada52ad86bb5e39909 /asm/test_py_src.py
parent6f68c0febdbfd6138fa95f77bc09785bde8a8371 (diff)
Remove options, improve functions
Diffstat (limited to 'asm/test_py_src.py')
-rw-r--r--asm/test_py_src.py41
1 files changed, 13 insertions, 28 deletions
diff --git a/asm/test_py_src.py b/asm/test_py_src.py
index ca816de..74ea60d 100644
--- a/asm/test_py_src.py
+++ b/asm/test_py_src.py
@@ -1,43 +1,28 @@
import atk16
+
TEXT_MODE: atk16.ConstInt = 1
GRAPHICS_MODE_ADDR_P: atk16.ConstInt = 0x17
-graphics_mode_addr = atk16.load(GRAPHICS_MODE_ADDR_P)
-
TEXT_MEM_ADDR_P: atk16.ConstInt = 0x19
+
+graphics_mode_addr = atk16.load(GRAPHICS_MODE_ADDR_P)
text_mem_addr = atk16.load(TEXT_MEM_ADDR_P)
atk16.store(graphics_mode_addr, TEXT_MODE)
-def func(arg1: int, arg2: int) -> int:
- a = arg1
- return a + a
-b = func(1, 3)
+def nth_letter(n: int) -> int:
+ return n + 65
i = 0
-atk16.store(text_mem_addr + i, atk16.ord("h"))
-i = i + 1
-atk16.store(text_mem_addr + i, atk16.ord("i"))
+atk16.asm("ldi 0b111111111 RG")
+while i < 26:
+ # bug: stack frame offset for nth_letter is calculated
+ # one off because text_mem_addr + i takes up one
+ # stack slot
+ atk16.store(text_mem_addr + i, nth_letter(i))
+ #atk16.store(text_mem_addr + i, i + 65)
+ i = i + 1
while True:
pass
-
-# atk16.asm("@label keepalive")
-# atk16.asm(" jpi keepalive")
-
-# TEXT_MODE: atk16.ConstInt = 1
-# GRAPHICS_MODE_ADDR: atk16.ConstInt = 0x17
-
-# atk16.store(GRAPHICS_MODE_ADDR, TEXT_MODE)
-# atk16.store(0xF800, 'H')
-# atk16.store(0xF801, 'E')
-# atk16.store(0xF802, 'L')
-# atk16.store(0xF803, 'L')
-# atk16.store(0xF804, 'O')
-
-# a = atk16.call_inline(
-# atk16.load(0xF000)
-# )
-
-# atk16.asm("ldi 1 RA")