summary refs log tree commit diff
path: root/pc-thing/code/printer.a
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-04-02 12:23:56 +0300
committerWlodekM <[email protected]>2025-04-02 12:23:56 +0300
commit1027b91f357eaaa4793b9d16673b0ab662b37c7e (patch)
tree8625f0aebc48ab32d6d4c3bd5ae92cfbf82c8c08 /pc-thing/code/printer.a
parent0f6d349f9b8d22b3f8d972c5ff19ffb276629bdb (diff)
remove pc thing
Diffstat (limited to 'pc-thing/code/printer.a')
-rw-r--r--pc-thing/code/printer.a111
1 files changed, 0 insertions, 111 deletions
diff --git a/pc-thing/code/printer.a b/pc-thing/code/printer.a
deleted file mode 100644
index 87b66ba..0000000
--- a/pc-thing/code/printer.a
+++ /dev/null
@@ -1,111 +0,0 @@
-; print the number at 0xF
-print_num:
-    ; non-address definitions
-    .label zero 48
-    .label out_start 32
-    ; define stuff in memory
-    .label number 16
-    .label mult 17
-    mov a 1
-    str a mult
-    .label currnum 18
-    .label tmp1 19
-    .label out_pointer 20
-    mov a out_start
-    str a out_pointer
-    .label swap_counter 21
-
-    loop_start:
-        ; get num-(num%mult)
-            ld a number
-            ld b mult
-            mod
-            swp c b
-            sub
-            str c tmp1
-
-        ; get num-(num%(mult*10))
-            mov a 10
-            ld b mult
-            mul
-            swp c b
-            ld a number
-            mod
-            swp c b
-            sub
-        
-        ; subtract the thingies to get the current digit
-        swp c b
-        ld a tmp1
-        sub
-        swp c a
-        ld b mult
-        div
-        str c currnum
-
-        ; add zero to currnum and store at out_pointer
-        swp a c ; currnum -> A
-        mov b zero
-        add
-        ld a out_pointer
-        srr c a ; store c to address at a (which is out_pointer)
-
-        ; continue loop
-            ; increment out_pointer
-            ld a out_pointer
-            mov b 1
-            add
-            str c out_pointer
-            ; increment mult
-            ld a mult
-            mov b 10
-            mul
-            str c mult
-        
-            swp c b ; mult -> b
-            ld a number ; get number
-            mod ; get mod, will be equal to number if reached end
-            cmr c a ; compare result of mod and number (which is still in a)
-            jz loop_start ; jump if not equal
-    ; escaped from loop; swapping around memory to flip the text
-    ld a out_pointer
-    mov b out_start
-    sub
-    swp c a
-    mov b 2
-    div
-    str c swap_counter
-    cmp c 0
-    jnz end_swap
-    start_swap:
-        ; ptr - counter
-            ld b swap_counter
-            ld a out_pointer
-            sub
-            str c tmp1
-        ; start + counter
-            ld a swap_counter ; 1
-            mov b 1
-            sub ; 1
-            swp c b ; 1 -> b
-            mov a out_start ; 32
-            add ; 32 + 1 = 33
-        swp c b
-        ld a tmp1
-        swpm a b
-        ld a swap_counter
-        mov b 1
-        sub
-        str c swap_counter
-        cmp c 0
-        jz start_swap
-    end_swap:
-    ; add \n\0
-    ld b out_pointer
-    mov a 10 ; \n
-    srr a b
-    mov a 1
-    add
-    mov a 0 ; \0
-    srr a c
-    ret