實驗十:心型跑馬燈
實驗器材:
參照實驗一
實驗電路:
源程序:
;author:liuxianfei0810
stack segment
dw 10 dup(?)
stack ends
;author:liuxianfei0810
code segment
assume ss:stack
;author:liuxianfei0810
START:
mov ax,stack
mov ss,ax
mov sp,800;程序設定
;author:liuxianfei0810
mov BX,0aaaaH
L: mov DX,030H
in AL,DX
test AL,1
jz M
not BX
N: mov AX,BX
mov DX,030H
out DX,AX
;author:liuxianfei0810
PUSH BX
;author:liuxianfei0810
;delay:
; mov cx,02h
; loop delay
MOV BX,0001H
mov cx,0fh
;author:liuxianfei0810
E: mov AX,BX
mov DX,030H
out DX,AX
ROL BX,1;循環左移
LOOP E;CX!=0
;author:liuxianfei0810
M: mov BX,0ffffh
mov AX,BX
mov DX,030H
out DX,AX
;author:liuxianfei0810
; POP BX
;M: mov AX,BX
; mov DX,030H
; out DX,AX
;author:liuxianfei0810
POP BX
jmp L
code ends
end START
仿真視頻:
《微機原理接口與技術》(8086彙編)期末考試、考研常見考題、習題,題型彙總、知識點總結、專周(二十)