This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Linker puts C segment at 0000 but should put A51 there.

The x230.a51 has org 0000h. I assumed that the linker would put this section here. There are several other C files. Here are various snippets.

BL51 BANKED LINKER/LOCATER V5.03, INVOKED BY:
C:\KEILC51\C51\BIN\BL51.EXE x230.obj, spdlim.obj,
version.obj, app.obj, isruart.obj, vectors.obj
TO x230 RAMSIZE (256)


INPUT MODULES INCLUDED:
  x230.obj (X230)         from x230.a51
  spdlim.obj (SPDLIM)     from .C of same name
  version.obj (VERSION)   from .C of same name
  app.obj (APP)           from .C of same name
  isruart.obj (ISRUART)   from .C of same name
  vectors.obj (VECTORS)   from .C of same name


LINK MAP OF MODULE:  x230 (X230)


TYPE    BASE      LENGTH    RELOCATION   SEGMENT NAME
-----------------------------------------------------

* * * * * * *   D A T A   M E M O R Y   * * * * * * *
REG     0000H     0008H     ABSOLUTE     "REG BANK 0"
REG     0008H     0008H     ABSOLUTE     "REG BANK 1"
        0010H     0099H                  *** GAP ***
IDATA   00A9H     0029H     ABSOLUTE

* * * * * * *   C O D E   M E M O R Y   * * * * * * *
CODE    0000H     001EH     UNIT         ?PR?SERINT?VECTORS
CODE    001EH     0005H     UNIT         ?PR?SPEED_LIMIT_RESET?SPDLIM
CODE    0023H     0003H     ABSOLUTE
CODE    0026H     2F5DH     UNIT         CS
CODE    2F83H     06C4H     UNIT         ?CO?ISRUART
CODE    3647H     014EH     UNIT         ?PR?PROCESSMSG?APP
CODE    3795H     0097H     UNIT         ?PR?IS_OK_INC_DTARGET_SPD?SPDLIM
CODE    382CH     003EH     UNIT         ?PR?_LOADMSG?ISRUART
CODE    386AH     002EH     UNIT         ?PR?ISR_SER_TX?VECTORS
CODE    3898H     0025H     UNIT         ?PR?ISR_SER_RX?VECTORS

Options for all *.c are to generate SRC file.\

Question: Why is ?PR?SERINT?VECTORS at 0000h?
Question: That is, why isn't CS (from x230.a51) at 0000h?

Snippet from x230.a51:

CS	SEGMENT	CODE
	RSEG	CS

    RSEG    CS

	org	000h
	Ljmp	powerup

; External 0 falling edge interrupt
	org	003h
	reti

; Timer 0 interrupt
	org	00bh
	Ljmp	timer0_interrupt_service

; External 1 falling edge interrupt
	org	013h
	reti

; Timer 1 interrupt
	org	01bh
	reti

; Serial interrupt service
;       See serint() in vectors.c

; Timer 2 interrupt
	org	02bh
	reti

; PCA interrupt
	org	033h
	reti

Snippet from vectors.c:

#pragma REGISTERBANK ( 1 )

void serint( void ) interrupt 4 using 1
{
    isr_ser_rx();
    isr_ser_tx();
}

void    isr_ser_rx( void )
{
    // rx isr (cut)
}

void    isr_ser_tx( void )
{
    // tx isr  (cut)
}

0