主题:C++3.0加汇编问题,帮忙看看啦!!!
int main()
{
_asm
{
assume cs:code,ds:data
data segment
db 'welcome to masm!'
data ends
code segment
start: mov ax,data
mov ds,ax
mov bx,0
mov cx,16
mov ax,0B872h
mov es,ax
mov si,0
mov ah,01110001B
s: mov al,ds:[bx]
mov es:[si],al
mov es:[si+1],ah
inc bx
add si,2
loop s
mov ax,4C00H
int 21H
code ends
end start
}
return 0;
}
masm可以只要去掉了C++的一些代码,可到C++上就编译不通过啦(4个错误)。大家看看改一下
{
_asm
{
assume cs:code,ds:data
data segment
db 'welcome to masm!'
data ends
code segment
start: mov ax,data
mov ds,ax
mov bx,0
mov cx,16
mov ax,0B872h
mov es,ax
mov si,0
mov ah,01110001B
s: mov al,ds:[bx]
mov es:[si],al
mov es:[si+1],ah
inc bx
add si,2
loop s
mov ax,4C00H
int 21H
code ends
end start
}
return 0;
}
masm可以只要去掉了C++的一些代码,可到C++上就编译不通过啦(4个错误)。大家看看改一下