Hi, I agree. However, a short remark. Instead of SZ JMP Label1 one could write JNZ Label1 Imre On Sat, 15 May 1999, Tom Handley wrote: > Bob, when Jerry brought this up the first thing that came to mind is > yacc/lex. I've been away from UNIX for several years. Can you give me a > pointer to the generic C code? I'm sure I can track it down but if you have > a preference (you mentioned GPASM), I'd appreciate it. > > I'm not committing to this but I want to revisit the subject. I wasn't > considering a `code converter', rather a `syntax modifier'. Consider an > example where BIT2 is moved to BIT1 in register UBits. Then the Z flag is > tested and a jump to Label1 occurs if False. Otherwise, the register Data is > compared to the literal Limit and a jump to Label2 occurs if Data is above > or equal to Limit. This provides a good idea of both the differences in > syntax and the overall compatibility of MPASM and CVASM. > > A `code converter' would do the following: > > MPASM: CVASM: > ------------------------------------------------------------------ > Data EQU 0x20 Data = 20h > UBits EQU 0x21 UBITS = 21h > BIT1 EQU 1 BIT1 = UBits.1 > BIT2 EQU 2 BIT2 = UBits.2 > Limit EQU B'01010101' Limit = 01010101b > > > BTFSS UBits,BIT2 MOVB BIT1,BIT2 > BCF UBits,BIT1 > BTFSC UBits,BIT2 > BSF UBits,BIT1 > BTFSS STATUS,Z SZ > GOTO Label1 JMP Label1 > MOVLW Limit CJAE Data,#Limit,Label2 > SUBWF Data,W > BTFSC STATUS,C > GOTO Label2 > > A `syntax modifier' would do the following: > > MPASM: CVASM Compatible: > ------------------------------------------------------------------ > Data EQU 0x20 Data EQU 20h > UBits EQU 0x21 UBits EQU 21h > BIT1 EQU 1 BIT1 EQU 1 > BIT2 EQU 2 BIT2 EQU 2 > Limit EQU B'01010101' Limit EQU 01010101b > > BTFSS UBits,BIT2 BTFSS UBits,BIT2 > BCF UBits,BIT1 BCF UBits,BIT1 > BTFSC UBits,BIT2 BTFSC UBits,BIT2 > BSF UBits,BIT1 BSF UBits,BIT1 > BTFSS STATUS,Z BTFSS STATUS,2 > GOTO Label1 GOTO Label1 > MOVLW Limit MOVLW Limit > SUBWF Data,W SUBWF Data,W > BTFSC STATUS,C BTFSC STATUS,0 > GOTO Label2 GOTO Label2 > > Even a `syntax modifier' would still be a challenge as you have to deal > with MPASM's directives and conditionals as well as the macros, radix, etc. > Normally, converting from MPASM to CVASM is fairly easy for most example > code from Microchip and the public domain. > > - Tom > > At 03:31 PM 5/14/99 -0400, Bob Drzyzgula wrote: > >Although the inclusion of macro/conditional capability inside > >CVASM would be the best solution -- then you could use > >the macros for the Paralax mnemonics as well -- perhaps a > >good start on a translator utility might be had by > >using the yacc/lex parsing engine in gpasm...? Just a > >thought. > > > >--Bob > >============================================================ > >Bob Drzyzgula It's not a problem > >bob@drzyzgula.org until something bad happens > >============================================================ > >