1985-01-08 11:48:43 +00:00
|
|
|
.define EXIT, F_DUM
|
|
|
|
.define ERANGE, ESET, EHEAP, EILLINS, EODDZ, ECASE, EBADMON
|
|
|
|
.define hol0, trppc, trpim, reghp, argv, envp
|
1987-01-19 10:51:50 +00:00
|
|
|
.sect .text
|
|
|
|
.sect .rom
|
|
|
|
.sect .data
|
|
|
|
.sect .bss
|
|
|
|
.sect .text
|
1985-01-08 11:48:43 +00:00
|
|
|
|
|
|
|
EXIT = 0
|
|
|
|
F_DUM = 0
|
|
|
|
|
|
|
|
ERANGE = 1
|
|
|
|
ESET = 2
|
|
|
|
EHEAP = 17
|
|
|
|
EILLINS = 18
|
|
|
|
EODDZ = 19
|
|
|
|
ECASE = 20
|
|
|
|
EBADMON = 25
|
|
|
|
|
1987-01-19 10:51:50 +00:00
|
|
|
.sect .text
|
|
|
|
!clear .sect .bss
|
1985-01-08 11:48:43 +00:00
|
|
|
ldk R2, $0
|
|
|
|
ld R3, $endbss
|
|
|
|
ld R0, R3
|
|
|
|
sub R0, $begbss
|
|
|
|
jr EQ, 1f
|
|
|
|
sra R0
|
|
|
|
push *RR2, $0
|
|
|
|
dec R0
|
|
|
|
jr EQ, 1f
|
|
|
|
ldl RR4, RR2
|
|
|
|
dec R5, $2
|
|
|
|
lddr *RR4, *RR2, R0
|
|
|
|
1:
|
|
|
|
ldb RL0, $10 ! echo newline
|
|
|
|
sc $4
|
|
|
|
ldl RR14, $0
|
|
|
|
push *RR14, envp
|
|
|
|
push *RR14, argv
|
|
|
|
push *RR14, $1
|
1991-03-06 14:26:16 +00:00
|
|
|
calr __m_a_i_n
|
1985-01-08 11:48:43 +00:00
|
|
|
ldl RR14, $0xC00017FC
|
|
|
|
sc $0
|
|
|
|
|
1987-01-19 10:51:50 +00:00
|
|
|
.sect .bss
|
1985-01-08 11:48:43 +00:00
|
|
|
begbss:
|
1987-01-19 10:51:50 +00:00
|
|
|
.sect .data
|
1985-01-08 11:48:43 +00:00
|
|
|
hol0:
|
1987-01-19 10:51:50 +00:00
|
|
|
.data2 0,0 ! line no
|
|
|
|
.data2 0,0 ! file
|
1985-01-08 11:48:43 +00:00
|
|
|
trppc:
|
1987-01-19 10:51:50 +00:00
|
|
|
.data2 0
|
1985-01-08 11:48:43 +00:00
|
|
|
trpim:
|
1987-01-19 10:51:50 +00:00
|
|
|
.data2 0
|
1985-01-08 11:48:43 +00:00
|
|
|
argv:
|
|
|
|
envp:
|
1987-01-19 10:51:50 +00:00
|
|
|
.data2 1f
|
|
|
|
.data2 0
|
1985-01-08 11:48:43 +00:00
|
|
|
1: .asciz "program"
|
|
|
|
reghp:
|
1987-01-19 10:51:50 +00:00
|
|
|
.data2 endbss
|