
Chapter 6
6.4.2 Example - Applying the OR Instruction.
;--------------------------------------------------------------
; The routine demonstrates the OR instruction.
;--------------------------------------------------------------
ORG
0x0000
JMP POWERON
; go to power-on procedure
ORG 0x0010
; power-on reset procedure
POWERON:
MOV A, @0b00111100
MOV 0x15, A
; R15=0x3C
MOV A, @0b11101110
MOV 0x16, A
; R16=0xEE
OR A, 0x15
; A=A|R15=0xFE
;--------------------------------------------------------------
MOV A, @0x78
; A=0x78
OR 0X16, A
; R16=A|R16=0xFE
;--------------------------------------------------------------
OR A, @0x3C
; A=A|0x3C=0x7C
OVER: JMP
OVER
6.4.3 Example - Applying the BC, BS, SWAPA, and SWAP
Instructions
;--------------------------------------------------------------
; The routine demonstrates the BC, BS, SWAPA, and SWAP
; instructions.
;--------------------------------------------------------------
ORG
0x0000
JMP POWERON
; go to power-on procedure
ORG 0x0010
; power-on reset procedure
POWERON:
MOV A, @0xEE
MOV 0x16, A
; R16=0xEE
BC 0x16, 3
; set R16(3)=0 -> R16=0xE6
BC 0x16, 6
; set R16(6)=0 -> R16=0xA6
SWAPA 0x16
; R16(3~0)->A(7~4)
; R16(7~4)->A(3~0) -> A=0x6A
MOV 0x15, A
; R15=0x6A
SWAP 0x15
; R15(3~0)->R15(7~4)
; R15(7~4)->R15(3~0) -> R15=0xA6
BS 0x15, 6
; set R15(6)=1 -> R15=0xE6
BS 0x15, 3
; set R15(3)=1 -> R15=0xEE
OVER: JMP
OVER
78
•
Software Application
EM60000Series User’s Manual