only depend on MON implementation for system calls
This commit is contained in:
parent
8a9e71256f
commit
c9627bf4e6
3 changed files with 29 additions and 8 deletions
|
@ -18,7 +18,6 @@ gto.s
|
||||||
inn.s
|
inn.s
|
||||||
lar.s
|
lar.s
|
||||||
los2.s
|
los2.s
|
||||||
mon.s
|
|
||||||
noop.s
|
noop.s
|
||||||
prf.s
|
prf.s
|
||||||
rck.s
|
rck.s
|
||||||
|
|
|
@ -58,10 +58,15 @@ ready: !now really print the string we built in the buffer
|
||||||
ldb 0(R3), RL0 !end string with '\0'
|
ldb 0(R3), RL0 !end string with '\0'
|
||||||
sub R3, $buff-1 !R3 contains the number of characters
|
sub R3, $buff-1 !R3 contains the number of characters
|
||||||
ld R1, $buff
|
ld R1, $buff
|
||||||
7: ldb RL0, 0(R1)
|
|
||||||
inc R1
|
push *RR14, R3 !count
|
||||||
sc $4
|
push *RR14, R1 !buffer
|
||||||
djnz R3, 7b
|
push *RR14, $2 !file descriptor
|
||||||
|
push *RR14, $4 ! write
|
||||||
|
calr mon
|
||||||
|
pop R1, *RR14
|
||||||
|
pop R1, *RR14 ! ignore result
|
||||||
|
|
||||||
ldm R4, savereg, $10
|
ldm R4, savereg, $10
|
||||||
pushl *RR14, saveret
|
pushl *RR14, saveret
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -6,8 +6,20 @@
|
||||||
.sect .text
|
.sect .text
|
||||||
|
|
||||||
fatal:
|
fatal:
|
||||||
|
push *RR14, R1
|
||||||
|
inc R15, $2
|
||||||
|
popl saveret, *RR14
|
||||||
|
pop R1, *RR14 !trap number in R1
|
||||||
|
push *RR14, R1
|
||||||
|
push *RR14, R1
|
||||||
|
dec R15, $4
|
||||||
|
pop R1, *RR14 !restore R1
|
||||||
|
inc R15, $2
|
||||||
|
pushl *RR14, saveret
|
||||||
calr trp
|
calr trp
|
||||||
sc $EXIT
|
push *RR14, $1
|
||||||
|
calr mon
|
||||||
|
!NOTREACHED
|
||||||
|
|
||||||
trp:
|
trp:
|
||||||
push *RR14, R1
|
push *RR14, R1
|
||||||
|
@ -36,8 +48,13 @@ trp:
|
||||||
2: pop R1, *RR14
|
2: pop R1, *RR14
|
||||||
pop R0, *RR14
|
pop R0, *RR14
|
||||||
ret
|
ret
|
||||||
3: push *RR14, $err
|
3: pop R1, *RR14
|
||||||
|
push *RR14, R1
|
||||||
|
push *RR14, R1
|
||||||
|
push *RR14, $err
|
||||||
calr printf
|
calr printf
|
||||||
sc $EXIT
|
push *RR14, $1
|
||||||
|
calr mon
|
||||||
|
!NOTREACHED
|
||||||
.sect .data
|
.sect .data
|
||||||
err: .asciz "trap error %d\n"
|
err: .asciz "trap error %d\n"
|
||||||
|
|
Loading…
Reference in a new issue