Tony, Nick, and Don, I'm fairly `intimate' with the former Parallax assembler and it's current incarnation; CVASM from TDE. First, forget about SPASM as it's now CVASM with additional features. If you have SPASM code, (heh, I can hear the comments coming in ;-), it will work fine with CVASM. While I don't have time to translate entire source files, I'll be glad to help in the process. When I refer to CVASM below, I'm also referring to SPASM and the Parallax syntax unless otherwise noted. Please bear with me as I'm trying to respond to several messages on this topic. You can Download CVASM v5.6 from TDE's site at: http://www.tech-tools.com/ In the docs, you will find a complete description of the Microchip code generated by CVASM instructions. However, there is a text file which is kind of the `Rosetta stone' of converting between the two syntax. If you have a copy of SPASM or early CVASM, it's in the "readme.txt" file. I still have a copy. Note, a new feature with CVASM v5.6 is ability to get a symbol dump using; cvasm /l /d. If you just want a device symbol dump, create a source file with only the device header. I was hoping to get this included into CVASM's docs. We had a discussion here on this subject a few months ago with TDE's Jerry Merrill and others. At the time, they were going to update their documentation to include the older file and a few other things but apparently that hasn't been released yet [Jerry?]. You can search the archives for the subject; "CVASM16". Since the docs already describe the equivalent Microchip code and cover CVASM's directives as well as radix syntax, I'll focus on some other basic issues. It's important to note that CVASM allows you to define Bit variables (again, this goes back to SPASM). The most common problem would be definition of STATUS register Bits. The same applies to port Bits and user-defined registers. For example, the STATUS register is defined as: STATUS = 03h C = STATUS.0 DC = STATUS.1 Z = STATUS.2 etc... Where the STATUS flag Bits are actually variables. A simple example would be clearing the CARRY bit (Note, CVASM also includes a CLC instruction and MPASM has a CLRC macro): CVASM: Microchip/MPASM: CLRB C BCF 3,0 or... BCF STATUS,0 or... BCF STATUS,C Another issue is the use of LCALL. In CVASM (and SPASM of course), you can LCALL to any page and, provided you follow with an LSET $, you don't have to worry about page bits. The assembler takes care of this. Depending on the device, LCALL does zero to two BCF/BSF instructions followed by a CALL. LSET $ does zero to two BCF/BSF instructions and points to the next instruction. Again, let me know if I can help. I noticed an issue related to a MOVB instruction which I'll reply to in another message. The following is a `snippet' from the earlier discussion I was talking about. Though we were focusing on converting MPASM to CVASM, it may be of help. - Tom X-------------------------------------------------------------------------- I wrote: 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 At 08:50 AM 9/7/99 +1000, Tony Nixon wrote: >Nick Taylor wrote: >> >> Hello Don, >> Thanks for the very prompt response! I've downloaded and unzipped >> ParaPic ... and it works great .... just what I wanted. > >> Don McKenzie wrote: > >> Getting the odd error ....[snip] > >Wow, someone using it. > >The main reason for the errors was an ommission by me. I didn't realise >that Parallax has predefined variables. eg z is short for staus,z. ra0 >is short for porta,0 etc. > >I'm in the process of building a symbol table, but it still may create >the odd error. I doubt if it will ever be totally error free, but what >is ;-) > >I hope to post the new file today some time. > >PS. Don, I worked on your 'button.src' last night and figured out why it >gave errors. It is fixed now. (yawn!! sorry - late night. Actually Ive >been looking at a monitor for so long now, I think my eyes are taking on >the same square shape of the girl? in the Sony ad) > >-- >Best regards > >Tony > >http://www.picnpoke.com >Email sales@picnpoke.com ------------------------------------------------------------------------ Tom Handley New Age Communications Since '75 before "New Age" and no one around here is waiting for UFOs ;-)