Topic : Pure Assembler Documentation Author : John Kormylo Version : PASM.HYP 1.0 Subject : Documentation/Pure Assembler Nodes : 740 Index Size : 20262 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : en @default : @help : Help @options : +g -i -s +x +z -t4 @width : 75 View Ref-File[ Pure C Linkage ] Functions are called using BSR or JSR instructions which store the return address on the stack. When the function is done, it uses the RTS instruction to resume execution in the calling routine. Function names and global variables can be defined using GLOBL, EXPORT, IMPORT, XDEF and/or XREF directives. Parameters are passed in registers and/or on the stack (see Parameter Passing). One can write assembly language functions to be called from Pure C (see Functions) and one can call Pure C Functions from assembly language (see Calling). One can also call TOS functions in ROM directly using the TRAP instruction instead of calling the interface functions in PCTOSLIB. TOS functions expect all arguments to be passed on the stack. One can write entire programs in assembly language and bypass PCSTART altogether. The first executable instruction of the first object module in the project file will be executed first when the program is run. At run time, all of RAM will be reserved and A7 will point to the top of this area. One should therefore allocate a smaller region for the program and stack using Mshrink. One will need information from BASPAG for this. Finally, one can insert function addresses into system jump vectors (see Atari Memory Map) or into exception vectors. This should only be done by a program run from the 'AUTO' folder. These functions will be executed in Supervisor Mode. Examples: Tversion dble_vector_prod force_media_change auto_resident