www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2008/01/14/11:45:43

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Mon, 14 Jan 2008 17:40:17 +0100
From: linus <linus AT yahoo DOT com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gcc as a linker....
References: <478b3603$0$36444$4fafbaef AT reader5 DOT news DOT tin DOT it> <fmfik2$fvr$1 AT aioe DOT org>
In-Reply-To: <fmfik2$fvr$1@aioe.org>
Lines: 46
Message-ID: <478b90c9$0$4787$4fafbaef@reader4.news.tin.it>
Organization: TIN.IT (http://www.tin.it)
X-Comments: Please send technical notifications to newsmaster AT tin DOT it
NNTP-Posting-Host: 79.19.46.238
X-Trace: 1200328905 reader4.news.tin.it 4787 79.19.46.238:10031
X-Complaints-To: Please send abuse reports to abuse AT retail DOT telecomitalia DOT it
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

 >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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019