Shop OBEX P1 Docs P2 Docs Learn Events
SX Asm: Symbol not defined — Parallax Forums

SX Asm: Symbol not defined

argarg Posts: 4
edited 2008-01-24 16:15 in General Discussion
It appears that the location of my functions affects·whether my code compiles.· If the functions are defined at the bottom of my 'main' file·then no problems.· If the functions are defined in an include file then I get symbol not defined errors.·The errors all relate to labels defined inside macros!

Help!

Comments

  • BeanBean Posts: 8,129
    edited 2008-01-24 12:23
    Please post your code.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com

    ·
  • YendorYendor Posts: 288
    edited 2008-01-24 14:56
    Sounds like something Bean helped me with before....

    You may need two 'load' or 'include' files. One for the function prototypes inserted where the functions are typically defined, then one at the where you typically put your functions. It sounds like the compiler is not understanding the function declaration.

    What Bean suggested is to have two seperate files. One has the constants and stuff (Bean calls that the header), then another has the actual code (that Bean calls the body). So he would use something like LOAD "MATH_HDR.SXB" then LOAD "MATH.SXB".

    Think of both as "Insert Code Here >"

    Give that a try, if it doesn't work, we'll try again!

    Rodney
  • argarg Posts: 4
    edited 2008-01-24 16:03
    I have stripped the code down to the essentials and included the two files below.

    I already have ten included files and as I previously descovered - that's your lot!

    The actual code is split into ten files because they are some what self contained - like the VP files, each file describes a separate object.

    ;******************************** test.src
    __TEST_

    TestMacro macro
    :test
    endm
    org $200
    TestFunc
    TestMacro
    retp

    ;********************************************* main file
    IFNDEF __TEST_
    INCLUDE "test.src"
    ENDIF


    ClrRegisters macro
    :zero_ram
    endm

    org $0
    ClrRegisters ; sets every thing to 0
    :Main
    ;call @TestFunc
    jmp :Main
    END
  • argarg Posts: 4
    edited 2008-01-24 16:15
    Sorry, I don't often have to ask for help. Files are now attached.

    Ivan
Sign In or Register to comment.