GENERAL DESCRIPTION
The PPC2C® translator is a software tool that will convert existing Power, PowerPC, Power 601, Power 603 assembly programs to "C". The powerful PPC2C® translator accepts PowerPC programs, checks their syntax and outputs C code. The comments are moved transparently from the source file to the target file. Any built-in functions for math, string manipulation and I/O in PowerPC are converted to calls to external procedures (see sample translation) .
The PPC2C® translator contains a syntax analyzer, a PowerPC to tertiary converter, and a tertiary to "C converter. The syntax analyzer scans the PowerPC input file for syntactic errors and generates a listing file of the PowerPC program. Any syntactic errors will be flagged with detailed English messages in the listing file. If no errors are encountered, the PowerPC input file is converted to tertiary language. Then the tertiary file is checked and, if no errors are detected, it is converted to "C". A command line control is provided to allow translation with errors in the source file. This is helpful when translating code fragments that are not complete programs.
The translation of the PowerPC source language into an intermediate tertiary language ensures the logical equivalence between the source and target languages. This sophisticated tertiary language, which is common to our entire family of translators, allows complex mapping from source language to the target. The tertiary language is automatically converted to "C" while maintaining the logical equivalence between the output "C" program and the input PowerPC program.
The "C" output file will be generated in
- Compact and portable K&R C
- Standard ANSI C code
as selected by a command line option.
PowerPC DIRECTIVES: END INCLUDE MASK2 OFFSET ORG SECTION EQU FEQU REG SET COMLINE DC DCB FAIL FOPT FORMAT NOFORMAT LIST NOLIST NOL LLEN NOOBJ OPT PAGE NOPAGE SPC TTL IDNT XDEF XREF
PowerPC RESERVED WORDS:
A AD AO AOD ABCD
ABS ABSD ABSO ABSOD
ADD ADDO ADDD ADDOD
ADDC ADDCO ADDCD ADDCOD
ADDE ADDEO ADDED ADDEOD
ADDI ADDIC ADDICD
ADDIS
ADDZE ADDZED ADDZEO ADDZEOD
ADDME ADDMED ADDMEO ADDMEOD
AE AED AEO AEOD AI AID AD
AME AMED AMEO AMEOD
AND ANDD ANDC ANDCD ANDI ANDID ANDIS ANDISD ANDIL ANDILD ANDISU ANDISUD
B BA BL BLA
BC BCA BCC BCCL BCL BCLA
BCCTR BCCTRL
BCLR BCLRL BCR BCRL
CAX CAXD CAXO CAXOD
CLCS CLF CLI
CMP CMPI CMPL CMPLI
CNTLZ CNTLZd CNTLZD CNTLZDD CNTLZW CNTLZWD
CRAND CRANDC CREQV CRNAND CRNOR CROR CRORC CRXOR
DCBF DCBI DCBST DCBT DCBTST DCBZ DCLST
DIV DIVd DIVO DIVOd
DIVD DIVDd DIVDO DIVDOd
DIVDU DIVDUd DIVDUO DIVDUOd
DIVS DIVSd DIVSO DIVSOd
DIVW DIVWd DIVWO DIVWOd
DIVWU DIVWUd DIVWUO DIVWUOd
DOZ DOZD DOZO DOZOD DOZI
ECIWX ECOWX EIEIO EXTSW EXTSWD
EQV EQVD EXTSB EXTSBD EXTSH EXTSHD EXTS EXTSD
FA FAD FADDS FADDSD
FABS FABSD FADD FADDD
FCFID FCFIDD
FCMPO FCMPU FCIR FCIRD FCIRZ FCIRZD
FCTID FCTIDD
FCTIDZ FCTIDZD
FCTIW FCTIWD
FCTIWZ FCTIWZD
FD FDD FDIV FDIVD FDIVS FDIVSD
FM FMD FMA FMAD FMADD FMADDD FMADDS FMADDSD
FMR FMRD
FMS FMSD
FMSUB FMSUBD FMSUBS FMSUBSD
FNABS FNABSD
FNEG FNEGD
FNMA FNMAD FNMADD FNMADDD FNMADDS FNMADDSD
FNMS FNMSD FNMSUB FNMSUBD FNMSUBS FNMSUBSD
FRES FRESD
FRSP FRSPD
FRSQRTE FRSQRTED
FS FSD
FSEL FSELD
FSQRT FSQRTD
FSQRTS FSQRTSD
FSUB FSUBD FSUBS FSUBSD
ICS ICBI ISYNC
LBZ LBZU LBZUX LBZX
LD LDARX LDU LDUX LDX
LFD LFDU LFDUX LFDX LFQ LFQU LFQUX LFQX LFS LFSU LFSUX LFSX
LHA LHAU LHAUX LHAX LHBRX LHZ LHZU LHZUX LHZX>
LM LMW
LQ
LSCBX LSCBXD LSI LSWI LSWX LSX LU LUX
LWA LWARX LWAUX LWAX LWBRX LWZ LWZU LWZUX LWZX LX
MASKG MASKGD MASKIR MASKIRD
MCRF MCRFS MCRXR
MFCR MFFS MFFSD MFMSR MFOCRF MFSPR MFSR MFSRI MFSRIN
MTCRF MTFSB0 MTFSB0D MTFSB1 MTFSB1D MTFSF MTFSFD MTFSFI MTFSFID MTOCRF
MTMSR MTSPR MTSR MTSRI MTSRIN
MUL MULD MULO MULOD MULI
MULS MULSD MULSO MULSOD
MULHD MULHDD MULHDU MULHDUD
MULHW MULHWD MULHWU MULHWUD
MULLD MULLDD MULLDO MULLDOD
MULLI MULLW MULLWD MULLWO MULLWOD
NABS NABSD NABSO NABSOD NAND NANDD
NEG NEGD NEGO NEGOD NOR NORD
OR ORD ORC ORCD ORI ORIL ORIU ORID ORIS
RAC RACD
RFI RFID RFSVC
RLDCL RLDCLD RLDCR RLDCRD RLDIC RLDICD RLDICL RLDICLD RLDICR RLDICRD
RLDIMI RLDIMID
RLMI RLMID
RLWIMI RLWIMID RLWINM RLWINMD RLWNM RLWNMD
RRIB RRIBD
SC SCV
SI SID
SLD SLDD SLE SLED SLEQ SLEQD SLIQ SLIQD
SLLIQ SLLIQD SLLQ SLLQD SLQ SLQD SLW SLWD
SRAD SRADD SRADI SRADID
SRAIQ SRAIQD SRAQ SRAQD SRAW SRAWD
SRAWI SRAWID SRD SRDD SRE SRED SREA SREAD SREQ SREQD
SRIQ SRIQD SRLIO SRLIOD SRLQ SRLQD SRQ SRQD SRW SRWD
STB STBU STBUX STBX
STD STDCX STDCXD STDU STDUX STDX
STFD STFDU STFDUX STFDX
STFIWX
STFQ STFQU STFQUX STFQX
STFS STFSU STFSUX STFSX
STH STHBRX STHU STHUX STHX
STMW
STQ
STSWI STSWX
STW STWBRX STWCX STWCXD STWU STWUX STWX
SUBF SUBFD SUBFO SUBFOD
SUBFC SUBFCD SUBFCO SUBFCOD
SUBFE SUBFED SUBFEO SUBFEOD
SUBFIC
SUBFME SUBFMED SUBFMEO SUBFMEOD
SUBFZE SUBFZED SUBFZEO SUBFZEOD
SVC SVCL
SYNC
TD TDI
TLBIE TLBLD TLBLI TLBSYNC
TW TWI
XOR XORD XORI XORIL XORIU XORIS
Registers
DR0 DR1 DR2 DR3 DR4 DR5 DR6 DR7
AR0 AR1 AR2 AR3 AR4 AR5 AR6 AR7
RR0 RR1 RR2 RR3 RR4 RR5 RR6 RR7 RR8 RR9 RR10 RR11 RR12 RR13 RR14 RR15
PC SR USP CCR SSP
|