SN8P2604
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 95
Version 1.1
11.4 INSTRUCTION
11.4.1 B0MOV M,I
“M” of “B0MOV M, I” is working register (Y,Z,R,PFLAG)(0x80~0x86). “I” is immediate data.
Note:
The “I” can’t be “E6H” and “E7H”.
If “I” of “B0MOV M, I” is “E6H” or “E7H”, S8ASM V1.99L and
later version will show the error message on screen.
Users need to check the value of “B0MOV M,I” instruction again. This instruction is often used for look-up table function
to set table address. It is easy to check the table address from listing file (.LST) after compiling. User also can use
ORG to set table start address and avoid “E6H” and “E7H”.
Example: Set table start address by ORG.
ORG
0x0100
; Set table address from 0x0100.
Table:
DW
0x9876
…
11.4.2 B0XCH A, M
“B0XCH A, M” exchanges A and M contents. It only supports user defined RAM.
Note:
The “M” can’t be system register area (0x80~0xFF).
Example: Save PFLAG.
Error case!
B0XCH
A, PFLAG
; PFLAG is a system register. “B0XCH A, M” can’t process it.
B0MOV
PFLAGBUF,
A
Correct case!
B0MOV
A,
PFLAG
B0MOV
PFLAGBUF,
A
;
PFLAGBUF is user defining RAM,
Example: Save ACC.
ACCBUF
DS
1
; Define ACCBUF to be ACC buffer.
ORG 0
…
ORG 10
…
B0XCH A,
ACCBUF
…