®
Syntax
ORG
expression
·
Description
This directive sets the location counter to
expression
. The subsequent code and data offsets
begin at the new offset specified by
expression
. The code or data offset is relative to the be-
ginning of the section where the directive
ORG
is defined. The attribute of a section determines
the actual value of offset, absolute or relative.
·
Example
ORG 8
mov A, 1
In this example, the statement
mov A, 1
begins at location 8 in the current section.
®
Syntax
PUBLIC
name1
[,
name2
[,...]]
EXTERN
name1
:
type
[,
name2
:
type
[, ...]]
·
Description
The
PUBLIC
directive marks the variable or label specified by a name that is available to other
modules in the program. The
EXTERN
directive, on the other hand, declares an external vari-
able, label or symbol of the specified name and type. The type can be one of the four types:
BYTE
,
WORD
and
BIT
(these three types are for data variables), and
NEAR
(a label type and
used by call or jmp).
·
Example
PUBLIC
start, setflag
EXTERN
tmpbuf:byte
CODE
.SECTION
¢
CODE
¢
start:
mov
a, 55h
call
setflag
....
setflag
proc
mov
tmpbuf, a
ret
setflag
endp
end
In this example, both the label
start
and the procedure
setflag
are declared as public vari-
ables. Programs in other sources may refer to these variables. The variable
tmpbuf
is also de-
clared as external. There should be a source file defining a byte that is named
tmpbuf
and is
declared as a public variable.
Chapter 4 Assembly Language and Cross Assembler
107
Содержание HT46R22
Страница 7: ...vi A D Type MCU...
Страница 9: ...viii A D Type MCU...
Страница 10: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Страница 11: ...2 A D Type MCU...
Страница 90: ...P a r t I I Programming Language Part II Programming Language 81...
Страница 91: ...82 A D Type MCU...
Страница 97: ...88 A D Type MCU...
Страница 128: ...P a r t I I I Development Tools Part III Development Tools 119...
Страница 129: ...120 A D Type MCU...
Страница 140: ...Appendix Appendix 131...
Страница 141: ...132 A D Type MCU...
Страница 151: ...142 A D Type MCU...
Страница 152: ...A p p e n d i x B Package Information Appendix B Package Information 143 B...
Страница 161: ...A D Type MCU...
Страница 162: ...Amendments...