em78c156e+1621顯示匯編例子
;XS1621,3.58,OUT20001/6/22
INDIEQU0X0
RTCCEQU0X1
PCEQU0X2
STATUSEQU0X3
FSREQU0X4
PORT5EQU0X5
PORT6EQU0X6
STACK_AEQU0X10
STACK_SEQU0X11
XS1EQU0X12
XS2EQU0X13
XS3EQU0X15
XS4EQU0X16
XS5EQU0X17
XS6EQU0X18
XS7EQU0X19
XS8EQU0X1A
JP1EQU0X1B
JP2EQU0X1C
JP3EQU0X1D
JP4EQU0X1E
XS9EQU0X20
XS10EQU0X21
ORG0
JMPMAIN
ORG8
MOVSTACK_A,A
SWAPSTACK_A
SWAPASTATUS
MOVSTACK_S,A
CLR0XF
SWAPASTACK_S
MOVSTATUS,A
SWAPASTACK_A
RETI
BIAO:
ADD0X2,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:
MOVA,JP1
CALLBIAO
MOVXS3,A
MOVA,JP2
CALLBIAO
MOVXS4,A
MOVA,JP3
CALLBIAO
MOVXS5,A
MOVA,JP4
CALLBIAO
MOVXS6,A
MOVA,@7
MOVXS1,A
AWS:
RLCXS10
RLCXS9
RLCXS8
RLCXS7
JBSXS6,1
JMPASD1
BSXS10,4
JMPASG1
ASD1:
BCXS10,4
ASG1:
RRCXS6
RLCXS10
RLCXS9
RLCXS8
RLCXS7
JBSXS5,1
JMPASD2
BSXS10,4
JMPASG2
ASD2:
BCXS10,4
ASG2:
RRCXS5
RLCXS10
RLCXS9
RLCXS8
RLCXS7
JBSXS4,1
JMPASD3
BSXS10,4
JMPASG3
ASD3:
BCXS10,4
ASG3:
RRCXS4
RLCXS10
RLCXS9
RLCXS8
RLCXS7
JBSXS3,1
JMPASD4
BSXS10,4
JMPASG4
ASD4:
BCXS10,4
ASG4:
RRCXS3
DJZXS1
JMPAWS
RET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OVXS2,A
CALLXSS
MOVA,@0B00101001;BIAS1/34COMMONS
MOVXS2,A
CALLXSS
MOVA,@0B00000001;SYSEN
MOVXS2,A
CALLXSS
MOVA,@0B00001001;TONEON
MOVXS2,A
CALLXSS
MOVA,@0B01000000;WRITE
MOVXS2,A
BCPORT5,0;CS=0
CALLYSA
BSPORT5,2
BCPORT5,1
CALLYSA
BSPORT5,1;DATA=1
CALLXSA
MOVA,XS7;1
MOVXS2,A
CALLXSA
MOVA,XS8;2
MOVXS2,A
CALLXSA
MOVA,XS9;3
MOVXS2,A
CALLXSA
MOVA,XS10;4
MOVXS2,A
CALLXSA
MOVA,@0XFF;5
MOVXS2,A
CALLXSA
BSPORT5,0;CS=1
MOVA,@0B00000011;LCDON
MOVXS2,A
CALLXSS
NOP
KK:
NOP
NOP
NOP
NOP
NOP
JMPKK
EOP