|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: simple MPLAB quest
Hey,
Thanks for the answers. Thing is that I do not use C at all. I do everything in Assembler. Is there a way to do this with asm? Do you know of any simple sample code for me to look at.. found some PIC USB protocol that had multiple asm files but it was quite a hassle to go thrugh. I know how to program C, so I have tried a lot of ways with the #include statement but I get errors, so i figured i was on the wrong path.. Again, any further help is much much appreciated. Be good. Per |
|
#2
|
|||||
|
|||||
|
Re: simple MPLAB quest
Quote:
In C, I believe the include statements are; #include "file.h" I'm not 100% sure, I've been doingmore mechanical stuff recently (but like to keep in touch with my good friend C). you could check the code on kevinwatson.org to see some examples. EDIT: I got your post completely backwards, I thought you meant you needed to do it in C. Hmmm, 99% of the time I have a syntax problem or don't know how to code something, I google it and it usualy comes up. try; assembly programming include or something like that. |
|
#3
|
||||
|
||||
|
Re: simple MPLAB quest
try
Code:
LINK yourfile.asm |
|
#4
|
|||
|
|||
|
Re: simple MPLAB quest
I have googled alot..
The "LINK" command does not seams to work.. Maybe I should post some code here to clarify things: My first file: agraal08.asm ;************************************************* * list p=16f819 ; list directive to define processor #include <p16F819.inc> ; processor specific variable definition #include <test.asm> errorlevel -302 ; suppress message 302 from list file __CONFIG _CP_OFF & _WRT_ENABLE_OFF & _CPD_OFF & _CCP1_RB2 & _DEBUG_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _WDT_OFF & _PWRTE_ON & _INTRC_IO ;************************************************* ********************* ; RESET VEKTOR ;************************************************* ********************* ORG 0x0000 ;här ska vi börja vid reset. goto Init ; go to beginning of program Init ORG 0x0005 call Sub_Test clrf PORTA goto Init END ; directive 'end of program' ;*********************************** and my second file with the subrotine: test.asm ;****************************************** list p=16f819 ; list directive to define processor #include <p16F819.inc> ; processor specific variable definitions Sub_Test movlw .99 movwf PORTA return END ;******************************************** I am using MPLAB 7.30.00.00 and have no C compiler (and would preferably keep it this way). If you could modify the code so that this works (one way or the other) I would be off with a smile. Thanks Per |
|
#5
|
|||
|
|||
|
Re: simple MPLAB quest
Ok, sorted it myself.. hehe
If I rename the "test.asm" to "test.inc" and include this by: #include <test.inc> in the beginning of the "agraal08.asm" file. Then put a ORG statment on the Sub_Test routine: Sub_Test ORG 0x0050 and remove the "END" of the .inc file then it seams to work. Have not tried it much but it looks like it behave the way I want. Tomorrow (its quater past 1 at night here.. sould go home form work really..) Thanks to you trying to help me (probably I am just too novice on this to make your suggestion work for me..). Best Per |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Peasant's Quest | Pat McCarthy | Chit-Chat | 6 | 14-02-2005 07:17 |
| pic: Cooney Quest Render 1 | CD47-Bot | Extra Discussion | 12 | 21-02-2004 10:52 |
| using the MPLAB IDE MPLAB SIM simulator | WizardOfAz | Programming | 1 | 03-11-2003 01:24 |
| MY QUEST HAS BEEN COMPLETED! (yay!) | AlbertW | Chit-Chat | 15 | 30-04-2003 10:51 |
| Disney Quest Chicago Closed | D.J. Fluck | Chit-Chat | 3 | 01-05-2002 22:18 |