From: "M. Schulter" Newsgroups: comp.os.msdos.djgpp Subject: hello.s, anyone? Date: 23 Sep 1997 06:03:37 GMT Organization: Value Net Internetwork Services Inc. Lines: 58 Message-ID: <607m3p$805$3@vnetnews.value.net> NNTP-Posting-Host: value.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, there. This message concerns a quest that some may find challenging, some humorous, and some rather dubious: the road to a standalone hello.s that can compile with gcc -Wall -g -o hello.exe hello.s and produce a program that will run successfully on a variety of DPMI servers, including DJGPP's own and very distinguished CWSDPMI. The whole question of standalone GAS programming is a FAQ soon to be answered in the assembly tutorial taking shape as part of the DJGPP User's Guide on DJ's site. In the meantime... Does anyone have ideas on how best to write standalone GAS programs that will comply with the DPMI standard? Has anyone done it who would be willing to talk about it or even post a program that will run with CWSDPMI (something I haven't been able to find in a number of searches of DJGPP-related material)? Over a year ago, strider7 posted the program that got me started with actual standalone GAS coding -- it works with QDPMI, but, as people here explained, calls real mode interrupts in a very user-friendly but less-DPMI-friendly way that causes problems with some other DPMI servers. One solution would be to write an interrupt handler that complies with DPMI. Another, possibly, would be a Linux-style approach that calls C functions like _printf or _puts from within a GAS file, rather like the output from a hello.c with `gcc hello.c -S'. Could this be done in DJGPP? I notice that hello.c produces an .exe about 20K longer than one of my hello.s programs with QDPMI-permitted interrupts, and wonder if stdio.h is making the difference. Is it possible to 'call ___main' within a handcoded hello.s? In short, maybe this might be a soon-to-be-a-FAQ, given that the next installment of the DJGPP User's Guide on GAS programming is pending -- but I'd be curious to see simple, not so simple, or even obfuscated solutions to the enigma of a standalone hello.s (or hello.S -- preprocessor not excluded). Any ideas? Most appreciatively Margo Schulter mschulter AT value DOT net (To reply, please remove the extra . in my default address)