| |||||
On-Line Manuals C166 User's Guide | Using the SRC DirectiveThe C166 Compiler can create assembly source files that you assemble with the A166 Assembler. These SRC files can help you determine the argument passing conventions between C and assembly. To create an assembly source file, you must use the SRC directive with the C166 Compiler. For example:
#pragma SRC
#pragma SMALL
unsigned int asmfunc1 (
unsigned int arg)
{
return (1 + arg);
}
For this example, the compiler generates the following SRC file.
$NOMACRO
$SEGMENTED CASE NOMOD166
;
; 'ASM1.SRC' GENERATED FROM INPUT FILE 'ASM1.C'
; COMPILER INVOKED BY:
; C166.EXE ASM1.C CODE SRC
;
$MODINF (11)
NAME ASM1
NCODE CGROUP ?PR?ASM1
ASSUME DPP3: SYSTEM
REGDEF R0 - R15
?PR?ASM1 SECTION CODE WORD 'NCODE'
; line 1: #pragma SRC
; line 2: #pragma SMALL
; line 3:
; line 4: unsigned int asmfunc1 (unsigned int arg) {
asmfunc1 PROC NEAR
PUBLIC asmfunc1
; FUNCTION asmfunc1 (BEGIN RMASK = @0x0010)
;---- Variable 'arg' assigned to Register 'R8' ----
; line 5: return (1 + arg);
MOV R4,R8
ADD R4,#1
; line 6: }
RET
; FUNCTION asmfunc1 (END RMASK = @0x0010)
asmfunc1 ENDP
?PR?T ENDS
END
| ||||
| |||||