; This fragment loads an Action! ; program and executes it ; (thru INITAD). This fragment can be ; easily modified to support any type ; of binary load file by checking the ; status of INITAD and RUNAD after ; each block of code has been loaded. ; If you want this fragment to remain ; resident, you must compile to a ; specific location (outside your own ; program, obviously) using either the ; SET $E/SET $491 method or using ; SET $B5 to set a compilation offset ; (Note: due to a bug in the Action! ; compiler offset routine, you can ; only specify a positive offset) ; Once the program is compiled, type: ; ?Load ; from the monitor to obtain the ; runtime address. In your own source ; that calls Load, you must insert the ; following line before its use: ; PROC Load=$xxxx(CHAR ARRAY str) ; where "$xxxx" is the address you ; found above, and where the CHAR ; ARRAY "str" is the complete filespec ; of the program you want to load. MODULE ;LOAD.ACT BYTE CIO_status CARD start, len ; NOTE: CIO and ReadBlock are ; copyrighted routines of ; Action! computer services ; Credit such as this of their origin ; must be given if used in your own ; program source CHAR FUNC CIO=*(BYTE dev, CARD addr,size, BYTE cmd,aux1,aux2) [$29$F$85$A0$86$A1$A$A$A$A$AA$A5$A5$9D$342$A5$A3$9D$348$A5$A4$9D$349$A5$A6$F0$8$9D$34A$A5$A7$9D$34B$98$9D$345 $A5$A1$9D$344$20$E456$8C CIO_status$C0$88$D0$6$98$A4$A0$99 EOF$60] CARD FUNC ReadBlock=*(BYTE dev, CARD addr, size) [$48$A9$7$85$A5$A9$0$85$A6$A5$A3$5$A4$D0$6$85$A0$85$A1$68$60$68$20 CIO$BD$348$85$A0$BD$349$85$A1$60] ; MAINLINE **************************** CARD FUNC GetOne() BYTE cLow CARD cHigh DO cLow=GetD(1) cHigh=GetD(1) cHigh== LSH 8 % cLow UNTIL cHigh#$FFFF OD RETURN(cHigh) PROC GetAddrs=*() start=GetOne() len=GetOne()-start+1 RETURN PROC Load(CHAR ARRAY filespec) CARD INITAD=$2E2 Close(1) Open(1,filespec,4,0) WHILE start#$2E2 DO GetAddrs() ReadBlock(1,start,len) OD Close(1) [$6C INITAD]