Mail Archives: djgpp/2008/01/14/11:45:43
>I'm assuming that the code below is hello.asm and you've assembled
with NASM
>like so:
>nasm -f coff -o hello.obj hello.asm
I had compiled with nasm -f win32 hello.asm
Nasm confuses me a lot ..among linux ,dos 16 and 32,windows...
I've Win XP .............
then -f win32 should be the right option....why not ?
I shouldn't complicate my "assembly" life....I'd like to have a short
assembly code for Windows ...( no metter if with or without Dos call)...
just to see something working !
To see if nasm and gcc can work together...
Many thanks.
PS- your code below gets >>>
C:\> nasm -f bin -o hello.com hello.asm
pass = 1 (1,1,1)
hello.asm:18: error: label or instruction expected at start of line
...I've added a lot of labels ( _label ) but ....
; nasm -f bin -o hello.com hello.asm
BITS 16
ORG 0x100
SECTION .text ; code section
push cs
pop ds ; offset portion of pointer to string
mov dx, msg ; segment portion of pointer to string
mov ah,09h ; write string command to int 21 hex
int 0x21 ; interrupt 21 hex, call DOS
mov al,0 ; exit code, 0=normal
mov ah,4ch ; exit command to kernel
int 0x21 ; interrupt 21 hex, call DOS
msg: db "Hello World",13,10,'$' ; the string to print, 10=cr, 13=lf,
$=terminator
- Raw text -