Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gpasm throws "Processor-header file mismatch" and "Processor type is undefined" errors

Following this question, I'm trying to assemble the sample code from this tutorial

#include "p10f200.inc"
; CONFIG
    __CONFIG _WDT_OFF & _CP_OFF & _MCLRE_OFF
    ORG 0x0000
INIT ; We are initializing the microcontroller over the next three lines.
    MOVLW ~(1 << GP1)  ;these two lines set GP1 as an output
    TRIS GPIO
    BSF GPIO, GP1 ;this line is where we set GP1 output high to light the LED
LOOP 
    GOTO LOOP                          ; loop forever
END ; Needed to end the program.

I installed gputils following this tutorial:

brew install gputils

and I have gpasm-1.5.0 #1285 (Nov 15 2020) installed properly. But when I run gpasm -c test001.asm I get the below errors:

/usr/local/Cellar/gputils/1.5.0-1/share/gputils/header/p10f200.inc:34:Message[301] MESSAGE: "Processor-header file mismatch.  Verify selected processor."
/usr/local/Cellar/gputils/1.5.0-1/share/gputils/header/p10f200.inc:113:Error[131]   Processor type is undefined. "__MAXRAM"
/usr/local/Cellar/gputils/1.5.0-1/share/gputils/header/p10f200.inc:114:Error[131]   Processor type is undefined. "__BADRAM"
/usr/local/Cellar/gputils/1.5.0-1/share/gputils/header/p10f200.inc:115:Error[131]   Processor type is undefined. "__BADRAM"
test001.asm:6:Error[131]   Processor type is undefined. "__CONFIG"
test001.asm:7:Error[131]   Processor type is undefined. "ORG"
test001.asm:8:Error[150]   Labels must be defined in a code or data section when making an object file.
test001.asm:9:Error[131]   Processor type is undefined. "MOVLW"
test001.asm:10:Error[131]   Processor type is undefined. "TRIS"
test001.asm:11:Error[131]   Processor type is undefined. "BSF"
test001.asm:12:Error[150]   Labels must be defined in a code or data section when making an object file.
test001.asm:13:Error[131]   Processor type is undefined. "GOTO"
test001.asm:14:Warning[205] Found directive in column 1: "END"

I would appreciate it if you could help me know what is the problem and how I can resolve it.

like image 766
Foad S. Farimani Avatar asked Sep 25 '26 23:09

Foad S. Farimani


1 Answers

Found the issue. I should have specified the processor I want to assemble for. One can do that either in the commands line:

gpasm -c -p p10f200 test001.asm 

or by adding the line

list p=p10f200

at the beginning of the code. plus the other warning:

test001.asm:14:Warning[205] Found directive in column 1: "END"

can be resolved by adding a tab before the "END" line at the end of the code.

I used this forum post as a reference. Also gpasm's documentations is here.

like image 90
Foad S. Farimani Avatar answered Sep 28 '26 11:09

Foad S. Farimani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!