21,458
社区成员
发帖
与我相关
我的任务
分享
assume cs:code
stack segment
db 128 dup (0)
stack ends
code segment
start: mov ax,stack
mov ss,ax
mov sp,128
mov ax,0b800h
mov es,ax
mov ah,'a'
s: mov es:[160*12+40*2],ah ;display for a moment
call delay
inc ah
cmp ah,'z'
jna s
mov ax,4c00h
int 21h
delay: push ax ;delay for a moment
push dx
mov dx,2000h
mov ax,0
s1: sub ax,1
sbb dx,0
cmp ax,0
jne s1
cmp dx,0
jne s1
pop dx
pop ax
ret
code ends
end start
assume cs:code
data segment
db ' / / : : ','$' ;18 bytes
db 9,8,7,4,2,0 ;6 bytes
db 0,3,6,9,12,15 ;6 bytes
data ends
code segment
start: mov ax,data
mov ds,ax
mov si,18
mov cx,6
s: push cx
mov al,[si]
out 70h,al
in al,71h
mov ah,al
mov cl,4
shr ah,cl
and al,0fh
add ah,30h
add al,30h
mov bl,[si+6]
mov bh,0
mov [bx],ah
mov [bx+1],al
inc si
pop cx
loop s
mov ah,2 ;10h的2号子程序,置光标
mov bh,0 ;第0页
mov dh,12 ;行号
mov dl,35;列号
int 10h
mov ax,data
mov ds,ax
mov dx,0 ;ds:dx指向字符串
mov ah,9 ;int 21h 的9号子程序
int 21h
mov ax,4c00h
int 21h
code ends
end start