【发布时间】:2017-02-15 07:16:50
【问题描述】:
我在汇编中编写了一个简单的“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
错误:无法汇编代码。缺少此汇编代码的一个或多个支持文件。
【问题讨论】:
-
"windows.inc" 可能来自 MASM32,在 16 位代码中无法与 TASM 一起使用。