|
CC78K4 Datasheet, PDF (445/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language | |||
|
◁ |
CHAPTER 11 EXTENDED FUNCTIONS
(41) Three-byte address reference/generation function
Three-Byte Address Reference/Generation Function
#pragma addraccess
FUNCTION
⢠A code that references the highest byte and the lower 2 bytes of a 3-byte address, and a code that generates
a 3-byte address from the value of the highest byte and the lower 2 bytes are output to an object directly with
inline expansion and an object file is created.
⢠If the #pragma directive is not added, the three-byte address reference/generation function is regarded as an
ordinary function.
EFFECT
⢠Three-byte address reference/generation can be performed with a short code without using a complex cast
description.
USAGE
⢠Describe the #pragma addraccess directive at the beginning of the C source.
⢠Describe the #pragma addraccess directive in the C source in the same manner as a function call.
⢠The following items can be described before the #pragma addraccess directive.
(1) Comments
(2) Other #pragma directives
(3) Among the preprocessing directives, those that do not generate a variable definition/reference or
function definition/reference.
⢠The keywords following #pragma addraccess can be described in either uppercase or lowercase letters.
The following three names can be used for the three-byte address reference/generation function name.
⢠FP_SEG
⢠FP_OFF
⢠MK_FP
[List of function names for three-byte address reference/generation]
(1) unsigned char FP_SEG(void *addr);
The value of the most significant byte of a three-byte address pointed by addr is obtained.
(2) unsigned int FP_OFF(void *addr);
The values of the lower 2 bytes of a three-byte address pointed by addr are obtained.
(3) void *MK_FP(unsigned char seg, unsigned int offset);
The address value of the three-byte address having the value pointed by seg as the most significant byte, and
the value pointed by offset as the lower 2 bytes.
Userâs Manual U15556EJ1V0UM
445
|
▷ |