Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Migrating from 16F628 to 16F1826 odd instruction?

Status
Not open for further replies.
Joined
Sep 21, 2020
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
36
Hi all, I am in the process of making changes to some assembly code to work with a different PIC uC due to parts shortage, We are going from 16F628 to 16F1826 and when I compile it gives error(s) at these lines:

Code:
;TEMP3 HOLDS THE NUMBER OF BITS OF ALARMS
    CLJA    TEMP3,1,MULTIPLE_ALARMS    ;CLEAR THE ALARM COUNT (LEAVE THE FLASHING LED ON), CONSTANT BEEP   
;NOW SET THE ALARM COUNT BASED ON WHICH ALARM IS SET
;IF MULTIPLE ALARMS, ONLY THE AUX LED FLASHES (IN TIME WITH THE FLASH COUNTER)

and

Code:
;INITIALIZE MEMORY HERE ALL MEMORY (020h-07Fh)
    MOVLF    020h,FSR
INIT_L    CLRF    INDF
    INCF    FSR,F
    CLJB    FSR,080h,INIT_L
;DONE WITH ZERO MEMORY

I get Error at:
Found label after column 1. (CLJA) & Found label after column 1. (CLJB)
I have never seen an instruction called CLJA & CLJB

Can anyone shed some light on these two instructions? Code was written by someone that is no longer with company and I see no macro's attached to ASM. I'm using MPLAB X
Thank you -Ryan
 

They are not standard Microchip instructions but they could be '#defined' somewhere to refer to a different instruction or a macro. Assembly language allows you to rename an instruction or group of instructions as a single entity so quite likely you are missing that definition somewhere.

Brian.
 
As Brian has suggested the CLJA and CLJB are likely MPASM MACROs.

An assembly language MACRO is one method to create a single line directive that expands to multiple lines of assembly language opcodes.

Based only on the information in post#1 this is one possible way to implement a CLJB macro:
Code:
CLJB MACRO IDXR,LIT,LABEL
    movlw  LIT
    xorwf  IDXR,W
    btfsc  STATUS,2
    goto   LABEL
    ENDM
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top