MVI A,0C3h ;xoa hien thi va xoa FIFO.
STA CntI79
MVI A,01h ;tri hoan 0.1 ms > 160 us.
CALL DELAY
MVI A,90h ;bat dau ghi vao tai LED dau tien ben phai, co STA CntI79 ;tang dia chi tu dong. STA CntI79 ;tang dia chi tu dong.
MVI A,31h ;cho hien thi "R".
STA DataI79
MVI A,79h ;cho hien thi "E".
STA DataI79
MVI A,77h ;cho hien thi "A".
STA DataI79
MVI A,5Eh ;cho hien thi "D".
STA DataI79
MVI A,6Eh ;cho hien thi "Y".
STA DataI79
POP PSW
RET
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;Chuo ng trinh con hien thi "SENDING" tren bay LED 7 doan.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SENDING:POP PSW SENDING:POP PSW
MVI A,10h ;khoi tao 8279: hien thi 8 ki tu,loi vao phai, STA CntI79 ;quet ban phim co lap ma, khoa ngoai 2 phim. STA CntI79 ;quet ban phim co lap ma, khoa ngoai 2 phim. MVI A,3Eh ;lap trinh xung Clock = 100 KHz.
STA CntI79
MVI A,0C3h ;xoa hien thi va xoa FIFO.
STA CntI79
MVI A,01h ;tri hoan 0.1 ms > 160 us.
CALL DELAY
MVI A,90h ;bat dau ghi vao tai LED dau tien ben phai, co STA CntI79 ;tang dia chi tu dong. STA CntI79 ;tang dia chi tu dong.
MVI A,6Dh ;cho hien thi "S".
STA DataI79
MVI A,79h ;cho hien thi "E".
STA DataI79
STA DataI79
MVI A,5Eh ;cho hien thi "D".
STA DataI79
MVI A,06h ;cho hien thi "I".
STA DataI79
MVI A,37h ;cho hien thi "N".
STA DataI79
MVI A,6Fh ;cho hien thi "G".
STA DataI79
POP PSW
RET
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;Chuo ng trinh con xu li du lieu: Chuong trinh nay se nhan dia chi bat
;dau va dia chi cham dut cua vung du lieu, cac ma may cua chuong trinh ;tren may tinh do xuong se duoc dat trong pham vi vung nay.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PROCESS:MOV A,C ;kiem tra xem co phai day la byte thu nhat PROCESS:MOV A,C ;kiem tra xem co phai day la byte thu nhat ;khong ?
CPI 00h
JNZ A1
MOV H,B ;neu dung thi cat byte thu nhat vao thanh ghi H. INR C ;tang bien dem byte dia chi len 1 don vi.
RET
A1: MOV A,C ;kiem tra xem co phai day la byte thu hai khong ?
CPI 01h
JNZ A2
MOV L,B ;neu dung thi cat byte thu hai vao thanh ghi L. INR C ;tang bien dem byte dia chi len 1 don vi. RET
A2: MOV A,C ;kiem tra xem co phai day la byte thu ba khong ?
CPI 02h
JNZ A3
MOV D,B ;neu dung thi cat byte thu ba vao thanh ghi D. INR C ;tang bien dem byte dia chi len 1 don vi. RET
A3: MOV A,C ;kiem tra xem day co phai la byte thu tu khong ?
CPI 03h
JNZ A4
MOV E,B ;neu dung thi cat byte thu tu vao thanh ghi E. INR C ;tang bien dem byte dia chi len 1 don vi. RET
A4: MOV M,B ;ke tu byte thu nam tro di se duoc cat vao o nho co INX H ;dia chi do cap thanh ghi HL quan li.
MOV A,D
CPI H
RNZ
MOV A,E
CMP L
RNZ ;thoat neu HL tro den dia chi cham dut nam trong DE. CALL END ;cho hien thi "END." tren ba LED 7 doan.