•
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 variables. Programs in other sources may refer to these
variables. The variable ’tmpbuf’ is also declared as external. There should
be a source file defining a byte that is named tmpbuf and is declared as a
public variable.
→
Syntax
name
PROC
name
ENDP
•
Description
The PROC and ENDP directives mark a block of code which can be called or
jumped to from other modules. The PROC creates a label name which stands
for the address of the first instruction of a procedure. The assembler will set
the value of the label to the current value of the location counter.
•
Example
toggle
PROC
mov
tmpbuf, a
mov
a, 1
xorm
a, flag
mov
a, tmpbuf
ret
toggle
ENDP
→
Syntax
[
label:]
DC
expression1 [,expression2 [,...]]
•
Description
The DC directive stores the value of expression1, expression2 etc. in
consecutive memory locations. This directive is used for the CODE sec-
tion only. The bit size of the result value is dependent on the ROM size of
the microcontroller, specified by the directive .CHIP or the command line
parameter /CHIP=. The HASM will clear any redundant bits; expression1
has to be a value or a label. This directive may also be employed to set up
the table in the code section.
Chapter 10 Assembly Language and Cross Assembler
123
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...