
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
71
Содержание HT48R05A-1
Страница 7: ...vi Cost Effective I O Type MCU...
Страница 8: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Страница 9: ...2 Cost Effective I O Type MCU...
Страница 52: ...P a r t I I Programming Language Part II Programming Language 45...
Страница 53: ...46 Cost Effective I O Type MCU...
Страница 59: ...52 Cost Effective I O Type MCU...
Страница 90: ...P a r t I I I Development Tools Part III Development Tools 83...
Страница 91: ...84 Cost Effective I O Type MCU...
Страница 101: ...94 Cost Effective I O Type MCU...
Страница 104: ...Appendix Appendix 97...
Страница 105: ...98 Cost Effective I O Type MCU...
Страница 115: ...108 Cost Effective I O Type MCU...
Страница 116: ...A p p e n d i x B Package Information Appendix B Package Information 109 B...
Страница 123: ...116 Cost Effective I O Type MCU...
Страница 125: ...Amendments...