8279c語言
㈠ 奼備竴奼囩紪璇璦閫氳繃鎸夐敭鐨勬柟寮忓湪鏁扮爜綆′笂鏄劇ず瀵瑰簲鐨勬暟瀛楋紝瑕佹眰鑳藉疄鐜3浣嶇殑
Z8279 EQU 212H
D8279 EQU 210H
LEDMOD EQU 00h ;宸﹁竟杈撳叆,鍏浣嶆樉紺哄栭儴璇戠爜鍏浣嶆樉紺
LEDFEQ EQU 38H ;鎵鎻忛戠巼
CODE SEGMENT
ASSUME CS:CODE,DS:CODE
START: ;鍒濆嬪寲
\\
PUSH CS
OUT DX,AL
POP ds
MOV DX,Z8279
MOV AL,LEDMOD
MOV AL,LEDFEQ
OUT DX,AL
MOV DX,D8279
MOV AL,7FH
OUT DX,AL
MOV DX,D8279
MOV AL,7FH
OUT DX,AL
MOV DX,D8279
MOV AL,7DH
OUT DX,AL
MOV DX,D8279
MOV AL,7FH
OUT DX,AL
MOV DX,D8279
MOV AL,70H
OUT DX,AL
MOV DX,D8279
MOV AL,5bH
OUT DX,AL
MOV DX,D8279
MOV AL,70H
OUT DX,AL
MOV DX,D8279
MOV AL,76H
OUT DX,AL ;浠ヤ笂涓哄啓(HKZK88)
NOP
MOV DX,Z8279
MOV AL,0C2H
OUT DX,AL ;緗絀篎IFO瀵勫瓨鍣
MOV CL,00H ;鏀
WAIIT:
NOP
IN AL,DX
MOV BL,AL
AND AL,80H
CMP AL,80H
JE WAIIT ;FIFO姝e湪娓呴櫎鏈熼棿鍒欒煩杞絳夊緟
MOV AL,BL
AND AL,0FH
CMP AL,00H
JE WAIIT ;鏃犻敭鎸変笅鍒欑瓑寰
CMP CL,02H
JE OUTPUT
NEXT: MOV AL,40H ;鍐 璇籉IFO RAM鍛戒護瀛
OUT DX,AL
MOV DX,D8279 ;璇誨叆FIFO RAM鍐呭
IN AL,DX
NOP
CMP AL,3bH
JE FINI
;鏌ヨ〃,灝嗛敭鐮佹斁鍏AL涓
LEA BX,LED
XLAT
MOV DX,D8279 ;灝咥L涓鍐呭瑰啓鍒版暟鐮佺′笂
OUT DX,AL
MOV DX,Z8279 ;娓匜IFO RAM瀵勫瓨鍣
MOV AL,0C2H
OUT DX,AL
inc cl
and cl,07h
JMP WAIIT ;絳夊緟涓嬩竴嬈¢敭杈撳叆
FINI:MOV DX,Z8279
MOV AL,0D3H
OUT DX,AL
JMP $
LED DB 07H,66H,06H,3FH
DB 00H,00H,00H,00H
DB 7FH,6DH,5BH,71H
DB 00H,00H,00H,00H
DB 00H,00H,00H,00H
DB 00H,00H,00H,00H
DB 00H,00H,00H,00H
DB 00H,00H,00H,00H
DB 6FH,7DH,4FH,79H
DB 00H,00H,00H,00H
DB 77H,7CH,39H,5EH
DB 00H,00H,00H,00H
DB 00H,00H,00H,00H
DB 00H,00H,00H,00H
DB 00H,00H,00H,00H
DB 00H,00H,00H,00H
output: ;鏀
push dx
push ax
mov dx,d8279
mov al,7fh ;8
out dx,al
mov dx,d8279
mov al,7fh ;8
oUt dx,al
inc cl
inc cl
pop ax
pop dx
jmp next
CODE ENDS
END START
㈡ 璇烽棶涓涓猭eil 璋冭瘯鍜宲rotues 鐨勯棶棰樸 鏁扮爜綆★紝鎸夐敭錛8279錛孋51 ,C璇璦
鏄鏍規嵁a15-a8錛宎7-a0鐨勮繛鎺ョ畻鍑烘潵鐨勶紝
浣跨敤8279鐨勬椂鍊欙紝cs鑴氳佷負0錛屽叾浣欑殑涓1錛屽氨鑳介夋嫨8279鑺鐗囷紝鐒跺悗cmd 鍦板潃 鍜宒at鍦板潃鏄鏍規嵁閾炬帴cmd綆¤剼鐨勭數騫沖喅瀹氱殑錛屾牴鎹浣犵殑鍦板潃搴旇ユ槸a8涓1琛ㄧず鍛戒護錛宎8涓0琛ㄧず鏁版嵁錛屽緢綆鍗曠殑銆傜湅鐪嬩功涓錛屾湁寰堣︾粏鐨勮茶В銆