nhan t de quay 45*
.model small
.stack 100
.data
ten_bai:
db "nhan T de dong co quay thuan 45 do$"
.code
main proc
mov ax,@data
mov ds,ax
lea dx,ten_bai
mov ah,9
int 21h
nhap:
mov ah,1 ;cho phep nhap ktu tu ban phim
int 21h
cmp al,"T" ;so sanh voi T
jne nhap
mov cx,6 ;6,25x4x1.8=45 bien dat
mov dx,378h
lap_vong:
mov al,00000001b ;buoc 1
out dx,al
call delay
mov al,00000010b ;buoc 2
out dx,al
call delay
mov al,00000100b ;buoc 3
out dx,al
call delay
mov al,00001000b ;buoc 4
out dx,al
call delay
loop lap_vong
mov al,00000001b ;buoc cuoi
out dx,al
call delay
dung:
mov al,0
out dx,al
jmp nhap
main endp
delay:
push cx
mov cx,01h
lap:
push cx
mov cx,01h
loop $
pop cx
loop lap
pop cx
Bạn đang đọc truyện trên: TruyenTop.Vip