English
Language : 

CC78K4 Datasheet, PDF (415/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
Changing the Method of Calculating the Offset of Arrays and Pointers -QH
EXAMPLE
(C source)
int tabi [100];
char tabc [100];
int *iptr;
void main (void) {
long I = 50;
int i = 30;
char c = 2;
tabi [i] = 1;
tabc [c] = 2;
tabi [l] = 3;
*(iptr + i) = 4;
*(iptr + (-i)) = 5;
*(iptr - i) = 6;
*(iptr -10) = 7;
*(iptr + (-10)) = 8;
}
/* unsigned offset calculation, 64 KB or less */
/* unsigned offset calculation, 64 KB or less */
/* signed offset calculation */
/* unsigned offset calculation, 64 KB or less */
/* offset calculation, positive 64 KB or less */
/* signed offset calculation */
/* signed offset calculation */
/* signed offset calculation */
(Output object of compiler)
When -ML, -QH is specified (1/3)
@@CODE CSEG
_main:
push
push
push
; line 6:
movw
subw
; line 7:
movw
; line 8:
mov
; line 9:
; line 10 :
movw
uup
rp3
vvp
long 1 = 50;
rp3,#032H
;50
vp,vp
int i = 30;
up,#01EH
;30
char c= 2;
c,#02H
;2
hl,up
tabi [i] = 1;
/* unsigned offset calculation, 64 KB or less */
User’s Manual U15556EJ1V0UM
415