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
–
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 ...