How can I compile/assemble an am186 microcontroller file? I've looked for its assembler/linker/C compiler but I haven=92t found any. I'm looking for a standalone assembler/c compiler.
compiler/assembler for am186 microcontroller
Nov 19, 2008
12 Replies
x86 GCC and binutils
Programmeren in Almere?
E-mail naar nico@nctdevpuntnl (punt=.)
Did you try Avocet? I would be surprised if they didn't have one. (Cross-compiler and/or native).
Try:
formatting link
-mpm
Many tanks for your helps. Yes I know that since the am186 is compatible with 8086 I can use Turbo C/GCC but what i am wonder is relocation of code and data.
What do you mean by relocation of code and data? With GCC + binutils you can write your own startup in assembler (of find one that does what you need), use a linker description file to put code and data anywhere you want in the memory map and finally use objcopy to convert the ELF object file into a hex file which can be programmed into flash.
Where did you get that attitude problem?
I would like to have one too!
Those devices only poorly support code relocation. Study the programming model some more. Learn the function and use of the base registers and the address arithmetic.
Many thanks I think I have got what to do Best regards
How do I make ELF object file? It seems that gcc doesn=92t support ELF format. When I tried to read ELF file I=92ve got the following error. What shall I do?
C:\\DevTools\\mingw\\bin>type test1.c
int main() { while(1); return 0; }
C:\\DevTools\\mingw\\bin>gcc -elf -c test1.c
C:\\DevTools\\mingw\\bin>readelf -h test1.o readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
FWIW what you did works here, but then elf is the default here.
try gcc -Wa,--help -c test1.c
that'll bring up the assember help which should explain how to ask it to produce ELF (if the version you have can)
then do try gcc -Wa,WHATEVER -c test1.c replacing WHATEVER with the option you were given,
AFAIK the default MINGW gcc compiler does not pricude 80186 code, you need the 8086 version for that... ,
Thank you for the information. The =96Wa switch passes comma-separated on to the assembler but it seems that the assembler doesn=92t support ELF too. I looked for a dos version of gcc that supports ELF so much but I have fount any. Support for 80186 is the next problem. Turbo C has an option that force it to generate 8086 code but it doesn=92t have any option for generating ELF object file, Now I don=92t know what to do for relocation and how to place code in am186 flash memory. I=92m wondering why AMD doesn=92t have any solution for this problem.
you might have to build your own from the source. (not something I've tried)
turbo-c will produce microsoft object files, with the right stub you should be able to produce an EXE that after application of exe2bin will be a binary image suited to your target address, as for how to write the stub, I'm not sure.
once upon a time 8086 compilers were as common as dirt.
This is something that has to deal with the linker. So read the manual of ld (the GNU linker).
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
"If it doesn\'t fit, use a bigger hammer!"
--------------------------------------------------------------
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required