26
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
ImageCraft Assembler
All user code is built from the components listed in
and complex conditional-assembly con-
straints can be placed on a collection of source files. The text below has an example of each of the
six basic components that will be discussed in detail in the following subsections. Line 1 is a com-
ment line as indicated by the “
//
” character string. Lines 5, 6, and 7 also have comments starting
with the “
;
” character and continuing to the end of the line. Lines 2 and 3 are examples of assembler
directives. The character strings before the “
:
” character in lines 3 and 4 are labels. Lines 5, 6, and 7
have instruction mnemonics and operands.
3.1.1
Labels
A label is a case-sensitive string of alphanumeric characters and underscores (_) followed by a
colon. A label is assigned the address of the current Program Counter by the Assembler, unless the
label is defined on a line with an
EQU
directive. See
for more infor-
mation. Labels can be placed on any line, including lines with source code as long as the label
appears first. The Assembler supports three types of labels: local, global, and re-usable local.
Local Labels.
These consist of a character string followed by a colon. Local labels cannot be refer-
enced by other source files in the same project, they can only be used within the file in which they
are defined. Local labels become global labels if they are “exported.” The following example has a
single local label named
SubFun
. Local labels are case sensitive.
Source File
Components:
1 // My Project Source Code
2 include “project.inc”
3 BASE: equ
0x10
4 _main:
5 mov reg[0x00], 0x34
;write 0x34 to Port 0
6 mov A, reg[0x04]
;read Port 1
7 and [BASE+2], A
;store Port 1 value in RAM
Local Labels:
mov
X, 10
SubFun:
xor
reg[00h], FFh
dec
X
jnz
SubFun
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...