view 3rdparty/packages/ccompiler/sources/intercept.a @ 3257:987f995993c3

co80: Use HW port address from descriptor (via SCF and VTIO) Change the driver code to not use a hardcoded address. Change the value in the descriptor to the previously hardcoded value in the driver. Looks like someone was debugging a WordPak prototype using the cartridge ROM enable output...
author Tormod Volden <debian.tormod@gmail.com>
date Wed, 29 Aug 2018 08:49:13 +0200
parents 734862561313
children
line wrap: on
line source

* 'Signal' and 'intercept' are definitely incompatible and
* use of both in a program will have undefined results.
* In order to protect the programmer from this a dummy global
* label is declared in both relocatable modules which will produce
* an 'entry name clash' error in the loader if an attempt is made
* to use both.

 use ..../defs/os9defs.a
 psect intercept_a,0,0,1,0,0

 vsect
intsave rmb 2 place for C routine address
 endsect

_sigint:
* intercept(func)
intercep:
intercept:
 pshs u save register variable

 tfr y,u set data are pointer
 ldx 4,s get C function address
 stx intsave,y save it for the receiver
 leax receiver,pcr get the address for OS-9

 os9 F$ICPT call os9
 puls u restore register variable

 lbra _sysret

* This is where OS-9 will pass control when the process has been
* sent a signal. All that is needed is to run the intercept routine
* and execute 'rti'.
receiver
 tfr u,y set the data pointer
 clra clear the MSB
 pshs d stack the signal number
 jsr [intsave,y] go run the routine
 leas 2,s reset the stack
 rti and return
 endsect