Discussion:
How to declare program entry point with NASM?
(too old to reply)
Ayushi Jain
2020-09-18 05:41:45 UTC
Permalink
However, when writing 16 bit DOS code, I can't figure out how to
indicate the program entry point. You use End ProcName with MASM
and TASM, but NASM doesn't accept this and I can't find any mention
of it in the docs.
*blush* You're absolutely right - I had omitted to put it in the
documentation. The feature is in there, though, and I now quote the
extra paragraph that will be added to the OBJ-format section of the
-------------------------------------------------------------------
If the module you're writing is intended to contain the program
entry point, you can declare this by defining the special label
`..start' at the start point, either as a label or by EQU (although
of course the normal caveats about EQU dependency still apply).
-------------------------------------------------------------------
No worries mate. I've written docs before and I know that they're the
most painful, time consuming, *boring* part of writing a program. I'm just
lucky that in my current job my boss likes (!?) to do the docs for my
programs - welll I'm not going to stop him!
Thanks for the help, anyway...
/----------------------------------------------------------------------\
[Hitman/Code HQ - 6502/68000/80386 & now 65816 (16 bit 6502!) ]
[Assembly Lover since 1987! A bit of C, but don't tell anyone... :-) ]
[OS coding/Hardware hitting/Demos/Games/Modules - c64, Amiga & PC ]
[I'm a pogrammar.. I'm a programor... I'm a progemmar... I write code. ]
\----------------------------------------------------------------------/
Pls tell how to declare ..start? Not mentioned clearly in the documentation
Frank Kotler
2020-09-18 21:20:01 UTC
Permalink
\----------------------------------------------------------------------/
Post by Ayushi Jain
Pls tell how to declare ..start? Not mentioned clearly in the documentation
You've been wondering about this since 1996? Wow!

Depends on the OS and Nasm's output format. In "-f obj" (omf).(a
somewhat obsolete format) just "..start". More often,
global _start
section .text
_start:

Or maybe "WinMain"...

You may need to tell the linker about it.

The documentation has improved since 1996! http:/nasm.us
Frank Kotler
2020-09-18 22:48:53 UTC
Permalink
Post by Frank Kotler
The documentation has improved since 1996! http:/nasm.us
Sorry. Better link...

https://www.nasm.us/docs/2.14rc0/nasmdoc7.html#s

Best,
Frank

Loading...