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.

PIC assembly language help

Status
Not open for further replies.

yohanevindra

Newbie level 5
Joined
Aug 20, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Australia
Activity points
1,349
I have a few questions about assembly language with PIC. Is there is a commonly used number you can define it like in C like this

VARIABLE EQU 100

But then to assign a memory location to a variable you use something similar

VARIABLE EQU 0x200

Does this mean you can assign a variable the value 100 and then assign another variable the memory location 0x100?But by default with the PIC isnt 100 = 0x100?

How do you allocate memory locations with PIC in assembly?

Also anyone know of any crash courses/tutorials in PIC18?
 

The 'EQU' simply means the name on the left is associated with the number on the right, it doesn't reserve or define memory at all. This means you can use it as a reference to a memory location or you can use it as a constant or even as part of a math calculation.

For example:
myvalue EQU 0x100

means wherever you use 'myvalue' in the program, 0x100 will be used in its place. So if you used the instruction 'mowvf myvalue' the content of W would be stored at location 0x100, if you used 'addlw myvalue' you would add 0x100 to W.

0x100 is defined as hexadecimal 100, it might be the same as plain 100 depending on the radix you have chosen. I think in MPLAB, it would be interpreted as 100 decimal by default but your assembler may be different.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top