42
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
M8C Instruction Set
4.5
Arithmetic Shift Right
ASR
Shifts all bits of the instruction’s argument one bit to the right. Bit 7 remains the same while bit 0 is
shifted into the Carry Flag.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
ASR
A
0x67
4
1
ASR
[expr]
0x68
7
2
ASR
[X+expr]
0x69
8
2
Conditional
Flags:
CF
ZF
Set if LSB of the source was set before the shift, else cleared.
Set if the result is zero; cleared otherwise.
Example 1:
mov
A, 0x00
;initialize A to 0
and
F, 0x00
;make sure all flags are cleared
asr
A
;A=0, CF=0, ZF=1
Example 2:
mov
A, 0xFF
;initialize A to 255
and
F, 0x00
;make sure all flags are cleared
asr
A
;A=0xFF, CF=1, ZF=0
Example 3:
mov
A, 0xAA
;initialize A to 170
and
F, 0x00
;make sure all flags are cleared
asr
A
;A=0xD5, CF=0, ZF=0
7
4
5
2
3
0
1
6
CF
A
CF
A:0, A:0
A:1, A:1
A:2
A:2
A:3, A:3
A:4, A:4
A:5
A:5
A:6, A:6
A:7
ram k
CF
ram k
:0
ram k
:0
ram k
:1
ram k
:1
ram k
:2
ram k
:2
ram k
:3
ram k
:3
ram k
:4
ram k
:4
ram k
:5
ram k
:5
ram k
:6
ram k
:6
ram k
:7
ram X k
+
CF
ram X k
+
:0
ram X k
+
:0
ram X k
+
:1
ram X k
+
:1
ram X k
+
:2
ram X k
+
:2
ram X k
+
:3
ram X k
+
:3
ram X k
+
:4
ram X k
+
:4
ram X k
+
:5
ram X k
+
:5
ram X k
+
:6
ram X k
+
:6
ram X k
+
:7
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 ...