Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
Thread Tools Display Modes
Old 30th January 2004, 08:14 PM   (permalink)
Default Assembly Language Question

I am trying to teach myself assembly language and I have a found a helpful and informative tutorial online to do so. However, I have run into a problem while using the tutorial. As an additional learning tool to supplement the tutorial I downloaded PIC IDE Simulator in order to use the Interactive Assembler Editor to help me get the feel for assembly language. However, one of the commands I have learned in the tutorial is not in the Assembly Editor. Specifically the command "equ". In the tutorial it is used to set Labels and other variables equal to values in registers such as the following:

STATUS equ 03h

According to the tutorial this would set register 03h as the address of the "STATUS" label. So my question is, what's the problem? Is equ not a real command in assembly, or is there something wrong with the Interactive Assembler Editor that comes with PIC IDE Simulator? I am reluctant to continue with current tutorial I am using if it is going to teach me incorrect commands, if somone could please enlighten me as to what the problem is I would greatly appreciate it. Here is the address for the tutorial I am using. http://www.mstracey.btinternet.co.uk...l/progtut1.htm Also if anyone knows of any good websites or books that teach Assembly language I would love to hear of them. I am just starting out in circuitry and electronics and I thought learning assembly would be a good place to start. So if you also know of any good websites or books for beginner circuitry instruction or PIC microchip tutorials I would be very thankful.
Jeggyman is offline  
Reply With Quote
Old 30th January 2004, 08:28 PM   (permalink)
Default

EQU is not actualy an assembly command it is an assembler directive, the assembler changes it for you it is extreamly useful since it makes the code much easier to understand/debug. It is like writing all your code with names like "status" then doing a search and replace with the number value for the text.

So with that directive every time the assembler sees the word "status" it will replace it with 0x03
e is offline  
Reply With Quote
Old 30th January 2004, 08:40 PM   (permalink)
Default

So why isn't the equ directive listed in the Interactive Assembler Editor? Presumedly there would still be a way for me to define labels in the same way as equ but I don't see equ listed anywhere. Furthermore when I try to use equ by manually typing out the code it highlights it as an error.
Jeggyman is offline  
Reply With Quote
Old 30th January 2004, 09:06 PM   (permalink)
Default

get MPLAB IDE from microchips's website (www.microchip.com). It also contains a simulator and is much better then the site you're learning from now...

To be honest, the site you gave looks like bad tutorial to me. All registers like STATUS, etc are already defined in a standard include file wich comes with MPASM. -> P16F84.INC. And it includes such a file for every pic...

There are other things on that tutorial wich make it more difficult then it has to be, for example using 0 and 1 to define the place where a result needs to be stored in stead of W or F
Exo is offline  
Reply With Quote
Old 30th January 2004, 09:32 PM   (permalink)
Default

Do you know of where I could find a better tutorial then the one I am currently using?
Jeggyman is offline  
Reply With Quote
Old 30th January 2004, 09:47 PM   (permalink)
Default

Nigel's tutorials was my starting place for pic's
http://www.winpicprog.co.uk/pic_tutorial.htm

And defenately get MPLAB IDE from microchip's website, It's a must-have.
Exo is offline  
Reply With Quote
Old 30th January 2004, 09:53 PM   (permalink)
Default

Thanks for the help, I'll check out MPLAB and that tutorial.
Jeggyman is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 07:30 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.