?
Solved

Could not assemble hello.asm

Posted on 2003-02-23
2
Medium Priority
?
516 Views
Last Modified: 2008-02-26
i got this .asm file "hello.asm":

segment dseg
msg:    db      'Hello, Dear World$'

segment sseg stack
        resb 0x40

segment cseg
..start:
        mov     ax, dseg
        mov     ds, ax
        mov     dx, msg
        mov     ah, 0x09
        int     0x21
        mov     ah, 0x4C
        int     0x21

the problem is that i was unable to properly compile it with NASM, im pretty sure there is nothing wrong with the code, its just that i couldn't figure how to use NASM

it yields this:
C:\NASM\NASM HELLO.ASM
hello.asm:1: segment name `dseg' not recognised
hello.asm:4: segment name `sseg' not recognised
hello.asm:7: segment name `cseg' not recognised
hello.asm:8: unrecognised special symbol `..start'

0
Comment
Question by:x25
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
dimitry earned 1200 total points
ID: 8005773
You need to do next thing:
  NASM.EXE -fobj hello.asm
To create hello.obj
Then you need to create exe with the help of linker.
I used TLINK hello.obj and it created HELLO.EXE that prints "Hello, Dear ..."
0
 

Author Comment

by:x25
ID: 8005971
thanks a lot, that really assembled.
i still have more question though, plz check back soon.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
Hey fellow admins! This time, I have a little fairy tale for you. As many tales do, it starts boring and then gets pretty gory. I hope you like it. TL;DR: It is about an important security matter, you should read it if you run or administer Windows …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question