28
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
ImageCraft Assembler
3.1.3
Operands
Operands are the arguments to instructions. The number of operands and the format they use are
defined by the instruction being used. The operand format for each instruction is covered in the
“Instruction Set Summary” on page 14
Operands may take the form of constants, labels, dot operator, registers, RAM, or expressions.
Constants.
These are operands bearing values explicitly stated in the source file. Constants may
be stated in the source file using one of the radixes listed in
.
Labels.
These may be used as an operand for an instruction, as described on page
. Labels are
most often used as the operands for
jump
and
call
instructions to specify the destination address.
However, labels may be used as an argument for any instruction.
Dot Operator (.).
This is used to indicate that the ROM address of the first byte of the instruction
should be used as an argument to the instruction.
Table 3-2. Constants Formats
Radix
Name
Formats
Example
127
ASCII Character
‘J’
mov
A, ‘J’
;character constant
mov
A, ‘\’’
;use “\” to escape “‘”
mov
A, ‘\\’
;use “\” to escape “\”
16
Hexadecimal
0x4A
4Ah
$4A
mov
A, 0x4A
;hex--”0x” prefix
mov
A, 4Ah
;hex--append “h”
mov
A, $4A
;hex--”$” prefix
10
Decimal
74
mov
A, 74
;decimal--no prefix
8
Octal
0112
mov
A, 0112
;octal--zero prefix
2
Binary
0b01001010
%01001010
mov
A, 0b01001010 ;bin--“0b” prefix
mov
A, %01001010
;bin--”%” prefix
Example 1:
mov
A, <.
; moves low byte of the PC to A
Example 2:
mov
A, >.
; moves high byte of the PC to A
Example 3:
jmp
>.+3
nop
nop
; jumped to this instruction
nop
Содержание PSoC DESIGNER ImageCraft M8C
Страница 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Страница 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Страница 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Страница 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Страница 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Страница 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Страница 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...