我用汇编语言编写了一个简单的"Hello world“程序,我想在其中包含一个.inc文件。该怎么做呢?
include "windows.inc"
IDEAL
MODEL small
STACK 100h
DATASEG
HelloMessage DB 'Hello, world',13,10,'$'
CODESEG
start:
mov ax,@data
mov ds,ax ;set DS to point to the data segment
mov ah,9 ;DOS print string function
mov dx,OFFSET HelloMessage ;point to "Hello, world"
int 21h ;display "Hello, world"
exit:
mov ah,4ch ;DOS terminate program function
int 21h ;terminate the program
END start错误:无法汇编代码。缺少此程序集代码的一个或多个支持文件。
发布于 2017-02-15 15:25:02
试试这个:
.386
.model flat, stdcall
include user32.inc
include kernel32.inc
include WINDOWS.INC
.data
MsgBoxCaption db "Win32 app",0
MsgBoxText db "Hi User!",0
.code
start:
invoke MessageBox, NULL, ADDR MsgBoxText, ADDR MsgBoxCaption, MB_OK
invoke ExitProcess, NULL
end starthttps://stackoverflow.com/questions/42242903
复制相似问题