updates to dsa libs

This commit is contained in:
2025-06-26 00:51:20 +01:00
parent 620584488b
commit e9f04824ea
4 changed files with 152 additions and 26 deletions
+36
View File
@@ -29,6 +29,8 @@
// jmp print::print_word
//
include maths "../maths/core.dsa"
dw display: 0x20000
dw current: 0x20000
@@ -155,6 +157,40 @@ _print_hex_nibble_number:
addi rg1, 1
return
// ------------------------------------------
// print whitespace
print_whitespace:
push bpr
mov spr, bpr
ldw current, rg1
lli 0x20, rg0
stb rg0, rg1
addi rg1, 1
jmp _end
// ------------------------------------------
// print newline
print_newline:
push bpr
mov spr, bpr
ldw display, rg0
ldw current, rg1
sub rg1, rg0, rg0
lwi 80, rg2
push rg0
push rg2
call maths::divmod
pop rg2
addi rg2, 80
ldw display, rg1
add rg1, rg2, rg1
// _end saves the display state
jmp _end
// ------------------------------------------
// resets the cursor position on the screen to 0x20000. (0,0)
reset: