Hello world in 32 bits DOS assembly

238 views Asked by At

I'm trying to get started in 32 bits DOS assembly programming. I've started with a simple "hello, world" program that runs great in 16 bits mode (taken from Turbo Assembler manual), and just added a couple of directives:

.386
.model flat, stdcall
.stack 100h
.data
msg DB 'hello, world',13,10,'$'
.code
start:
mov ax,@data
mov ds,ax
mov ah,9
mov dx,OFFSET msg
int 21h
mov ah,4ch
int 21h
END start

I then compiled it with Open Watcom 2, but can't get it to run:

C:\>wcl386 hello
...
HELLO.ASM: 15 lines, 0 warnings, 0 errors
...
creating a DOS/4G executable

C:\>hello
...
DOS/4GW fatal error (1313): can't resolve external references

I understand that a lot of things are wrong in my setup, but I need something working before I dive into the DPMI spec. What are the minimal changes I need to make in the code and in the command line to get something started?

0

There are 0 answers