Thanks, will use your inputs on updating the code further (SBIT macro, etc) and upload them on the forum. Thanks so much for your expertise. In the meantime, here is the earlier 'working' code which is organized in directories and compiled with the makefile provided.
Hi Maarten, Your recommendations were spot on. I made the changes to sfr address specification as suggested and got SDCC to compile and link the files as intended. I am attaching the working code for the blinking LED in this post. This tests only the GPIO functions for now, and minor changes may be required to make the other modules to work. I will upload them later, as and when they get tested. For now the main.c along with the 'driver' files provided by Megawin (and modified for use with SDCC)...
The source of the startup files (meant for Keil compiler ; runs fine with Keil) is Megawin website. http://www.megawin.com.tw/en-global/support/index/72/194 So REG_MG82F6D17.h (and the other files) was originally from Megawin supplied source code for LED blink program (but for Keil compiler). I made all the changes necessary from the Keil version (available from their website) to the recommendations made in SDCC manual about sfr, asm, etc. So each of the files in the zip file I attached are changed...
Thanks for your prompt reply. After running makefile, I get the following messages on the console. $ make sdcc -c main.c -I. --model-large sdcc -c MG82F6D17_IAP_DRV.c -I. --model-large sdcc -c MG82F6D17_COMMON_DRV.c -I. --model-large sdcc -c MG82F6D17_INTERRUPT.c -I. --model-large sdcc -c MG82F6D17_WIZARD.c -I. --model-large sdcc main.rel MG82F6D17_IAP_DRV.rel MG82F6D17_COMMON_DRV.rel \ MG82F6D17_INTERRUPT.rel MG82F6D17_WIZARD.rel --xram-loc 0x00 --xram-size 0x2FF --data-loc 0x30 --code-size 0x3FFF...
Help with porting from Keil to SDCC for Megawin microcontrollers