home *** CD-ROM | disk | FTP | other *** search
- e
- _*********************************************************
- _* *
- _* module name : PROGSTOP.ASM *
- _* *
- _* Maintenance log *
- _* --------------- *
- _* *
- _* date time action *
- _* ---- ---- ------ *
- _* 14/02/89 23:30 initial coding *
- _* 28/03/89 22:15 tidy up *
- _* 03/04/89 23:00 changed brackets *
- _* 19/05/89 17:50 major recode for both routines *
- _* 20/05/89 19:20 fix suspend bug, allow quiesce *
- _* and suspend of suspended program *
- _* 21/05/89 18:00 added free storage error check *
- _* 21/05/89 18:50 fixed the quiesce storage error *
- _* 22/05/89 18:50 update for new storage methods *
- _* 18/06/89 19:10 Save stack don't remove info *
- _* 05/07/89 22:10 Page 0 and 1 can be in both ram blk *
- _*********************************************************
-
-
- _*********************************************************
- _* *
- _* routine : Suspend - suspends a program *
- _* Quiesce - terminates a program *
- _* *
- _* entry *
- _* ----- *
- _* CHARBUFF - characters of the command *
- _* Y - current position after command found in *
- _* CHARBUFF *
- _*.......................................................*
- _* used *
- _* ---- *
- _* A,X,Y *
- _* PRGNAME *
- _* NAMELEN *
- _*.......................................................*
- _* exit *
- _* ---- *
- _* none *
- _*********************************************************
-
- _ These 2 commands suspend or remove a program in the table. on entry, Y
- _ points to the command, so the following info should be blank then name CR.
- _
-
- suspend equ *
- ¥ #prgnorun _ set suspend flag in table
- db $2c _ skip next instruction
- quiesce equ *
- ¥ #noprog _ set remove flag for table
- » option
-
-
- _ Now we need to read the name of the program from the program buffer
- _ and then locate it in the table
- _ if found then change the flag and display a message.
-
- £ readname _ common routine to get name from buffer
- £ locname _ find name in the table
- ä fndname
-
- ¥ #2
- ¢ dispmess _ display error message 2
-
- _
- _ Name found, so we will either suspend or quiesce a program.
- _
-
- fndname equ *
-
- ƒ #flag
- ¥ [tabpntr],y
- æ #prgrun
- ê notrun
-
- _
- _ Program is active, so we will decrement the number of programs
- _ running. If Suspending an already suspended program nothing happens
- _ but it is possible to quiesce a suspended program.
- _
-
- ö progrun
-
- notrun equ *
- ¥ option _ reset the flag in table
- » [tabpntr],y
-
- ¥ option _ suspend or quiesce ?
- æ #prgnorun
- à allfree
-
- _ we are quiescing a program, just free memory. The stack doesn't have
- _ to be touched.
-
- _
- _ Free the program area.
- _
-
- ƒ #ramprg
- ¥ [tabpntr],y
- » ramused
- ƒ #strtadd
- ¥ [tabpntr],y
- » startram
- Ü
- ¥ [tabpntr],y
- » startram+1
- ƒ #endadd
- ¥ [tabpntr],y
- » endram
- Ü
- ¥ [tabpntr],y
- » endram+1
- £ frestor _ free program area
- â freezero
- errorfre equ *
- ¥ #13
- ¢ dispmess
-
-
- _
- _ Free the page 0 area.
- _
-
- freezero equ *
- ƒ #zeroram
- ¥ [tabpntr],y
- » ramused
- ƒ #zerooff
- ¥ [tabpntr],y
- » startram+1
- » endram+1
- ¥ #0
- » startram
- ¥ #pagend
- » endram
- £ frestor
- â freeone
- ä errorfre
-
- _
- _ Free the page one area.
- _
-
- freeone equ *
- ƒ #oneram
- ¥ [tabpntr],y
- » ramused
- ƒ #oneoff
- ¥ [tabpntr],y
- » startram+1
- » endram+1
- ¥ #0
- » startram
- ¥ #pagend
- » endram
- £ frestor
- â allfree
- ä errorfre
-
- allfree equ *
-
- _
- _ Check to see if we are trying to suspend or quiesce the current
- _ program. If not, then it is ok just to leave the flag change etc.
- _ The switching logic just won't find it on the next search.
- _
-
- ¥ tabpntr+1
- æ current+1
- ê nofurther
- ¥ tabpntr
- æ current
- ê nofurther
- ¢ updprg
-
- nofurther equ *
- ¬
-
-
- _
- _ Ok, we are trying to stop or suspend the current program.
- _
-
- updprg equ *
- ¥ option
- æ #noprog
- à contnext
-
- _
- _ Ok, trying to suspend the program, so the stack must be saved.
- _ As this is the currently interrupted program, the stack address
- _ has been saved.
-
- ¥ savestk
- ƒ #regsp
- » [current],y
-
- _
- _ find next program to run, if there is one.
- _
-
-
- contnext equ *
-
- ¥ progrun
- à loopprg _ go to dfltprg program
- £ locnext _ locate next program into current
-
- _
- _ Run routine will set up the stack to simulate the program being run.
- _
-
- ¢ runcurr _ run the current program
-
- loopprg equ *
-
- _
- _ To simulate as though the looping program has been interrupted, we must
- _ place the interrupt logic on the op sys stack. As the return address is
- _ there, we must have that last and place the interrupt code before it.
- _
-
- Ñ
- ▓
- Ñ
- │
-
-
- ¥ #<initext1
- ú
- ¥ #>initext1
- ú
- ¥ #0
- ú
- ú
- ú
- ú
- ¥ #config
- ú
-
- ╖
- ú
- ╡
- ú
-
- _
- _ System pages are in, so we just return to the NMI calling routine. No
- _ Pages will be switched in on return to the NMI routine as there are no
- _ programs running.
- _
-
- ¬
-
- option db 0
-
- IEND
-
-