em78c156e+1621显示汇编例子
;XS1621 ,3.58,OUT 20001 /6/22
INDI EQU 0X0
RTCC EQU 0X1
PC EQU 0X2
STATUS EQU 0X3
FSR EQU 0X4
PORT5 EQU 0X5
PORT6 EQU 0X6
STACK_A EQU 0X10
STACK_S EQU 0X11
XS1 EQU 0X12
XS2 EQU 0X13
XS3 EQU 0X15
XS4 EQU 0X16
XS5 EQU 0X17
XS6 EQU 0X18
XS7 EQU 0X19
XS8 EQU 0X1A
JP1 EQU 0X1B
JP2 EQU 0X1C
JP3 EQU 0X1D
JP4 EQU 0X1E
XS9 EQU 0X20
XS10 EQU 0X21
ORG 0
JMP MAIN
ORG 8
MOV STACK_A,A
SWAP STACK_A
SWAPA STATUS
MOV STACK_S,A
CLR 0XF
SWAPA STACK_S
MOV STATUS,A
SWAPA STACK_A
RETI
BIAO:
ADD 0X2,A
RETL @0B11101110 ;0
RETL @0B01001000 ;1
RETL @0B10111010 ;2
RETL @0B11011010 ;3
RETL @0B01011100 ;4
RETL @0B11010110 ;5
RETL @0B11110110 ;6
RETL @0B01001010 ;7
RETL @0B11111110 ;8
RETL @0B01011110 ;9
RETL @0B00000000 ;A
XSZW:
MOV A,JP1
CALL BIAO
MOV XS3,A
MOV A,JP2
CALL BIAO
MOV XS4,A
MOV A,JP3
CALL BIAO
MOV XS5,A
MOV A,JP4
CALL BIAO
MOV XS6,A
MOV A,@7
MOV XS1,A
AWS:
RLC XS10
RLC XS9
RLC XS8
RLC XS7
JBS XS6,1
JMP ASD1
BS XS10,4
JMP ASG1
ASD1:
BC XS10,4
ASG1:
RRC XS6
RLC XS10
RLC XS9
RLC XS8
RLC XS7
JBS XS5,1
JMP ASD2
BS XS10,4
JMP ASG2
ASD2:
BC XS10,4
ASG2:
RRC XS5
RLC XS10
RLC XS9
RLC XS8
RLC XS7
JBS XS4,1
JMP ASD3
BS XS10,4
JMP ASG3
ASD3:
BC XS10,4
ASG3:
RRC XS4
RLC XS10
RLC XS9
RLC XS8
RLC XS7
JBS XS3,1
JMP ASD4
BS XS10,4
JMP ASG4
ASD4:
BC XS10,4
ASG4:
RRC XS3
DJZ XS1
JMP AWS
RET
YSA:
MOV A,@2
MOV XS3,A
LOP1:
NOP
DJZ XS3,A
JMP LOP1
RET
XSS: ;HT1621 XS 8-BITS COMMAND MODE
BS PORT5,1
BC PORT5,0 ;CS=0
CALL YSA
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=1
BC PORT5,2
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=0
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=0
MOV A,@8
MOV XS1,A
XSC:
JBS XS2,7
JMP XSD
BS PORT5,2 ;DATA=1
JMP XSG
XSD:
BC PORT5,2 ;DATA=0
XSG:
BC PORT5,1
CALL YSA
BS PORT5,1
RLC XS2
DJZ XS1
JMP XSC
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=?
BS PORT5,0 ;CS=1
RET
XSA: ;HT1621XS WRITE MODE
MOV A,@8
MOV XS1,A
WXC:
JBS XS2,7
JMP WXD
BS PORT5,2 ;DATA=1
JMP WXG
WXD:
BC PORT5,2 ;DATA=0
WXG:
BC PORT5,1
CALL YSA
BS PORT5,1
RLC XS2
DJZ XS1
JMP WXC
RET
MAIN:
MOV A,@0X0
IOW 0X0E
MOV A,@0B11000000
CONTW
CLR 0X0F
MOV A,@0X01
IOW 0X0F
ENI
MOV A,@0X10
MOV 0X4,A
LOPKN:
MOV A,@0
MOV 0X0,A
JBS 0X4,6
JMP KOL
JMP KIL
KOL:
NOP
INC 0X4
JMP LOPKN
KIL:
BS 0X4,6
MOV A,@0B11110000
IOW PORT5
CLR PORT5
MOV A,@0B11111111
IOW PORT6
CLR PORT6
NOP
MOV A,@0x0F
MOV PORT5,A
MOV A,@8
MOV JP1,A
MOV A,@8
MOV JP2,A
MOV A,@0
MOV JP3,A
MOV A,@9
MOV JP4,A
CALL XSZW
BC PORT5,0 ;CS=0
CALL YSA
BS PORT5,0 ;CS=1
CALL YSA
BC PORT5,0 ;CS=0
CALL YSA
BS PORT5,0 ;CS=1
CALL YSA
MOV A,@0B11100011 ;COMMAND NORAML MODE
MOV XS2,A
CALL XSS
MOV A,@0B00011000 ;SYSTEM RC 256K
MOV XS2,A
CALL XSS
MOV A,@0B00101001 ;BIAS 1/3 4 COMMONS
MOV XS2,A
CALL XSS
MOV A,@0B00000001 ;SYS EN
MOV XS2,A
CALL XSS
MOV A,@0B00001001 ;TONE ON
MOV XS2,A
CALL XSS
MOV A,@0B01000000 ;WRITE
MOV XS2,A
BC PORT5,0 ;CS=0
CALL YSA
BS PORT5,2
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=1
CALL XSA
MOV A,XS7 ;1
MOV XS2,A
CALL XSA
MOV A,XS8 ;2
MOV XS2,A
CALL XSA
MOV A,XS9 ;3
MOV XS2,A
CALL XSA
MOV A,XS10 ;4
MOV XS2,A
CALL XSA
MOV A,@0XFF ;5
MOV XS2,A
CALL XSA
BS PORT5,0 ;CS=1
MOV A,@0B00000011 ;LCD ON
MOV XS2,A
CALL XSS
NOP
KK:
NOP
NOP
NOP
NOP
NOP
JMP KK
EOP
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。