-/* initMem - allocates and initializes all the segments */
-/*-----------------------------------------------------------------*/
-void initMem ()
-{
- /* allocate all the segments */
- /* xternal stack segment ;
- SFRSPACE - NO
- FAR-SPACE - YES
- PAGED - YES
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - 'A'
- POINTER-TYPE - FPOINTER
- */
- xstack = allocMap (0, 1, 1, 0, 0, 0, options.xstack_loc, XSTACK_NAME,'A',PPOINTER);
-
- /* internal stack segment ;
- SFRSPACE - NO
- FAR-SPACE - NO
- PAGED - NO
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - 'B'
- POINTER-TYPE - POINTER
- */
- istack = allocMap (0, 0, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B',POINTER);
-
- /* code segment ;
- SFRSPACE - NO
- FAR-SPACE - YES
- PAGED - NO
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - YES
- DEBUG-NAME - 'C'
- POINTER-TYPE - CPOINTER
- */
- code = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME,'C',CPOINTER);
-
- /* home segment ;
- SFRSPACE - NO
- FAR-SPACE - YES
- PAGED - NO
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - YES
- DEBUG-NAME - 'C'
- POINTER-TYPE - CPOINTER
- */
- home = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME,'C',CPOINTER);
-
- /* Static segment (code for variables );
- SFRSPACE - NO
- FAR-SPACE - YES
- PAGED - NO
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - YES
- DEBUG-NAME - 'D'
- POINTER-TYPE - CPOINTER
- */
- statsg = allocMap (0, 1, 0, 0, 0, 1,0, STATIC_NAME,'D',CPOINTER);
-
- /* Data segment - internal storage segment ;
- SFRSPACE - NO
- FAR-SPACE - NO
- PAGED - NO
- DIRECT-ACCESS - YES
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - 'E'
- POINTER-TYPE - POINTER
- */
- data = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME,'E',POINTER);
-
- /* overlay segment - same as internal storage segment ;
- SFRSPACE - NO
- FAR-SPACE - NO
- PAGED - NO
- DIRECT-ACCESS - YES
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - 'E'
- POINTER-TYPE - POINTER
- */
- overlay = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME,'E',POINTER);
-
- /* Xternal Data segment -
- SFRSPACE - NO
- FAR-SPACE - YES
- PAGED - NO
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - 'F'
- POINTER-TYPE - FPOINTER
- */
- xdata = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XDATA_NAME,'F',FPOINTER);
-
- /* Inderectly addressed internal data segment
- SFRSPACE - NO
- FAR-SPACE - NO
- PAGED - NO
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - 'G'
- POINTER-TYPE - IPOINTER
- */
- idata = allocMap (0, 0, 0, 0, 0, 0, options.idata_loc,IDATA_NAME,'G',IPOINTER);
-
- /* Static segment (code for variables );
- SFRSPACE - NO
- FAR-SPACE - NO
- PAGED - NO
- DIRECT-ACCESS - YES
- BIT-ACCESS - YES
- CODE-ACESS - NO
- DEBUG-NAME - 'H'
- POINTER-TYPE - _NONE_
- */
- bit = allocMap (0, 0, 0, 1, 1, 0,0, BIT_NAME,'H',0);
-
- /* Special function register space :-
- SFRSPACE - YES
- FAR-SPACE - NO
- PAGED - NO
- DIRECT-ACCESS - YES
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - 'I'
- POINTER-TYPE - _NONE_
- */
- sfr = allocMap (1,0, 0, 1, 0, 0,0, REG_NAME,'I',0);
-
- /* Register space ;
- SFRSPACE - YES
- FAR-SPACE - NO
- PAGED - NO
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - ' '
- POINTER-TYPE - _NONE_
- */
- reg = allocMap (1,0, 0, 0, 0, 0, 0,REG_NAME,' ',0);
-
- /* SFR bit space
- SFRSPACE - YES
- FAR-SPACE - NO
- PAGED - NO
- DIRECT-ACCESS - YES
- BIT-ACCESS - YES
- CODE-ACESS - NO
- DEBUG-NAME - 'J'
- POINTER-TYPE - _NONE_
- */
- sfrbit = allocMap (1,0, 0, 1, 1, 0,0, REG_NAME,'J',0);
-
- /* EEPROM bit space
- SFRSPACE - NO
- FAR-SPACE - YES
- PAGED - NO
- DIRECT-ACCESS - NO
- BIT-ACCESS - NO
- CODE-ACESS - NO
- DEBUG-NAME - 'K'
- POINTER-TYPE - EEPPOINTER
- */
- eeprom = allocMap (0,1, 0, 0, 0, 0,0, REG_NAME,'K',EEPPOINTER);
-
- /* the unknown map */
- generic = allocMap (1,0, 0, 1, 1, 0,0, REG_NAME,' ',GPOINTER);
-
+/* initMem - allocates and initializes all the segments */
+/*-----------------------------------------------------------------*/
+void
+initMem ()
+{
+ /* allocate all the segments */
+ /* xternal stack segment ;
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - YES
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'A'
+ POINTER-TYPE - FPOINTER
+ */
+ xstack = allocMap (0, 1, 1, 0, 0, 0, options.xstack_loc, XSTACK_NAME, 'A', PPOINTER);
+
+ /* internal stack segment ;
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'B'
+ POINTER-TYPE - POINTER
+ */
+ if (ISTACK_NAME)
+ {
+ istack = allocMap (0, 0, 0, 0, 0, 0, options.stack_loc, ISTACK_NAME, 'B', POINTER);
+ }
+ else
+ {
+ istack = NULL;
+ }
+
+ /* code segment ;
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - YES
+ DEBUG-NAME - 'C'
+ POINTER-TYPE - CPOINTER
+ */
+ code = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME, 'C', CPOINTER);
+
+ /* home segment ;
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - YES
+ DEBUG-NAME - 'C'
+ POINTER-TYPE - CPOINTER
+ */
+ home = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, HOME_NAME, 'C', CPOINTER);
+
+ /* Static segment (code for variables );
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - YES
+ DEBUG-NAME - 'D'
+ POINTER-TYPE - CPOINTER
+ */
+ statsg = allocMap (0, 1, 0, 0, 0, 1, 0, STATIC_NAME, 'D', CPOINTER);
+
+ /* Constant Absolute Data segment (for variables );
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - YES
+ DEBUG-NAME - 'D'
+ POINTER-TYPE - CPOINTER
+ */
+ c_abs = allocMap (0, 1, 0, 0, 0, 1, 0, CABS_NAME, 'D', CPOINTER);
+
+ /* Data segment - internal storage segment ;
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - YES
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'E'
+ POINTER-TYPE - POINTER
+ */
+ data = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME, 'E', POINTER);
+
+ /* Absolute internal storage segment ;
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - YES
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'E'
+ POINTER-TYPE - POINTER
+ */
+ if (IABS_NAME)
+ {
+ d_abs = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, IABS_NAME, 'E', POINTER);
+ }
+ else
+ {
+ d_abs = NULL;
+ }
+
+ /* overlay segment - same as internal storage segment ;
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - YES
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'E'
+ POINTER-TYPE - POINTER
+ */
+ if (OVERLAY_NAME)
+ {
+ overlay = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME, 'E', POINTER);
+ }
+ else
+ {
+ overlay = NULL;
+ }
+
+ /* Xternal paged segment ;
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - YES
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'P'
+ POINTER-TYPE - PPOINTER
+ */
+ if (PDATA_NAME)
+ {
+ pdata = allocMap (0, 0, 1, 0, 0, 0, options.xstack_loc, PDATA_NAME, 'P', PPOINTER);
+ }
+ else
+ {
+ pdata = NULL;
+ }
+
+ /* Xternal Data segment -
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'F'
+ POINTER-TYPE - FPOINTER
+ */
+ xdata = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XDATA_NAME, 'F', FPOINTER);
+ xidata = allocMap (0, 1, 0, 0, 0, 0, 0, XIDATA_NAME, 'F', FPOINTER);
+ xinit = allocMap (0, 1, 0, 0, 0, 1, 0, XINIT_NAME, 'C', CPOINTER);
+
+ /* Absolute external storage segment ;
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'F'
+ POINTER-TYPE - FPOINTER
+ */
+ if (XABS_NAME)
+ {
+ x_abs = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XABS_NAME, 'F', FPOINTER);
+ }
+ else
+ {
+ x_abs = NULL;
+ }
+
+ /* Indirectly addressed internal data segment
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'G'
+ POINTER-TYPE - IPOINTER
+ */
+ if (IDATA_NAME)
+ {
+ idata = allocMap (0, 0, 0, 0, 0, 0, options.idata_loc, IDATA_NAME, 'G', IPOINTER);
+ }
+ else
+ {
+ idata = NULL;
+ }
+
+ /* Indirectly addressed absolute internal segment
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'E'
+ POINTER-TYPE - IPOINTER
+ */
+ if (IABS_NAME)
+ {
+ i_abs = allocMap (0, 0, 0, 0, 0, 0, options.data_loc, IABS_NAME, 'E', IPOINTER);
+ }
+ else
+ {
+ i_abs = NULL;
+ }
+
+ /* Bit space ;
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - YES
+ BIT-ACCESS - YES
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'H'
+ POINTER-TYPE - _NONE_
+ */
+ bit = allocMap (0, 0, 0, 1, 1, 0, 0, BIT_NAME, 'H', 0);
+
+ /* Special function register space :-
+ SFRSPACE - YES
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - YES
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'I'
+ POINTER-TYPE - _NONE_
+ */
+ sfr = allocMap (1, 0, 0, 1, 0, 0, 0, REG_NAME, 'I', 0);
+
+ /* Register space ;
+ SFRSPACE - YES
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - ' '
+ POINTER-TYPE - _NONE_
+ */
+ reg = allocMap (1, 0, 0, 0, 0, 0, 0, REG_NAME, ' ', 0);
+
+ /* SFR bit space
+ SFRSPACE - YES
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - YES
+ BIT-ACCESS - YES
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'J'
+ POINTER-TYPE - _NONE_
+ */
+ sfrbit = allocMap (1, 0, 0, 1, 1, 0, 0, REG_NAME, 'J', 0);
+
+ /* EEPROM space
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'K'
+ POINTER-TYPE - EEPPOINTER
+ */
+ eeprom = allocMap (0, 1, 0, 0, 0, 0, 0, REG_NAME, 'K', EEPPOINTER);
+
+ /* the unknown map */
+ generic = allocMap (1, 0, 0, 1, 1, 0, 0, REG_NAME, ' ', GPOINTER);
+