# MPLAB and coding questions

Status
Not open for further replies.

#### jakeselectronics

##### Member
Hey Forum.

I've been out of it for a while, a long while, but a project has brought me back. And I'm enjoying it.

Anyway I now have MPLAB X v3.45 and am trying to do things the way I used to.

My first issue is that in the Watches window where I would like to monitor some General Purpose Ram, I can not get the name label to read as I specified it in the program.
I.e., address 0x20 (First program memory location used for GPR RAM) I name it "COUNT".
But I cannot get the watch window to display COUNT. I can only specify 0x20.
I suspect it has something to do with CBLOCK (& ENDC) and I suspect this is no longer good practice.
I stumbled on something called Absolute coding compared with (the new) Reclocatable Coding. I'm guessing this also has something to do with it.

I also see some things saying to use UDATA instead of CBLOCK. I tried to implement it but no lock.

Can someone put me on the right path?

I'm excited to share my new project and what I have been working on but want to sort out this out first.

(assembly)
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                                                  ;
;                        Program: Example                               ;
;                        Comments:                                                                 ;
;                                                                                                  ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

LIST            P=PIC16F737
INCLUDE         P16F737.INC
__CONFIG        _CONFIG1, _CP_OFF & _CCP2_RC1 & _DEBUG_OFF & _VBOR_2_0 & _BOREN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC
__CONFIG        _CONFIG2, _BORSEN_OFF & _IESO_OFF & _FCMEN_OFF
ERRORLEVEL      -302    ; Suppress warning message; "Operand Not in bank 0, check to ensure bank bits are correct"
ERRORLEVEL      -205    ; Suppress warning message; "Found directive in column 1."

CBLOCK   0x20
COUNT
ENDC

ORG     H'000'                  ; Processor reset vector location. On power up, the program jumps here
GOTO    SETUP                   ;
ORG     H'004'                  ; Interrupt vector location. When an Interrupt occurs, the program jumps here
GOTO    ISR
Thanks,
Jake.

#### jakeselectronics

##### Member
Actually, I can view GPR register names in the watch window, but ony when not in debug mode... When building for debug mode, they all disappear and I can only add them back into the watches window by address (0x20) and not by name.

Status
Not open for further replies.

Loading