EASy68K
http://easy68k.com/EASy68Kforum/

C on the 68k and integrating assembly routines for I/O
http://easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1670
Page 1 of 1

Author:  ClovisComet [ Tue Apr 09, 2019 5:54 pm ]
Post subject:  C on the 68k and integrating assembly routines for I/O

Last year I built a simple 68k single board computer with a serial interface and wrote a simple monitor program for it using assembly in Easy68k. It has 512k each of RAM and ROM.

I'd like to be able to compile C for it, so I've been doing some reading online and I was able to build GCC as a cross-compiler for m68k-elf.

So, theoretically I can now compile C for the 68k, but I'll probably need to use some of my assembly routines for things like serial I/O and initializing the UART, right? stdio.h is going to be useless here. What's the best way to go about this?

I thought I could take some of the assembly I wrote in Easy68k and use the GNU assembler to produce object code that I'd be able to link alongside C-generated object files, but the GNU assembler has some major issues with my code. Any of the EQU lines at the start it takes issue with. Any instruction that has a label is considered invalid. And most of my inline comments cause problems, too.

Is it probably just a syntax issue, or would it be better for me approach this differently? I looks like maybe it's also possible to issue assembly instructions directly from inside a C program; is that a better idea? I've also read a little online about "newlib" which seems like it might be helpful, but I just thought I'd ask here to see if anyone could point me in the right direction.

Thanks for any insight you are able to share.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/