[HECnet] Macro32 entry forward desclaration - how?

Johnny Billquist bqt at softjar.se
Sat Nov 19 11:48:17 PST 2011


On 2011-11-19 20:46, Pinoccio wrote:
Hi all!
I am studying Macro32 and have a seemingly simple question. My source file
is:

                .TITLE tstentry
                .IDENT /V1.0/

                .PSECT RDATA,NOWRT,SHR,NOPIC,NOEXE,RD,QUAD

HI:         .ASCID "Hello, World!"

                .PSECT CODE,NOWRT,SHR,PIC,EXE,RD,QUAD

                .ENTRY START, ^M<>
                CALLS #0, PRINT
                RET
                .END START

                .ENTRY PRINT
                PUSHL     HI
                CALLS     #1,G^LIB$PUT_OUTPUT
                RET
                .END PRINT

Macro32 decides PRINT is an external symbol, and link denies to produce
executable with a "LINK-W-USEUNDEF, undefined symbol PRINT referenced"
error. How I should make forward declaration of PRINT function to show
assembler it is valid local symbol? In C language I can make prototype
declaration before calling. But what is a right way for Macro 32?

You have misunderstood what .END does.

.END means assembly stops there, and the argument is the start address of the program.

So, your code for your PRINT routine is not even assembled. Make sure you create a list file, and this should be obvious.

	Johnny

-- 
Johnny Billquist                                   || "I'm on a bus
                                                                  ||   on a psychedelic trip
email: bqt at softjar.se                         ||   Reading murder books
pdp is alive!                                         ||   tryin' to stay hip" - B. Idol



More information about the Hecnet-list mailing list