汇编实验12
转不过来呀!assumecs:code
code segment
start:mov ax,cs
mov ds,ax
mov si,offset do0
mov ax,0
mov es,ax
mov di,200h
mov cx,offset do0end - offset do0
cld
rep movsb
mov ax,0
mov es,ax
mov word ptr es:,200h
mov word ptr es:,0
mov ax,4c00h
int 21h
do0: jmp short do0start
db 'welcome to masm!'
do0start: mov ax,cs
mov ds,ax
mov si,202h ;si为什么是202h,它的段地址是哪里?如果段地址是0,那么前两步的mov ax,cs可否改为mov ax,0
mov ax,0b800h
mov es,ax
mov di,12*160+2*36
mov cx,16
s: mov al,
mov es:,al
inc si
add di,2
loop s
mov ax,4c00h
int 21h
do0end: nop
code ends
end start
本帖最后由 jackz007 于 2022-3-18 13:02 编辑
王爽误人子弟,不要随便往内存低地址写东西进去,因为那里属于操作系统的地盘,搞不好,会导致死机。要养成好习惯,如果需要内存,就在自己的代码中开辟,不管使用什么操作系统,无论使用什么编程语言,永远都不能侵占属于别人的存储空间,哪怕是一个字节!这是不可逾越的原则和底线。
assumecs:code , ds:data
data segment para public 'DATA'
msga db 'welcome to masm!'
msgb equ $
msgc db 200h dup(00)
data ends
stack segment para stack
db 800h dup(00)
stack ends
code segment para public 'CODE'
main proc far
mov ax,DATA
mov ds,ax
mov es,ax
mov si,offset msga
mov di,offset msgc
mov cx, msgb - offset msga
push cx
cld
rep movsb
mov ax,0b800h
mov es,ax
mov di,12*160+2*36
mov si,offset msgc
pop cx
do_0: lodsb
stosb
mov al,03
stosb
loop do_0
xor ax,ax
int 16h
mov ax,04c00h
int 21h
main endp
code ends
end main
页:
[1]