sys7.1-doc-wip/Internal/Asm/VectorTablePatch.a

106 lines
3.3 KiB
Plaintext
Raw Normal View History

2019-07-27 14:37:48 +00:00
;
; File: VectorTablePatch.a
;
; Contains: This contains macros used to create the ROM vectorization
; patches applied by the Vectorization tool. The user
; needs to assemble this file directly, and pass in the name of
; the vector table source file ( VectorTable.a ) on the command
; line with:
;
; Asm VectorTablePatch.a -d "&VECTORTABLE='filename'"
;
; Written by: Kurt Clark
;
; Copyright: © 1992-1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM3> 2/21/93 kc Change to case on change macros to create empty module for
; routines that we don't want to vectorize, so that we do not
; generate a "non vectorized routine warning"
; <SM2> 12/3/92 RB Added the feature has2MegOrMore.
; <1> 12/2/92 kc first checked in
; To Do:
;
MACHINE mc68020
Case On
kDoNotPatch Equ 1 ; info table format version
kDirectVector Equ 1 ; direct vector type
kIndirectVector Equ 2 ; indirect vector type
Macro ; nothing to do here but we will generate an empty patch
&Name vDataTable ; module so the vectorize tool will not generate a
&Name Proc Export ; "Non vectorized routine" warning.
EndProc
EndMacro
Macro ; nothing to do here but we will generate an empty patch
&Name vNoVector ; module so the vectorize tool will not generate a
&Name Proc Export ; "Non vectorized routine" warning.
EndProc
EndMacro
Macro ; At some point we may decide to administer atraps
&Name vATrap &TNum ; with the same technique we use for ROM vectors.
&Name Proc Export ; nothing to do now but we will generate an empty patch
EndProc ; module so the vectorize tool will not generate a
EndMacro ; "Non vectorized routine" warning.
Macro ; This is used for any vectors where performance is
&Name vDirect &TVec, &CVec, &AReg ; important enough to warrant a seperate low memory vector.
&Name Proc Export ; At this point we are not administering direct vectors.
EndProc ; nothing to do here but we will generate an empty patch
EndMacro ; module so the vectorize tool will not generate a
; "Non vectorized routine" warning.
Macro
&Name vIndirect &TVec, &CVec, &AReg, &Cond
; Make sure that we want to create a vector for this entry
If &Name = '' Then ; check name
AError 'Name missing from vIndirect Macro'
Exitm
Endif
If &Cond ≠ '' Then ; check conditional
If &Type(&Cond) = 'UNDEFINED' Then
&Name proc export ; generate an empty patch
endproc
Exitm
ElseIf Not &Eval(&Cond) Then
&Name proc export ; generate an empty patch
endproc
Exitm
Endif
Endif
; Create the "patch" that the will be appended to the callee's module.
If &AReg ≠ '' And &AReg = 'A7' Then
&Name proc export ; export entrypoint
move.l ([&TVec],&CVec),-(sp) ; push address of the "real" routine
rts ; and jump to it
EndProc
Else
&Name proc export ; export entrypoint
move.l &TVec,&AReg ; move address of table into register
move.l &CVec(&AReg),&AReg ; move address of "real" routine into register
jmp (&AReg) ; and jump to it
EndProc
Endif
EndMacro
Include &VECTORTABLE ; do the real work
End