| | DOMINO:conofaces.s DATE: 5-86 | O'Leary, Stewart, Van de Geijn University of Maryland | | Programmed by O'Leary | | This is conoface | (awaken, pause, and finis) | for the Sun-2 using the cc compiler | and the as assembler under Unix. | | "awaken (nodep)" activates "nodeprog (nodep, initialp)", which | returns control either by a "return" (to set status=0), a | "pause()" (to set status=1), or a "finis()" (to set status=2). | | | Register usage: | | a4 20(a5) or a5@(20) = address of node.program | a5 8(a6) or a6@(8) = address of node | a6 fp = frame pointer | a7 sp = stack pointer | d6 4(a5) or a5@(4) = node.status | 28(a5) or a5@(28) = address of top of stack for node | 32(a5) or a5@(32) = address of bottom of stack for node | .globl _awaken _awaken: link a6,#0 moveml #077777,sp@- | Get node information. movl a6@(8),a5 | get node pointer movl a5@(20),a4 | get call address movl a5@(4),d6 | get status | Save system environment. movl a6,sp@- | save system fp movl a5,sp@- | save address of node movl sp,syssp | save sp in syssp | tstl d6 | check status beq norestore | go to norestore if status=0 | | status=1: restore node | environment and return | to node program | movl a5@(28),sp | restore node stack pointer movl sp@+,a6 | restore a6 fp register moveml sp@+,#077777 unlk a6 rts | return to node program | | status=0: call node prog norestore: movl #1,a5@(4) | node.status = 1 movl a5@(32),sp | get node stack pointer movl #_initial,sp@- | put address of initial on stack as argument movl a5,sp@- | put nodep on stack as argument jbsr a4@ | call subroutine | | node program "return": | set status=0, restore | system environment, and | return to system. norm: movl syssp,sp | restore system sp movl sp@+,a5 | restore address of node movl sp@+,a6 | restore a6 fp register movl #0,a5@(4) | node.status=0 moveml sp@+,#077777 unlk a6 rts | return to control | | pause: save node envirn., | restore system environment, | return to system. .globl _pause _pause: link a6,#0 moveml #077777,sp@- movl a6,sp@- | save node's fp movl sp,a6 | copy node stack pointer to a6 movl syssp,sp | restore system stack pointer movl sp@+,a5 | restore address of node movl a6,a5@(28) | save node stack pointer movl sp@+,a6 | restore system a6 fp moveml sp@+,#077777 unlk a6 rts | return to control | | finis: set status=2, restore | system environment, return | to system. .globl _finis _finis: link a6,#0 moveml #077777,sp@- movl syssp,sp | restore system stack pointer movl sp@+,a5 | restore address of node movl sp@+,a6 | restore system a6 fp movl #2,a5@(4) | node.status = 2 moveml sp@+,#077777 unlk a6 rts | return to control | .comm syssp,4