Neil W.Fisk said:
Hello Everyone
Some of the declare statements are unclear in MPLAB, some programmers
from PIClist use them but I'am unsure what they mean.
MPlab doesn't have any this information in the help
section using CBLOCK,and ENDC.
The macros seem straight forward on how their used.
My question is, what is the proper format or layout for this
command statement CBLOCK,and ENDC and how do you know which label is
used in relation to the address location in the code?
Can anyone give an example of this and the relation to
the address location in PIC micro for me?
Thanks
Neil
;***************************************************************************
*********
; Filename: Variable.inc
*
; Date: 03-04-2003 *
;
*
;
*
; Author: Thomas C. Sefranek
*
; Company: NeuroPhysics Corporation
*
; 900 Mount Laurel Circle
*
; Shirley, Massachussetts 01464
*
;
*
;***************************************************************************
*********
;
;***************** Register (Memory) allocations VARIABLE DEFINITIONS
***************
; Registers for the Interupt_Handler (IRQ_Handler)
CBLOCK 0x20
W_SAVE ; Reserve 1 byte of RAM for IRQ Working register.
STATUS_SAVE ; Reserve 1 byte of RAM for IRQ STATUS register.
FSR_SAVE ; Reserve 1 byte of RAM for IRQ FSR register.
;
; Registers for STATE Machines
FIFO_STATE ; Reserve 1 byte of RAM for the OUTput FIFO STATE register.
PARSE_STATE ; Reserve 1 byte of RAM for PARSE character STATE register.
HALT_STATE ; Reserve 1 byte of RAM for the HALT STATE register.
;
LED_ARG ; Reserve 1 byte of RAM for the LED ARGument register.
LED_SHADOW ; Reserve 1 byte of RAM for the LED SHADOW register.
BLINK_RATE_0 ; Reserve 1 byte of RAM for the LED 0 BLINK register.
BLINK_RATE_1 ; Reserve 1 byte of RAM for the LED 1 BLINK register.
BLINK_RATE_2 ; Reserve 1 byte of RAM for the LED 2 BLINK register.
BLINK_RATE_3 ; Reserve 1 byte of RAM for the LED 3 BLINK register.
BLINK_RATE_4 ; Reserve 1 byte of RAM for the LED 4 BLINK register.
BLINK_RATE_5 ; Reserve 1 byte of RAM for the LED 5 BLINK register.
BLINK_RATE_6 ; Reserve 1 byte of RAM for the LED 6 BLINK register.
BLINK_RATE_7 ; Reserve 1 byte of RAM for the LED 7 BLINK register.
BLINK_LED ; Reserve 1 byte of RAM for the BLINK LED register.
TEMP_CHR ; Reserve RAM for the TEMPorary storage of the character.
PASS_CHAR ; Reserve RAM for the Input storage of a character.
PARSE_CHAR ; Reserve 1 byte of RAM for the PARSEd CHARacter register.
ADJ_CHAR ; Reserve 1 byte of RAM for the ADJust CHARacter register.
TEMP_BYTE ; Reserve 1 byte of RAM for the TEMPorary BYTE register.
STRING_PTR ; Reserve 1 byte of RAM for the STRING PoinTeR register.
OUT_FIFO_IN_PTR ; Reserve 1 byte of RAM for the OUTput FIFO input pointer.
OUT_FIFO_OUT_PTR ; Reserve 1 byte of RAM for the OUTput FIFO output pointer.
OUT_FIFO_START ; Reserve 1 byte of RAM for the OUTput FIFO STARTing pointer.
OUT_FIFO:64 ; Reserve 64 bytes for the OUTput First In First Out buffer.
OUT_FIFO_END ; Reserve 1 byte of RAM for the OUTput FIFO ENDing pointer.
ENDC
;
;****************** Page 1 Register allocations VARIABLE DEFINITIONS
**********
; Registers for the Input FIFO.
CBLOCK 0xA0
IN_FIFO_STATE ; Reserve 1 byte of RAM for the INput FIFO STATE register.
IN_TEMP_CHR ; Reserve RAM for the IN TEMPorary storage of the character.
IN_STRING_PTR ; Reserve 1 byte of RAM for the IN STRING PoinTeR register.
I_STRING:24 ; Reserve 24 bytes of RAM for the INput STRING.
;
IN_FIFO_IN_PTR ; Reserve 1 byte of RAM for the INput FIFO input pointer.
IN_FIFO_OUT_PTR ; Reserve 1 byte of RAM for the INput FIFO output pointer.
IN_FIFO_START ; Reserve 1 byte of RAM for the INput FIFO STARTing pointer.
IN_FIFO:64 ; Reserve 64 bytes for the INput First In First Out buffer.
IN_FIFO_END ; Reserve 1 byte of RAM for the INput FIFO ENDing pointer.
ENDC
;***************************************************************************
***
;