; Date: Tue, 03 Jan 95 00:41:21 EST5EDT ; From: Russ.Gilbert@apk.wariat.org (Russ Gilbert) ; Edited by: kendrick@VAX.SONOMA.EDU (Bill Kendrick) ;Program Chainfile ;A module to chain one ACTION! program to any other load file program ;Only loads and runs single stage loading programs ;ml routine: ;ldx #$10 (indicate channel 1 to ciov) ;jsr ciov (load the file in) ;lda #$06 ;sta $358 (tell iocb1 to get 6 bytes) ;lda #$0 ;sta $359 (0 hi bytes to get) ;lda #$07 (read from file command to ciov) ;sta $352 (iocb1 cmd) ;lda #$1A ;sta $354 ;lda #$06 (tell iocb1 where to put the 6 bytes) ;sta $355 ;jsr ciov (get the six bytes into buffer at $61A) ;lda #$0C (command to close channel) ;sta $352 ;jsr ciov (close the channel) ;jmp ($61E) (indirect jump to run address) ; (the last two of the six bytes is the run address) BYTE ARRAY PAGE6(43)= [$A2 $10 $20 $56 $E4 $A9 $06 $8D $58 $03 $A9 $00 $8D $59 $03 $A9 $07 $8D $52 $03 $A9 $1A $8D $54 $03 $A9 $06 $8D $55 $03 $20 $56 $E4 $A9 $0C $8D $52 $03 $20 $56 $E4 $6C $1E $06] ;char array ; filename="D2:FILENAME.EXT" ; [ I think it's better to send "filename" as a character array ; to the "runit" procedure, rather than having a global variable! ; - Bill ] ;************************* ;* BEGIN CODE * ;************************* ;Proc runit() Proc runit(char array filename) ; [ makes more sense like this, no? ] byte b,cmd,startadrlo,startadrhi, endadrlo,endadrhi, runadrlo,runadrhi card pointer iocbxbuf, iocbxlen byte pointer iocbxcmd card startadr,endadr,len,runadr close(1) open(1,filename,4,0) b := getd(1) ;get rid of 255,255 b := getd(1) startadrlo := getd(1) startadrhi := getd(1) endadrlo := getd(1) endadrhi := getd(1) startadr := startadrlo + (256*startadrhi) endadr := endadrlo + (256*endadrhi) len := endadr - startadr + 1 printe("startadr, endadr, len") printc(startadr) print(", ") printc(endadr) print(", ") printce(len) iocbxcmd := $352 iocbxbuf := $354 iocbxlen := $358 cmd := 7 iocbxbuf^ := startadr iocbxcmd^ := cmd iocbxlen^ := len ;put in page 6 loader for b := 0 to 43 do cmd := page6(b) poke($620+b,cmd) od PRINTE("GOING TO PAGE 6 NOW") [$4C $20 $06] return ;* ;* main program ;* ;*) proc main() pute() PRINTE("Courtesy of: S.H.Smith") PUTE() ;runit() runit("D2:FILENAME.EXT") ; [ now you can call it with the file as a param ] return