Keil-C51-C-to-SDCC-C-Converter
Keil-C51-C-to-SDCC-C-Converter copied to clipboard
Can this convert header from keil to sdcc?
Keil has a header called intrins.h. I want to convert this keil file to the format of sdcc, and use the function in it. I tried many ways but none of the worked.
Here's the header:
/*--------------------------------------------------------------------------
INTRINS.H
Intrinsic functions for C51.
Copyright (c) 1988-2004 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/
#ifndef __INTRINS_H__
#define __INTRINS_H__
extern void _nop_ (void);
extern bit _testbit_ (bit);
extern unsigned char _cror_ (unsigned char, unsigned char);
extern unsigned int _iror_ (unsigned int, unsigned char);
extern unsigned long _lror_ (unsigned long, unsigned char);
extern unsigned char _crol_ (unsigned char, unsigned char);
extern unsigned int _irol_ (unsigned int, unsigned char);
extern unsigned long _lrol_ (unsigned long, unsigned char);
extern unsigned char _chkfloat_(float);
extern void _push_ (unsigned char _sfr);
extern void _pop_ (unsigned char _sfr);
#endif
Any suggestion? Thanks a lot!
I tried your tool, but it seems don't work for me.
Hi. Currently, this tool can be mainly used to convert application-level code and header files of some MCUs.
However, intrins.h is a header file related to compilers, while Keil's compiler is different from SDCC, so you might convert it manually.
I found two pages that may offer some help for you:
- https://hackaday.io/project/170540-adventures-with-a-stc89c52-development-board/log/177065-notes-on-converting-keil-8051-c-to-sdcc-c
- https://www.mydigit.cn/thread-59752-1-1.html (in Chinese)
First of all, thank you for your time. I've read all these posts already. But honestly I don't konw how to do it since I'm not a professional guy. The SDCC Compiler User Guide is no easy to read too. I met a new problem yesterday. The printf() function. I think I'm gonna use keil instead if I can't conquer this trouble today. It's too hard for some aspect for a newbee.