spo/ass1/vhod_izhod/echo.asm
2025-10-30 15:47:34 +01:00

51 lines
890 B
NASM

echo START 0
t LDA test
JSUB char
JSUB nl
JSUB string
halt J halt
char STA temp1
STX temp2
WD #1
LDA temp1
LDX temp2
RSUB
nl STA temp1
STX temp2
LDX #1
LDCH n_l
WD #1
LDCH n_l, X
CLEAR X
LDA temp1
LDX temp2
RSUB
string . V A je naslov iz katerega izpisemo nek string
STA temp1
STX temp2
LDX #0
STA strptr
LDB #1
loop CLEAR A
LDCH strptr, X
JSUB char
ADDR B, X
COMP #0
JGT loop
LDA temp1
LDX temp2
RSUB
n_l BYTE 10
test BYTE C'test0'
strptr WORD 0
temp1 RESW 1
temp2 RESW 1