46
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
M8C Instruction Set
4.9
Decrement
DEC
Subtracts one from the value of the argument and replaces the argument’s original value with the
result. If the result is ‘-1’ (original value was zero) the Carry Flag is set. If the result is ‘0’ (original
value was one) the Zero Flag is set.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
DEC
A
0x78
4
1
DEC
X
0x79
4
1
DEC
[expr]
0x7A
7
2
DEC
[X+expr]
0x7B
8
2
Conditional
Flags:
CF
ZF
Set if the result is -1; cleared otherwise.
Set if the result is zero; cleared otherwise.
Example:
mov
[0xEB], 3
loop2:
;The loop will be executed 3 times.
dec
[0xEB]
jnz
loop2
;Jump will not be taken when ZF is set by
;DEC (i.e., wait until the loop counter
;(0xEB) is decremented to 0x00).
A
A 1
–
X
X 1
–
ram k
ram k
1
–
ram X k
+
ram X k
+
1
–
Содержание 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 ...