AnsweredAssumed Answered

XDEF Entry and ABSENTRY Entry error

Question asked by Ash Chand on Jun 19, 2015

Hello everyone,

 

This is the second program I have written in assembly language and I am getting "error A1104: User undefined symbol: 'Entry'".  Which is kind of weird because it worked fine in my first program.  I am running code warrior for hc12 on parallels on my macbook pro and here is my code:

 

;*****************************************************************

;* This stationery serves as the framework for a                 *

;* user application (single file, absolute assembly application) *

;* For a more comprehensive program that                         *

;* demonstrates the more advanced functionality of this          *

;* processor, please see the demonstration applications          *

;* located in the examples subdirectory of the                   *

;* Freescale CodeWarrior for the HC12 Program directory          *

;*****************************************************************

 

 

; export symbols

           XDEF Entry, _Startup   ; export 'Entry' symbol

            ABSENTRY Entry        ; for absolute assembly: mark this as application entry point

 

 

; Include derivative-specific definitions

  INCLUDE 'derivative.inc'

 

 

DATAStart   EQU  $0800            ; absolute address to place variables

DATAEnd     EQU  $0BFF            ; last address of RAM, used to init stack pointer

ProgStart   EQU  $0A00            ; absolute address to place code/constant data

 

 

; variable/data section

            ORG  DATAStart         ;starts storing data at location 0800

NUM         DC.B 9

DEN         DC.B 5

RNDVAL      DS.B 2

 

 

;Calling Program

            ANDCC #$7F

            LDS   ProgStart       ; loads stack pointer to 0A00

            LDAA  NUM             ; loads NUM to register A

            PSHA                  ; places NUM in stack frame

            LDAA  DEN             ; loads DEN in register A

            PSHA                  ; places DEN in stack frame

            DES                   ; creates space for return value

            JSR   ROUND           ; jumps to sub program ROUND

            PULA                  ; retrieves result

            STAA  RNDVAL          ; stores result in RNDVAL

            INS                   ; recovers dynamic memory used by DEN

            INS                   ; recovers dynamic memory used by NUM

            STOP                  ; terminates program

           

;Sub Program

            ORG $0B00             ;absolute address to store sub program

            ;prolog code

ROUND       PSHA

            PSHB

            PSHX

            PSHY

            ;Algorithm

            TSY                   ; loads pointer to y

            LDAA #0               ; loads zero in register A

            LDAB 11,Y             ; loads NUM into register B

            LDX  10,Y             ; loads DEN into register X

            IDIV                  ; divides A+B by X

            LDAA #2               ; loads 2 to register A

            MUL                   ; multiplies 2 x remainder

            XGDX                  ; switches 2*R to X and Qout to AB

            CPX  10,Y             ; compares double remainder to DEN

            BLT  SKIP             ; if x is less then den

            RTS                   ; returns back with HI (7,Y) and LO (8,Y)

SKIP        ADDB #1               ; else round up one

            STAB 9,Y              ; stores B in return value

            ;epilog code

            PULY                  ; stores Y HI 1,Y and LO 2,Y

            PULX                  ; stores X HI 3,Y and LO 4,Y

            PULB                  ; stores B in 5,Y

            PULA                  ; stores A in 6,Y

            RTS                   ; returns back with HI (7,Y) and LO (8,Y)           

;**************************************************************

;*                 Interrupt Vectors                          *

;**************************************************************

            ORG   $FFFE

            DC.W  Entry           ; Reset Vector

 

As you can see my code was complete and I was just debugging each line to see if it worked, but i got stuck in the first line. Any help would be appreciated.

Outcomes