Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I need help with CVASM directives ?

Status
Not open for further replies.

dustie

Newbie level 6
Joined
Oct 2, 2009
Messages
11
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Macedonia
Activity points
1,354
Hi, I'm beginner in programming PICs. I found a code written in CVASM 16, and I want to translate it in MPASM, but i have trouble with the following statements:

(example) :

flag ds 1 ; DIRECTIVE - defines amount of free space

:wr movf value,w ; this is a LOCAL LABEL

Question : how to translate the directive " ds " into MPASM language, and what to do with the local label ?

Thanks.
 

Hi,

Have not seen CVASM before but it looks like you just need to define the two variables, - might be wrong though..

So Flag DS 1 is replaced by

; define user variables

cblock 0x20 (or what ever address your chips ram starts at )

flag
value

end
 

Thanks WP 100,

I guess you are right. I'll try to learn the assembler the best I can, probably will find the answer. :D
 

Hi,

Perhaps if you post all of that CVASM code we can more easily see how to convert it to Microchip assembler - its a bit difficult just seeing the odd instruction in isolation, unless someone else who is familiar with both assemblers can help.
 

Hi,

below is the link for the web page where you can find the code (on the bottom of the page). This code is for read/write data from/to SD card, using PIC16F819. In fact, I am a begginer in PIC programming and my boss told me to design a SD card reader/writer with pic. So, I wanted to find on the net any schematics with codes and I found this :

http://mondo-technology.com/sdcard.htm

I found that some of the directives in this assembly code are for TechTools, not from Microchip. But I am not sure about the assembler instructions, are they from Microchip, or CVASM.

Anyway, thanks a lot for the help. Check this code, and if you can give me any suggestions it would be a great help for me.
Thanks in advance once more.
 

Hi,

Well thats quite an interesting project, as its the first Sd card in assembler I have seen.

To say it was written in 2008 I wonder why it was published using that dos based assember ?

Have just copied the code into mplab and corrected the basic things like config, device and variables etc but it still shows hundreds of errors.

If you are just starting to learn assembler I would not think trying to correct all that code is the way to go.

You will have to modify almost every line of code for some reason or other.
Before going to all that trouble I would build the circuit first and program the hex code supplied to see it if actually works
Most sd card programs utilise some form of file system but this seems to just write direct, so I would think that will limit how useful it is over say a standard spi eeprom chip. ( spi and eeprom chips are well documented in assembler on the microchip site )

If you do want to run a sd card then this project does work as I have built it myself, I know nothing as such about C but all the project code is free and works fine, including the glcd 128x64
The only problem is the lcd is 3x16 and you really need that exact EA module for most experiments to work.
**broken link removed**
 

Thanks guys,

thanks a lot for your help.

Changing "ds" with "res" looks OK, but still I think it would be necessary to write a brand new code.
I don't know how yet :) but I guess I'll find out :D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top