Is there a library available that will allow me to write console programs in NASM that will assemble under either Linux or Windows without changing the source-code of my program but just by setting a directive?
Sure - C. In 32-bit code, this isn't much of a problem. You'd have to change "main" (Linux) to "_main" (Windows) - Nasm has a command-line option which will do this. Also "strncasecmp" to "strnicmp" - probably a few others. In 64-bit code, there's a completely different ABI. The NASMX macros will go a long way towards smoothing out these differences.
I know that HLA has a library like this, but wondered if anything was available for NASM.
Strictly speaking, HLA has two libraries (maybe 3). You can call the HLA library from Nasm code - requires some "extra" code to meet the expectations of HLA (structured exception handling). HLA generates this code "behind your back". I've managed to do this - not in a very "portable" way, and not recently. I don't know if it will still work or not. I don't see much point in this - the C library is more widely ported, more extensive, and more thoroughly tested...
Is there a repository of publicly available NASM code somewhere that would have libraries such as this?
The NASMX package is probably the closest thing to this, although it isn't strictly speaking a library. It's a set of macros and include files which will allow you to write portable code - between Linux and Windows and even between 32- and 64-bits.
I tried to get on the NASM mailing list and I posted the above question there, but it never showed up. I've never received any emails from that mailing list. Did the moderators block my question and/or ban me from the mailing list? Is there any way for me to find out my status?
That's my fault. Sorry, Hugh! Mail is being sent to an account I can't currently log into. There has been so little traffic on that list lately that I haven't been concerned about it. I'll see if I can get it straightened out...
Also, btw, is there a version of NASM retargeted for the ARM?
There's a project on SourceForge called "Narm". I don't know if it's in useable shape or not. I haven't heard anything about it... so probably not.
Does NASM support incremental assembly? I already asked this question on comp.lang.asm.x86 and was told "no," but I though I would ask it here as well.
http://groups.google.com/group/comp.lang.asm.x86/browse_thread/thread/e54f416e32cd1a75
Sorry, I kinda dropped the ball on our conversation there. A snowstorm took the power out for several days, and when I got back on line, things had moved on. You gave an example something like this:
code flag ( n -- flag ) ok
ebx ebx or 0<> if -1 # ebx mov then ok
ret end-code ok
9 flag . -1 ok
0 flag . 0 ok
see flag
46E89F EBX EBX OR 09DB
46E8A1 46E8A8 JZ 7405
46E8A3 -1 # EBX MOV BBFFFFFFFF
46E8A8 RET C3 ok
Seems to me you'd need an editor (and a disassembler) integrated with your assembler to get a result like this. Nasm would assemble a "partial" file - provided that all the symbols were defined... which they normally wouldn't be. If we define "increment" to be something like...
ebx ebx or 0<> if -1 # ebx mov then ok
... where the "target" of the jump is known, so the number 5 could be plugged in, Nasm would assemble the resulting few lines of code as an "increment", but the few lines of code would have to be generated first. I don't know if this would be practical in the general case. It would be a function of your compiler, not something Nasm knows how to do. So I'd still have to say "no", although perhaps Nasm could be integrated into an editor/compiler/assembler(Nasm) that would do something like that.
I'll see if I can get back to our discussion on c.l.a.x. - there are some aspects of RosAsm that might interest you, in spite of it being "dead" for all practical purposes...
Best,
Frank