C251 UCL.C SRC
#pragma userclass (near = app1)
int near x1 [10];
int near x2 [10];
#pragma userclass (near = default)
int near y1 [10];
int near y2 [10];
#pragma userclass (far = app2)
int far x3 [10];
int far x4 [10];
#pragma userclass (ucode = t2code)
int test1 (int i1, int i2) {
return (i1 + i2 * 10);
}
The example above creates the following assembly source. Note that
the program is translated with the setting ROM(HUGE) and therefore
the program code is placed in the class ECODE_T2CODE.
NAME UCL
?ED?APP1?UCL SEGMENT 'EDATA_APP1'
?FA?APP2?UCL SEGMENT 'HDATA_APP2'
?PR?T2CODE?UCL SEGMENT 'ECODE_T2CODE'
?ED?UCL SEGMENT EDATA
RSEG ?ED?APP1?UCL
x1: DS 20
x2: DS 20
RSEG ?FA?APP2?UCL
x3: DS 20
x4: DS 20
RSEG ?ED?UCL
y1: DS 20
y2: DS 20
RSEG ?PR?T2CODE?UCL
test1? PROC FAR;
---- Variable 'i2' assigned to Register 'WR4' ----
MOV WR2,WR6;
---- Variable 'i1' assigned to Register 'WR2' ----
; line 14: return (i1 + i2 * 10);
MOV WR6,#0AH
MUL WR6,WR4
ADD WR6,WR2
; line 15: }
ERET
ENDP
END
#pragma userclass (near=app1)
assigns the user class EDATA_APP1 to variables with memory
space near which are then placed in the memory class
EDATA by default. Therefore the arrays x1 and x2
are located in the memory class EDATA_APP1.
#pragma userclass (near=default)
resets the memory class for near variables to the compiler
default.
|