Help with asm: include and compilling

  • Thread starter bleeker
  • Start date
In summary, you need to use the INCLUDE keyword and the absolute address of the file or that you want to include.
  • #1
bleeker
13
0
I just want to know what exactley must I write in the 'include'. Can I just write #include <P16F84A.INC> or must I write the whole directory path of the file?
And what does it mean when MPASMWIN desplay errors: 7?
I have even tried downloading programs in .asm for a PIC and compilling it but it still desplay errors: 7
 
Technology news on Phys.org
  • #2
For microsoft's assembler (ML or MASM), the syntax is

include example.inc
 
  • #3
If you investigate the Help section of MPLAB, you'll find (if you dig deep enough) a list of the error codes generated by the assembler.

I don't have MPLAB on this pc so I can't help much more than that.
 
  • #4
The other thing that springs to mind is that there's a load of template files in a subdirectory of MPLAB.

They're found in a directory something like "C:\MPLAB\template\code"

If you have a look around using windows explorer, you'll find them.

There's a template in there that is intended for use with the PIC16F84A... copy that to where ever your work is, & have a good look at it... it should assemble without any errors.
 
  • #5
bleeker said:
I just want to know what exactley must I write in the 'include'. Can I just write #include <P16F84A.INC> or must I write the whole directory path of the file?
And what does it mean when MPASMWIN desplay errors: 7?
I have even tried downloading programs in .asm for a PIC and compilling it but it still desplay errors: 7

You use the INCLUDE keyword and the absolute address of the file or that you want to include for example.

INCLUDE c:\masm615\include\lib32.inc

Im assuming that you are using masm.
 
  • #6
From that f84temp.asm template file I mentioned above:

Code:
	list      p=16F84             ; list directive to define processor
	#include <p16F84.inc>         ; processor specific variable definitions
 

1. What is the purpose of including "asm" in a programming language?

The "asm" keyword in a programming language is used to indicate that the following code is written in assembly language. This allows programmers to write low-level code for specific hardware instructions or for performance optimization.

2. How do I include assembly code in my program?

To include assembly code in your program, you need to use the "asm" keyword followed by the assembly code. This code can be written inline within a programming language or in a separate assembly file that is linked to the main program.

3. What is the process of compiling assembly code?

Compiling assembly code involves using an assembler program, which translates the assembly code into machine code that can be executed by the computer's processor. This process may also involve linking the assembly code with other parts of the program to create an executable file.

4. Can I mix assembly code with other programming languages?

Yes, it is possible to mix assembly code with other programming languages. This is known as inline assembly and allows programmers to combine the efficiency of assembly language with the higher-level constructs of other programming languages.

5. Are there any alternative ways to optimize code without using assembly?

Yes, there are alternative ways to optimize code without using assembly. Higher-level programming languages often have built-in optimization techniques, and there are also tools and libraries available for performance tuning. However, assembly language can still be a useful tool for fine-tuning critical sections of code for maximum efficiency.

Similar threads

  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
2
Views
372
  • Programming and Computer Science
Replies
29
Views
2K
  • Programming and Computer Science
Replies
14
Views
2K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
5
Views
996
  • Programming and Computer Science
Replies
2
Views
301
  • Programming and Computer Science
Replies
27
Views
4K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
3
Replies
70
Views
3K
Back
Top