Asm problem

Thread Starter

Rk17

Joined Apr 23, 2011
43
ive got this code right here please check it out... im using mplab v8.66 hi-tech c compiler v9.81

it fails to initialize, what could be wrong with it? need help please.. this is for controlling a servo motor


Rich (BB code):
; FILE: outLed.asm ; AUTH: (Your name here) ; DATE: (date) ; DESC: Makes B0,B2,B4,B6 low and B1,B3,B5,B7 hi ; NOTE: Tested on PIC16F84-04/P.   ; REFs: Easy Pic'n p. 23 (Predko p. 173 is bogus?)  	list	p=16F84 	radix	hex  ;---------------------------------------------------------------------- ;	cpu equates (memory map) myPortB	equ	0x06		; (p. 10 defines port address) ;----------------------------------------------------------------------  	org	0x000  start	movlw	0x00		; load W with 0x00 make port B output (p. 45) 	tris	myPortB		; copy W tristate, port B outputs (p. 58)  	movlw   b'10101010'	; load W with bit pattern (p. 45) 	movwf	myPortB		; load myPortB with contents of W (p. 45)  circle	goto	circle	; done  	end  ;---------------------------------------------------------------------- ; at burn time, select: ;	memory uprotected ;	watchdog timer disabled ;	standard crystal (4 MHz) ;	power-up timer on

this is the error

Rich (BB code):
Error   [876] C:\Documents and Settings\Administrator\My Documents\pic16F84 projects\Tutorials\servo.asm; 2. syntax error
Error   [223] servo.pre; 4. digit out of range
Error   [876] servo.pre; 13. syntax error
Error   [800] servo.pre; 13. undefined symbol "b"
i got it from this link
Rich (BB code):
http://www.pages.drexel.edu/~kws23/tutorials/PICTutorial/PICTutorial.html
 

DerStrom8

Joined Feb 20, 2011
2,390
Hi, Rk17.
You say you're using the Hi-Tech C compiler? Yet you're coding in ASM? That might be your problem--I am pretty sure Hi-Tech is for C programs, not ASM. :p
(Somebody please correct me if I'm wrong)
 

Thread Starter

Rk17

Joined Apr 23, 2011
43
tnx but isnt it for assembly code too? because if you open a file you could add .asm files doesnt that mean that either asm or c program could be added to the project and compile it either of the 2?
 

ErnieM

Joined Apr 24, 2011
8,377
I've not used the high-tech compiler but it may well have a project setting for an assembly file. If you're running that compiler inside MPLAB then that definitely handles assembly files.

C is .c and assembly is .asm and best not to confuse the two.

If you want to do assembly programs just use MPLAB.
 
Top