tdone.s
869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
##########################################################################
#
# TASKDONE CODE
#
##########################################################################
.name dramp, $19
.name dmemp, $20
.name dmasz, $18
.name iswrite, $17
TaskDone: # all done, return to executive:
#
# If we sent output to the DRAM, update the counter
# in DRAM
#
lw dramp, RSP_STATE_DRAM_OUTP(rsp_state)
beq dramp, zero, TaskHalt
addi dmemp, rsp_state, RSP_STATE_DRAM_OUT_LEN
lw dramp, RSP_STATE_DRAM_OUT_LENP(rsp_state)
addi iswrite, zero, 1
jal DMAproc
addi dmasz, zero, 7 # delay slot
.unname dramp
.unname dmemp
.unname dmasz
.unname iswrite
.name yield, $2
TaskHalt:
jal DMAwait
ori yield, zero, SP_SET_TASKDONE # delay slot
mtc0 yield, SP_STATUS # DONE, not a BP
break # tell cpu we are done
nop # and HALT
.unname yield