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
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
15,152
Helped
4,943
Reputation
9,907
Reaction score
4,754
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
128,688
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.
 

Dan1138

Member level 3
Joined
Jan 30, 2018
Messages
59
Helped
9
Reputation
20
Reaction score
12
Trophy points
8
Activity points
584
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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top