Continue to Site

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.

  • 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.

MPASM ERRORS!

Status
Not open for further replies.

epilot

Member
hello there

why i get 13 errors when i use from MPASM to convert this ASM file into HEX file?

heres the ASM file

;**********************************************************************
; *
; Filename: st001.asm - schristmas light flasher *
; Date: 14/12/2002 *
; File Version: *
; *
; Author: Doug Rice *
; *
; Company: *
; *
; *
;**********************************************************************
; *
; Files required: *
; *
;**********************************************************************
; *
; Notes: *
; *
;**********************************************************************


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

__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _RC_OSC

; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.

;**********************************************************************
ORG 0x000 ; processor reset vector
goto main ; go to beginning of program


ORG 0x004 ; interrupt vector location

cblock 0x0c
countL ; counter used for a delay
ptr ; pointer into the data

endc

main

; remaining code goes here
; define bit in Port B

r equ 4
y equ 2
g equ 1

clrf PORTB
clrf ptr
loop1
CALL nextSample

; Now turn on the LED's by making the PORTB pins Outputs
xorlw 0xff
TRIS PORTB
; Force any outputs low
movlw 0
movwf PORTB

; delay
call delay1


; Turn off all the LEDS
movlw 0xFF
TRIS PORTB
movlw 0
movwf PORTB

; delay for two delays
call delay1
call delay1

; loop around
goto loop1


delay ; delay the code
; return
movlw 25
movwf countL
delay1
decfsz countL,f
goto delay1
return


nextSample
; This uses a table read.
; no attempt is made to check if PCLATH is correctly set.
;
incfsz ptr,f
nop
movfw ptr
; limit the index to 64 bytes
andlw 0x3F
addwf PCL,F
table


RETLW 0
RETLW 0
RETLW r
RETLW y
RETLW g

RETLW r
RETLW y
RETLW g

RETLW r
RETLW y
RETLW g
RETLW r
RETLW y
RETLW g

RETLW r
RETLW y
RETLW g
RETLW r
RETLW y
RETLW g

RETLW r
RETLW y
RETLW g

RETLW 0
RETLW 0
RETLW r
RETLW r
RETLW y
RETLW y
RETLW g
RETLW g
RETLW 0
RETLW 0
RETLW r
RETLW r
RETLW y
RETLW y
RETLW g
RETLW g
RETLW 0
RETLW 0
RETLW r
RETLW r
RETLW y
RETLW y
RETLW g
RETLW g
RETLW 0
RETLW 0
RETLW r
RETLW r
RETLW y
RETLW y
RETLW g

; at the end zero ptr and return a value to loop around again.
clrf ptr
RETLW g

clrf ptr

END ; directive 'end of program'
 
i must get these HEX file

:020000040000FA
:020000000428D2
:0800080086018D011820FF3A6A
:100010006600003086001520FF3066000030860044
:1000200015201520062825308C008C0B152808007B
:100030008D0F00000D083F3982070034003404346E
:1000400002340134043402340134043402340134FF
:1000500004340234013404340234013404340234EC
:1000600001340434023401340034003404340434E0
:1000700002340234013401340034003404340434D2
:1000800002340234013401340034003404340434C2
:1000900002340234013401340034003404340434B2
:0C00A0000234023401348D0101348D0162
:02400E00F33F7E
:00000001FF


but i get 13 errors???!

this hex is for a 3 led flasher circuit based on 16F84
 
here's the error i get:


Error[105] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 24 : Cannot open file (Include File "p16F84.inc" not found)
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 26 : Symbol not previously defined (_CP_OFF)
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 26 : Symbol not previously defined (_WDT_OFF)
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 26 : Symbol not previously defined (_PWRTE_ON)
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 26 : Symbol not previously defined (_RC_OSC)
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 54 : Symbol not previously defined (PORTB)
Warning[224] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 61 : Use of this instruction is not recommended.
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 61 : Symbol not previously defined (PORTB)
Error[126] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 61 : Argument out of range (0000 not between 0005 and 0007)
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 64 : Symbol not previously defined (PORTB)
Warning[224] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 72 : Use of this instruction is not recommended.
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 72 : Symbol not previously defined (PORTB)
Error[126] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 72 : Argument out of range (0000 not between 0005 and 0007)
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 74 : Symbol not previously defined (PORTB)
Error[113] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 103 : Symbol not previously defined (PCL)
 
epilot said:
here's the error i get:
Error[105] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 24 : Cannot open file (Include File "p16F84.inc" not found)
Warning[224] C:\DOCUME~1\MOHAMMAD\DESKTOP\ST001.ASM 72 : Use of this instruction is not recommended.

These are the only real errors. The other errors are caused by the first one.

The main problem is the assembler cannot find the include file (p16F84.inc) and so doesn't know where all the special function registers are. The reason for this is probably that your MPLAB is not installed correctly. Try reinstalling MPLAB. The file it is looking for is in C:\Program Files\MPLAB IDE\MCHIP_Tools

The second error (really just a warning) is because you used the TRISS instruction. Microchip want to phase this out and so recommend that you write to the TRISS register instead.

HTH

Mike.
 
hi

i reinstalled my MPLAB and even downloaded the only SPASM but i have the problem yet...

here's the MPLAB adress C:\Program Files\mcc18 and it seems there is no MCHIP_Tools file there?!
i can only see the 18xxx files there????!
 
If you have installed MPLAB IDE V7.2 from **broken link removed** then you should have a folder called C:\Program Files\Microchip\MPASM Suite that contains the include files.

HTH

Mike.
P.S. just in case you don't want to download the (31 Meg :shock: ) MPLAB then I've attached the 16F84 include file. You should be able to put it with the 18xxx.inc files and get it working if you are using MPASM.
 
Last edited:
hi Mike

wow, i put your attach into my MPASM file and it worked for 16F84A just fine thanks for it.

i dont know why this file was not into it originally?!

i downloaded MPLAB (version 3.90 i think)but i could use from its MPASM only,and now i see it had a problem :(

i dont like to download 31Meg so...
do you know which kind of compiler is the best for C lang?

thanks very much
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top