实验九
本帖最后由 zyk524 于 2020-10-30 22:22 编辑assume cs:codseg,ds:dataseg,ss:stackseg
dataseg segment
db 'welcome to masm!';偏移地址为0-15,间隔1
dataseg ends
stackseg segment
dw 0
stackseg ends
codseg segment
start: mov ax,dataseg
mov ds,ax
mov ax,stackseg
mov ss,ax
mov cx,16
mov bx,0
s: mov al,
mov ah,2
push ax ;第一行
mov ah,36
push ax ;第二行
mov ah,113
push ax ;第三行
inc bx
loop s ;需写入的数据入栈
mov ax,0b800H
mov ds,ax
mov cx,16
mov bx,93
s1: mov di,77FH ;第一行
pop
mov di,81FH ;第二行
pop
mov di,8BFH ;第三行
pop
;add bx,2
dec bx
dec bx
loop s1 ;开始写入数据
mov ax,4c00h
int 21h
codseg ends
end start
实验九,我的代码如下
大家可以参考一下 我傻了。。。。两个语句没区别。。。 应该用DEC 本帖最后由 zyk524 于 2020-10-30 22:17 编辑
assume cs:codseg,ds:dataseg,ss:stackseg
dataseg segment
db 'welcome to masm!';偏移地址为0-15,间隔1
dataseg ends
stackseg segment
dw 0
stackseg ends
codseg segment
start: mov ax,dataseg
mov ds,ax
mov ax,stackseg
mov ss,ax
mov cx,16
mov bx,0
s: mov al,
mov ah,2
push ax
mov ah,36
push ax
mov ah,113
push ax
inc bx
loop s
mov ax,0b800H
mov ds,ax
mov cx,16
mov bx,93
s1: mov di,77FH
pop
mov di,81FH
pop
mov di,8BFH
pop
;add bx,2
dec bx
dec bx
loop s1
mov ax,4c00h
int 21h
codseg ends
end start
正确代码如下 assume cs:code,ds:data
data segment
db 'welcome to masm!';可以用字符(我当时挨个查的ascll码)
db 0ah,0ach,71h;16开头
data ends
code segment
start: mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax
mov si,0
mov di,0
mov dx,3
s1:mov bx,0
mov cx,16
s: mov al,
mov ah,
mov es:,ax
inc bx
add di,2
loop s
add di,128
inc si
dec dx
mov cx,dx
jcxz s2
jmpshort s1
s2:mov ax,4c00H
int 21h
code ends
end start
页:
[1]