I recently work with Cygnal's uC and use uVision or Silabs IDE to write code. I find a firmware of a device that I want to study more deeply but the firmware is in BIN format that I can easily convert in HEX. But I don't know how to convert it in ASM format and more preferably in C. I used the disassembler D51 to get ASM format from HEX but there are variables like rb0r4,rb2r1,acc etc. that the compiler doesn't recognize.
There is barely any '51 assembler which does not recognize ACC... Or you forgot to include a header file with the standard SFRs definition, if such is required.
Also you can include an another definition file, defining the directly addressed registers, e.g.
rb0r4 equ 04h
rb2r1 equ 11h
etc.
But those memory locations are most probably used as variables, so you are better off using the control file of d52 to define "legible" names for these memory locations, according to their function in the mentioned code.
Finally, although some sort of formal translation into C is definitively possible (formally it is possible to translate from any language into any other language), it is impossible to recover the original structure of the high level language, so it would have no real meaning... It is much better to study the asm version.
Please don't feel offended but you perhaps need to do some basic '51 asm reading.
org 0abh the following code will be translated from address 0abh on
;
ljmp X043f ; 00ab 02 04 3f ..? long jump to label X043f (at address 043fh)
;
X00ae: mov t3,#0deh ; 00ae 75 ff de u.^ mov to SFR t3 (at address 0FFh) immediate value 0deh - the function of this SFR depends on the particular '51 derivative you are using (and it's name might be different, not t3), this is not a standard '52 SFR
mov t3,#0adh ; 00b1 75 ff ad u.-see above
mov 0b1h,#67h ; 00b4 75 b1 67 u1gmov to SFR at address B1h immediate value 67h - again, the meaning of this SFR depends on your '51 derivative
X00b7: mov a,0b1h ; 00b7 e5 b1 e1 read value from SFR at address 0B1h into accumulator
jnb acc.7,X00b7 ; 00b9 30 e7 fb 0g{if bit 7 of accumulator is zero, jump to label X00b7 (in other words, the last 2 lines mean: loop until bit 7 of SFR 0B1 gets set)
clr a ; 00bc e4 d clear accumulator (set to 0)
mov r7,a ; 00bd ff .move content of accumulator into register r7
mov r7,a ; 00be fe ~ditto
Of course, this might be (and most likely is - based on the weird content) a piece of data, table or something similar - that's exactly the "meaning" which cannot be reconstructed into the "high level" automatically...