n2zee 发表于 2012-3-15 11:28:31

实验131,2题记录

assume cs:code
data segment
db "welcome to masm!",0
data ends
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset do7c
mov ax,0
mov es,ax
mov di,200h
mov cx,offset do7cend - offset do7c
cld
rep movsb
mov ax,0
mov ds,ax
mov word ptr ds:,200h
mov word ptr ds:,0
jmp short start1
do7c:
push ax
push bx
push si
push dx

s:
mov ah,2
mov bh,0
int 10h
mov al,byte ptr ds:
mov cl,al
jcxz ok
mov ah,9
mov bl,7
mov bh,0
mov cx,1
int 10h
inc si
inc dl
jmp short s
ok:
pop dx
pop si
pop bx
pop ax
iret

do7cend:nop
start1:
mov dh,10
mov dl,10
mov cl,2
mov ax,data
mov ds,ax
mov si,0
int 7ch

mov ax,4c00h
int 21h

code ends
end start

n2zee 发表于 2012-3-15 11:29:58

第2课题
assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset do7c
mov ax,0
mov es,ax
mov di,200h
mov cx,offset do7cend - offset do7c
rep movsb
mov ax,0
mov ds,ax
mov word ptr ds:,200h
mov word ptr ds:,0
jmp short start1
do7c:

push bp
mov bp,sp
dec cx
je ok
add ,bx
ok:
pop bp
iret

do7cend:nop

start1:mov ax,0b800h
mov es,ax
mov di,160*12
mov bx,offset s - offset se
mov cx,80
s:mov byte ptr es:,'!'
add di,2
int 7ch
se:nop
mov ax,4c00h
int 21h
code ends
end start
页: [1]
查看完整版本: 实验131,2题记录