[comp.sys.atari.st] Calling Alan Page

wkk@houxj.UUCP (03/23/87)

Hello,  I need to get some information from Alan Page regarding
the bindings he wrote for Beckmeyers Micro-RTX and Megamax.

For those of you who are not Alan Page but know about his whereabouts,
send me mail.

If you happen to be Alan Page, I need to resolve some problems I am having
using your bindings.  First, there seems to be a missing op-code in the _exit
routing, looks like this:

_exit:
	LINK	A6,#0
	MOVE	8(a6),-(a7)
/* pterm call*/ #76,-(a7)
	TRAP	#1
	etc....
clearly, there must be an opcode before the #76 (I think it is probalbly a
move.w).  

Also, even with the above assumption,  the linker complains about fclose.
Even with that removed, the liker is unable to find the RTX calls from
a main program, one of the demos provided.

I did the following after slightly hacking mmrtx.c

mmcc mmrtx.c
mmcc qdemo.c
mmlink qdemo.o mmrtx.o
.
.
.
.
Unresolved refs:

q_create q_delete etc.........

Thanks for your help.

Wesley Kaplow
AT&T
2L-325
Holmdel, NJ 07733
(201)949-0065
ihnp4!houxj!wkk

chabris@husc2.UUCP (03/26/87)

In article <180@houxj.UUCP> wkk@houxj.UUCP (W.KAPLOW) writes:
>Hello,  I need to get some information from Alan Page regarding
>the bindings he wrote for Beckmeyers Micro-RTX and Megamax.
>
>...
>
>If you happen to be Alan Page, I need to resolve some problems I am having
>using your bindings.  First, there seems to be a missing op-code in the _exit
>routing, looks like this:
>
>_exit:
>	LINK	A6,#0
>	MOVE	8(a6),-(a7)
>/* pterm call*/ #76,-(a7)
>	TRAP	#1
>	etc....
>clearly, there must be an opcode before the #76 (I think it is probalbly a
>move.w).  
>
>Also, even with the above assumption,  the linker complains about fclose.
>Even with that removed, the liker is unable to find the RTX calls from
>a main program, one of the demos provided.
>
>I did the following after slightly hacking mmrtx.c
>
>mmcc mmrtx.c
>mmcc qdemo.c
>mmlink qdemo.o mmrtx.o
>.
>.
>.
>.
>Unresolved refs:
>
>q_create q_delete etc.........
>
>Thanks for your help.
>
>Wesley Kaplow
>AT&T
>2L-325
>Holmdel, NJ 07733
>(201)949-0065
>ihnp4!houxj!wkk

Wesley, I forwarded your article to Alan Page via Compuserve, and shortly
obtained the following response.  I hope it helps.

----------
Date:  24-Mar-87 22:27 EST
From:  Alan Page [72227,3507]
Reply to: Megamax & Micro RTX

Chris,
      Well, I sent my disk back a week ago and I am waiting for my RTX
upgrade. I don't know if RTX still has the same problem with Megamax C,
but I can explain what the problem was and how to fix it.
      First of all, you need to change the bindings from Alcyon C form to
Megamax C in-line assembler. To do this, start by removing the underline
'_' from the RTX function names as Megamax C wants the names in in-line
assembly to be the same as the names in c-code. Add a colon after the
names so that Megamax knows they are labels. Remove the .globl and declare
all functions at the head of the file as extern long name() (substitute
extern int where applicable). The whole mess falls within one large asm {
} statement and need not be inside a C function as Megamax allows in-line
assembly outside of functions. Change all register names to uppercase for
Megamax.
      The problem with the Megamax _exit (in this case the underline IS
needed) is that it is called by the Megamax code AFTER your main()
program exits and it does a jsr gemdos which ends up calling the rtx gemdos
binding AFTER the rtx_remove call has been made. The trap #5 call then
bombs. All I did was use the Megamax librarian to extract the offending
exit call and rewrite it to call trap #1 directly instead of doing a jsr
through gemdos(). I don't remember why I also included the Megamax exit()
call - it may not even have been needed.
      To add the missing bindings (which were added since I rewrote the
original bindings for Megamax C) just convert the rtxbind.s Alcyon source
code to Megamax in-line form.
      It sounds like the Megamax bindings got munged somewhere and
Beckemeyer also did not bother updating them when he changed versions. It
would be best to start from scratch and convert the current Alcyon
bindings.
        
_exit:/* global */
        LINK    A6,#0
        MOVE    8(A6),-(A7)
        MOVE    #76,-(A7)/* program terminates here */
        TRAP    #1
        ADDQ.L  #4,A7
        UNLK    A6
        RTS  /* should never reach here! */

-- Alan
----------


-- 
===============================================================================
Christopher F. Chabris    Contributing Editor, START Magazine, Antic Publishing
[Dunster F-61, Harvard University, Cambridge, MA, 02138         (617) 498-2239]
[Permanent: 15 Sterling Road, Armonk, NY, 10504                 (914) 273-8828]
ARPAnet: chabris@husc4.harvard.edu                        Compuserve: 73277,305
UUCP: ...harvard!husc4!chabris                         Bitnet: chabris@harvunxu
===============================================================================