00000            ECHO        START   0    
00000  010E3B                LDA     #3643    
00003  0F20F5                STA     number    
00006  4B2028                JSUB    char    
00009  4B202B                JSUB    nl    
0000C  4B2022                JSUB    char    
0000F  4B2025                JSUB    nl    
00012  011000E6             +LDA     #test_niz    
00016  4B2031                JSUB    string    
00019  4B201B                JSUB    nl    
0001C  0320DC                LDA     number    
0001F  4B204B                JSUB    num    
00022  4B2012                JSUB    nl    
00025  010017                LDA     #23    
00028  4B2042                JSUB    num    
0002B  4B2009                JSUB    nl    
0002E  3F2FFD    HALT        J       HALT    
00031                        END     ECHO    
                  
                  . izpis znaka
00031  DD0001    char        WD      #1    
00034  4F0000                RSUB        
                  
                  . izpis newline
00037  0F1000E2  nl         +STA     old_A    
0003B  B400                  CLEAR   A    
                  
0003D  5320A5                LDCH    newline    
00040  DD0001                WD      #1    
                  
00043  031000E2             +LDA     old_A    
00047  4F0000                RSUB        
                  
                  . izpis niza
0004A  0F1000F2  string     +STA     strptr    
0004E  B400      loop_niz    CLEAR   A    
00050  52209F                LDCH    @strptr    
00053  DD0001                WD      #1    
00056  290000                COMP    #0    
00059  33200E                JEQ     out    
0005C  031000F2             +LDA     strptr    
00060  190001                ADD     #1    
00063  0F1000F2             +STA     strptr    
00067  3F2FE4                J       loop_niz    
0006A  4F0000    out         RSUB        
                  
                  . desetiski izpis stevila v A iz HEX
                  . stevke pridobimo z mod 10, shranimo v tabelo, nato tabelo izpisemo v obratnem vrstnem redu
0006D  0720F2    num         LDX     digits_ix    
00070  0F2088                STA     number    
00073  25000A                DIV     #10    
00076  0F207C                STA     quot    
00079  21000A                MUL     #10    
0007C  0F2079                STA     subtrahend    
0007F  032079                LDA     number    
00082  1F2073                SUB     subtrahend    
00085  57A076                STCH    digits,X    
00088  0320D7                LDA     digits_ix    
0008B  190001                ADD     #1    
0008E  0F20D1                STA     digits_ix    
00091  032067                LDA     number    
00094  25000A                DIV     #10    
00097  290000                COMP    #0    
0009A  372FD0                JGT     num    
                  . shrani stevec za X register in pa mejo len za naslednjo zanko loop_num
0009D  0320C2                LDA     digits_ix    
000A0  0F20C5                STA     len    
000A3  1D0001                SUB     #1    
000A6  0F20B9                STA     digits_ix    
                  . izpis tabele v obratnem vrstnem redu
000A9  0720B6    loop_num    LDX     digits_ix    
000AC  53A04F                LDCH    digits,X    
000AF  190030                ADD     #48    . stevke v ascii se zacnejo pri 48
000B2  DD0001                WD      #1    
000B5  0320AA                LDA     digits_ix    
000B8  1D0001                SUB     #1    
000BB  0F20A4                STA     digits_ix    
000BE  0320A4                LDA     i    
000C1  190001                ADD     #1    
000C4  0F209E                STA     i    
000C7  2B209E                COMP    len    
000CA  3B2FDC                JLT     loop_num    
                  
000CD  050000                LDX     #0    
000D0  010000                LDA     #0    
000D3  0F208C                STA     digits_ix    
000D6  0F208C                STA     i    
000D9  0F208C                STA     len    
000DC  03201C                LDA     number    
000DF  4F0000                RSUB        
                  
000E2  000000    old_A       WORD    0    
000E5  0A        newline     BYTE    10    
000E6  68....64  test_niz    BYTE    C'hello world'    
000F1  00                    BYTE    0    
000F2  000000    strptr      WORD    0    
000F5  000000    quot        WORD    0    
000F8  000000    subtrahend  WORD    0    
000FB  000000    number      WORD    0    
000FE  00....00  digits      RESB    100    
00162  000000    digits_ix   WORD    0    
00165  000000    i           WORD    0    
00168  000000    len         WORD    0    
