mac-rom/Internal/Asm/VectorTablePatch.a
Elliot Nunn 4325cdcc78 Bring in CubeE sources
Resource forks are included only for .rsrc files. These are DeRezzed into their data fork. 'ckid' resources, from the Projector VCS, are not included.

The Tools directory, containing mostly junk, is also excluded.
2017-12-26 09:52:23 +08:00

106 lines
3.3 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;
; 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