三星NAND型FLASH数据纠错模块设计
L3: CMP
JNZ
CMP JZ D1 CMP JZ D1 CMP JZ D0
BX,0 BX,2 BX,4 FLAG,0 D4
CMP AX,0FDFDH ;按键9
JZ BUFF9
AX,0FDFEH ;按键8
CMP
JZ BUFF8
AX,0FE7FH ;按键7
CMP
JZ BUFF7 CMP
AX,0FEBFH ;按键6
JZ BUFF6
AX,0FEDFH ;按键5
D1: CMP
JZ BUFF5 CMP
AX,0FEEFH ;按键4
JZ BUFF4 CMP
AX,0FEF7H ;按键3
JZ BUFF3
页脚内容
15
三星NAND型FLASH数据纠错模块设计
D0: CMP
AX,0FEFBH ;按键2
JZ BUFF2 CMP
AX,0FEFDH ;按键1
JZ BUFF1
AX,0FEFEH ;按键0
CMP
JZ BUFF0
AX,0FD7FH ;按键F
CMP
JZ BUFFF
AX,0FDFBH ;按键A
D4: CMP
JZ BUFFA CMP
AX,0FDF7H ;按键B
JZ BUFFB JMP
OUTPUT
BUFFER[BX],9
BUFF9: MOV
JMP
OUTPUT
BUFFER[BX],8
BUFF8: MOV
JMP
OUTPUT
BUFFER[BX],7
BUFF7: MOV
JMP
OUTPUT BUFFER[BX],6 OUTPUT
BUFFER[BX],5
BUFF6: MOV
JMP
BUFF5: MOV
JMP
OUTPUT
BUFFER[BX],4
页脚内容
BUFF4: MOV
16
三星NAND型FLASH数据纠错模块设计
JMP OUTPUT BUFFER[BX],3 OUTPUT
BUFFER[BX],2
BUFF3: MOV
JMP
BUFF2: MOV
JMP
OUTPUT
BUFFER[BX],1
BUFF1: MOV
JMP
OUTPUT BUFFER[BX],0 OUTPUT
BUFF0: MOV
JMP
BUFFA: MOV
JMP
FLAG,1 OUTPUT
FLAG,0
BUFFB: MOV
JMP
OUTPUT
BUFFF: CMP BUF[0],1
JNZ A7 MOV DL,BUF[1] MOV BL,KEY MOV BUFFER[BX],DL MOV BUF[0],0
DELAY1 BL,0
A7: CALL
CMP
JZ L5
BL,KEY
页脚内容
A8: MOV
17
三星NAND型FLASH数据纠错模块设计
CMP BX,5 JNZ L5 MOV BX,0 JMP
L6 L5: INC BL L6: MOV KEY,BL
OUTPUT: POP DX
POP CX POP BX POP AX
RET
KEYSCAN ENDP
SET_VECTOR PROC NEAR
PUSH AX PUSH BX MOV
AX,0
MOV ES,AX ; MOV BX,40H*4 ;BX MOV AX,OFFSET INTRPROC ; MOV ES:[BX],AX MOV AX,SEG INTRPROC
MOV ES:[BX+2],AX ;
POP
BX
中断向量表段基址为0000H
中预置中断向量地止,中断类型号为40H 向量表中低地址存放偏移地址, 向量表中高地址存放段基地址 页脚内容
18
三星NAND型FLASH数据纠错模块设计
POP AX
RET
SET_VECTOR ENDP
INIT_8259 PROC NEAR
PUSH AX PUSH
DX
MOV AL,13H ;ICW1: MOV DX,EVEN_8259 OUT DX,AL
MOV AL,40H ;ICW2: MOV
DX,ODD_8259
OUT DX,AL MOV AL,01H ;ICW4: MOV DX,ODD_8259 OUT DX,AL
POP DX POP AX
RET
INIT_8259 ENDP
INTRPROC PROC FAR
PUSH AX
PUSH BX ;
PUSH
DS
边沿触发,单片系统,需要ICW4 类型号从40H开始 完全嵌套方式,非缓冲,非自动结束保护现场 页脚内容
19