From: zak100 <zul...@ya...> - 2009-06-25 14:09:05
|
Hi, I have acted on Frank's advice and downloaded the nasm assembler. I have also downloaded the Linker Lnk563. I have tried to compile a simple program which I got from internet but I faced prob. in execution. section .data hello: db 'Hello world!',10 ; 'Hello world!' plus a linefeed character helloLen: equ $-hello ; Length of the 'Hello world!' string ; (I'll explain soon) section .text global _start _start: mov eax,4 ; The system call for write (sys_write) mov ebx,1 ; File descriptor 1 - standard output mov ecx,hello ; Put the offset of hello in ecx mov edx,helloLen ; helloLen is a constant, so we don't need to say ; mov edx,[helloLen] to get it's actual value int 80h ; Call the kernel mov eax,1 ; The system call for exit (sys_exit) mov ebx,0 ; Exit with return code of 0 (no error) int 80h The compiling went fine: D:\NASMPR~1>nasm -f elf nasm1.asm D:\NASMPR~1> But linking failed. D:\NASMPR~1>Link nasm1.o Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994 Copyright (C) Microsoft Corp 1984-1993. All rights reserved. Run File [nasm1.exe]: dir List File [nul.map]: nasm1.o : fatal error L1023: terminated by user D:\NASMPR~1>Link nasm1.o Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994 Copyright (C) Microsoft Corp 1984-1993. All rights reserved. Run File [nasm1.exe]: List File [nul.map]: Libraries [.lib]: Definitions File [nul.def]: nasm1.o : fatal error L1101: invalid object module Object file offset: 1 Record type: 7f D:\NASMPR~1> Zulfi. Frank Kotler-3 wrote: > > zak100 wrote: > > Hi, > > I have downloaded the file as86-0.16.17.tar. After extracting, I > found lots > > of c programs and header file along with some other files. Can > somebody help > > me and let me know, how to compile using as86? > > > > Zulfi. > > Hi Zulfi, > > As hpa has pointed out, this isn't "on topic" for the nasm-devel list. > I've "transfered" you to the nasm-users list. It isn't on topic here, > either, but we're really desperate for traffic. :) I reject "help for > the fat and limp" every day, and I'd *really* like to approve a message > once in a while! > > The easy answer to your question is: type "make install". If that > results in a cascade of error messages instead of installing a86, tell > us what it says... maybe we can help, maybe not... > > You'll probably(?) want ld86 also - part of the "bin86" package, > apparently. "make install" should work for that, too (it says in the > glossy brochure). (both as86 and ld86 already exist on my system - > elderly Slackware Linux - try just typing "as86" and see what happens) > > Now I've got a question for you. Why in hell do you *want* to use > as86??? It is quite "obsolete", AFAIK. I guess ELKS uses it still(?). I > think it was required to build the Linux bootsector, long ago. I see > references to as86 in "coreboot"... dunno what that is... > > If you've got some code intended for as86 - probably a bootsector? - and > would like to "port" it to Nasm, we can probably help with that. (would > be "on topic", even!) That might be easier than messing with as86/ld86, > depending on what you're trying to do. > > Whatever you're trying to do, good luck with it! Let us know how it goes. > > Best, > Frank > > > ------------------------------------------------------------------------------ > _______________________________________________ > Nasm-users mailing list > Nas...@li... > https://lists.sourceforge.net/lists/listinfo/nasm-users > > -- View this message in context: http://www.nabble.com/compiling-with-as86-tp24198376p24203329.html Sent from the nasm-users mailing list archive at Nabble.com. |