Maker Pro
Maker Pro

compiler/assembler for am186 microcontroller

How can I compile/assemble an am186 microcontroller file? I've looked
for its assembler/linker/C compiler but I haven’t found any.
I'm looking for a standalone assembler/c compiler.
 
N

Nico Coesel

Jan 1, 1970
0
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.

x86 GCC and binutils
 
How can I compile/assemble an am186 microcontroller file? I've looked
for its assembler/linker/C compiler but I haven’t found any.
I'm looking for a standalone assembler/c compiler.

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.
 
N

Nico Coesel

Jan 1, 1970
0
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.
 
J

JosephKK

Jan 1, 1970
0
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.

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.
 
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.


How do I make ELF object file? It seems that gcc doesn’t support ELF
format. When I tried to read ELF file I’ve 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
 
J

Jasen Betts

Jan 1, 1970
0
How do I make ELF object file? It seems that gcc doesn’t support ELF
format. When I tried to read ELF file I’ve got the following error.
What shall I do?

FWIW what you did works here, but then elf is the default here.
C:\DevTools\mingw\bin>gcc -elf -c test1.c

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...
,
 
J

jghasemi

Jan 1, 1970
0
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...
,


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...
,
 
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 –Wa switch passes comma-separated <options> on to the assembler
but it seems that the assembler doesn’t 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’t have any option for
generating ELF object file,
Now I don’t know what to do for relocation and how to place code in
am186 flash memory.
I’m wondering why AMD doesn’t have any solution for this problem.
 
J

Jasen Betts

Jan 1, 1970
0
Thank you for the information.
The –Wa switch passes comma-separated <options> on to the assembler
but it seems that the assembler doesn’t support ELF too.
I looked for a dos version of gcc that supports ELF so much but I have
fount any.

you might have to build your own from the source. (not something I've tried)
Support for 80186 is the next problem. Turbo C has an option that
force it to generate 8086 code but it doesn’t have any option for
generating ELF object file,
Now I don’t know what to do for relocation and how to place code in
am186 flash memory.

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.
I’m wondering why AMD doesn’t have any solution for this problem.

once upon a time 8086 compilers were as common as dirt.
 
N

Nico Coesel

Jan 1, 1970
0
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?

This is something that has to deal with the linker. So read the manual
of ld (the GNU linker).
 
Top