• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Assembly Language Question

Status
Not open for further replies.

Jeggyman

New Member
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/pictutorial/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.
 

e

New Member
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
 

Jeggyman

New Member
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.
 

Exo

Active Member
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
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top