汇编实验16
assume cs:codecode segment
start:
mov ax,cs
mov ds,ax
mov ax,0
mov es,ax
mov si,offset int7
mov di,200h
mov cx,offset int7chend-offset int7
cld
rep movsb
cli
mov word ptr es:,200H
mov word ptr es:,0
sti
mov ax,4c00h
int 21h
org 200h
int7:
jmp int71
table dw sub1,sub2,sub3,sub4
int71:
push bx
cmp ah,3
ja int72
mov bl,ah
add bx,bx
call word ptr table
int72:
pop bx
iret
sub1:
push cx
push es
push bx
mov cx,2000
mov bx,0b800h
mov es,bx
mov bx,0
sub1s: mov byte ptr es:,' '
add bx,2
loop sub1s
pop bx
pop es
pop cx
ret
sub2:
push cx
push bx
push es
mov cx,2000
mov bx,0b800h
mov es,bx
mov bx,1
sub2s: and byte ptr es:,11111000b
or byte ptr es:,al
add bx,2
loop sub2s
pop es
pop bx
pop cx
ret
sub3:
push cx
push bx
push es
mov cx,2000
mov bx,0b800h
mov es,bx
mov bx,1
sub3s: and byte ptr es:,10001111b
shl al,1
shl al,1
shl al,1
shl al,1
or byte ptr es:,al
add bx,2
loop sub3s
pop es
pop bx
pop cx
ret
sub4:
push cx
push bx
push es
push ds
push di
push si
mov bx,0b800h
mov es,bx
mov ds,bx
mov si,160
mov di,0
mov cx,24
cld
sub4s:push cx
mov cx,160
rep movsb
pop cx
loop sub4s
mov cx,80
mov bx,0
sub4s1: mov byte ptr es:,' ';
add bx,2
loop sub4s1
pop si
pop di
pop ds
pop es
pop bx
pop cx
ret
int7chend:
nop
code ends
end start
页:
[1]