21,459
社区成员
发帖
与我相关
我的任务
分享
data segment
clear db 0dh,0ah,24h
data ends
sta segment stack
dw 40h dup(?)
top label word
sta ends
code segment
assume cs:code,ds:data,es:data,ss:sta
output proc far
push dx
push ax
push cx
cmp ah,0d1h
je twoopt
;cmp ah,0d2h
;je 8opt
;cmp ah,0d3h
;je 10opt
;cmp ah,0d4h
;je i10opt
;cmp ah,0d5h
;je 16opt
int 6fh
je retr
twoopt:mov cx,16
twolp:ror bx,1
mov dx,bx
and dx,1
add dx,30h
mov ah,2
int 6fh
loop twolp
pop cx
pop ax
pop dx
retr:Ret
output endp
main proc far
mov ax,data
mov ds,ax
mov ax,sta
mov ss,ax
lea sp,top
mov ah,35h
mov al,21h
int 21h
mov ax,es
mov ds,ax
mov dx,bx
mov ah,25h
mov al,6fh
int 21h
lea dx,output
mov ax,code
mov ds,ax
mov ah,25h
mov al,6eh
int 6fh
mov bx,11100011b
mov ah,0d1h
int 21h
mov ah,4ch
int 6fh
main endp
code ends
end main
assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset do0 ;设置ds:si指向源地址
mov ax,0
mov es,ax
mov di,200h ;设置es:di指向源地址
mov cx,offset do0end - offset do0 ;设置cx为传输长度
cld ;设置传输方向为正
rep movsb
;mov ax,0
;mov es,ax
mov word ptr es:[0*4],200h ;设置中断向量的入口地址的偏移地址
mov word ptr es:[0*4+2],0 ;设置中断向量的入口地址的段地址
mov ax,0f000h
mov dx,22d
mov cx,10d
div cx ;此4句是为了做个溢出的除法
mov ax,4c00h
int 21h
do0: jmp short do0start
db "aaaaaa error!"
do0start:
mov ax,cs
mov ds,ax
mov si,202h ;设置ds:si指向字符串
mov ax,0B800h
mov es,ax
mov di,12*0A0h+2*32 ;设置es:di指向显存空间的中间位置
mov cx,13d ;设置字符串长度
s: mov al,[si]
mov es:[di],al
inc si
add di,2
loop s
mov ax,4c00h
int 21h
do0end: nop
code ends
end start