CODE

Abbreviation

CD

Arguments

None.

Default

NOCODE

Description

The CODE directive appends an assembly mnemonics list to the listing file. The assembler code is represented for each function contained in the source program. By default, no assembly code listing is included in the listing file.

Example

#pragma code

The following example shows the C source followed by the resulting object code and its representative mnemonics. The line number of each statement that produced the code is displayed between the assembly lines. The characters R  and E  stand for Relocatable and External, respectively.

.
.
.
stmt level source
1 extern unsigned char a, b;
2 unsigned char c;
3
4 main()
5 {
6 1 c = 14 + 15 * ((b / c) + 252);
7 1 }
.
.
.
ASSEMBLY LISTING OF GENERATED OBJECT CODE
; FUNCTION main (BEGIN)
; SOURCE LINE # 5
; SOURCE LINE # 6
0000 E500 E MOV A,b
0002 8500F0 R MOV B,c
0005 84 DIV AB
0006 75F00F MOV B,#0FH
0009 A4 MUL AB
000A 24D2 ADD A,#0D2H
000C F500 R MOV c,A
; SOURCE LINE # 7
000E 22 RET
; FUNCTION main (END)
.
.
.