The code does alot of IO port operations. Keil uses SFR and SBIT declarations whereas the AVR code uses defines to set IO port locations and byte operations to set/clear/test bits. There has to be a better way than slogging through the text conversion and then slogging through the debug???
before you port the code, you need to understand how it relates to the underlying hardware.
Keil SFR and SBIT relate directly to the 8051 hardware - you're going to have to determine how the existing code relates to the AVR hardware, how that can be translated to 8051 hardware, and how that, in turn can be represented in software.
If minimizing code change is the priority, then you could continue to use #defines to reference the I/O port addresses, and byte operations to set bits. The 8051 provides byte-wide access to the I/O bits via the port SFR addresses (0x80, 0x90, etc). The bit operations are more efficient, but it's not the only way to set bits in a port.
View all questions in Keil forum