+Larry Posted February 10, 2012 Share Posted February 10, 2012 There are many Autorun.Sys files that run Basic programs at boot-up, but I cannot find one with the source code so I could better understand what is going on. Does anyone have one (or a link) that has commented source code or could add some comments as to what is happening in the prog? Thanks, Larry Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 10, 2012 Share Posted February 10, 2012 (edited) There's a few ways you could do it. 1. Put RUN "program.bas" onscreen then either set forced input on (AUX1=$0D) or put a Return into the keypress buffer. To keep the user in the dark as to what's going on you could set the text colour = background colour and disable key/Break processing. 2. "Inject" the program into memory, set Basic's zero-page pointers appropriately and call the routine in Basic ROM to run the program. 3. Do a direct call to the Basic ROM with the RUN "program.bas" parameter set up. The Basic Source book might have more info. As for programs to do this sort of thing, there'd be dozens of them around. Edited February 10, 2012 by Rybags Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted February 10, 2012 Share Posted February 10, 2012 Here are a couple with commented source code. The basic (no pun intended) idea is to intercept the CIO when the "Ready" prompt is printed or when BASIC asks the screen editor for a new line. It's probably possible to use "forced read" mode, but I think the idea in these examples is that the CIO get byte routine is temporarily redefined to simply pull the name of the BASIC program a character at a time and return it to the screen editor, so BASIC thinks the user actually typed it. 1 Quote Link to comment Share on other sites More sharing options...
+Larry Posted February 10, 2012 Author Share Posted February 10, 2012 Thanks Guys! Googling did no good for me on this one, but I did find another good explanation with source code in Analog #66 (Nov. 1988) page 68: "Autorun.Sys Secrets." The gist of it is what you said FJC. Article is found in the scans here: http://analog.katorlegaz.com/ -Larry 1 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted February 10, 2012 Share Posted February 10, 2012 I Googled "Atari autorun.sys basic" and the wiki article was top of the second page of results. Quote Link to comment Share on other sites More sharing options...
+Larry Posted February 10, 2012 Author Share Posted February 10, 2012 I went 3 pages deep and at least didn't see it. It seems like they do not always come up in the same order (except paid results). I did find a Compute! article listed that looked promising, but Atari Magazines doesn't have that issue's text --just the index for that issue. -Larry Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 10, 2012 Share Posted February 10, 2012 I reckon you won't get much tighter than the one Jon linked to. Maybe alter it to disable the Break key, other than that it looks ready to roll. Or you could have it use an external file as the input rather than the imbedded text. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted February 10, 2012 Share Posted February 10, 2012 Here mine which uses case 1 Rybags mentioned. It also works correctly if BASIC was disabled before which is something many modfied OS do by default (experienced user do automatically because they don't expect BASIC programs ;.) ; Switches on BASIC, re-opens the editor, checks the RBAM and autoruns "AUTORUN.BAS" ; Save executable as "AUTORUN.SYS" ; JAC! - 2010 iocb = $340 ;IOCB base address iocom = iocb+2 ;IOCB command ioadr = iocb+4 ;IOCB buffer address ioaux1 = iocb+10 ;IOCB auxilary byte 1 ioaux2 = iocb+11 ;IOCB auxilary byte 1 ciov = $e456 ;CIO vector open = $03 ;Command: OPEN close = $0c ;Command: CLOSE rw = 12 rwauto = 13 * = $600 start cld clc lda $d301 ;Enable BASIC and #$fd sta $d301 ldx #0 ;Channel 0 lda #close ;Close editor sta iocom,x jsr ciov lda #open ;Open editor to ensure memtop is correct sta iocom,x lda #<editor sta ioadr,x lda #>editor sta ioadr+1,x lda #rw ;read and write sta ioaux1,x lda #0 sta ioaux2,x jsr ciov lda #rwauto ;Switch to automatic input mode sta ioaux1,x lda #0 ;Screen off, will be switch on by the next GRAPHICS statement sta 559 wait lda 20 ;Wait until screen is off cmp 20 beq wait ldx #[lineend-line]-1 ldy #[lineend-line]-1+2 copyline lda line,x sta (88),y dey dex bpl copyline rts editor .byte "E:",$9b ; Disable automatic input mode line .sbyte "POKE 842,12:RUN ",34,"D1:AUTORUN.BAS",34 lineend * = $2e0 .word test Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 10, 2012 Share Posted February 10, 2012 (edited) You'd need to set the Ramtop ($6A) OS variable there. If Basic is off then it = $C0 and you'd need to set to $A0. A quick/dirty way to Close an IOCB is to set the Dev Index (ICHID $340) to $FF. Edited February 10, 2012 by Rybags Quote Link to comment Share on other sites More sharing options...
+Larry Posted February 10, 2012 Author Share Posted February 10, 2012 Thanks, Jac! Nicely commented and easy to follow! That's just the kind of assembler code I need! -Larry Quote Link to comment Share on other sites More sharing options...
+JAC! Posted February 10, 2012 Share Posted February 10, 2012 (edited) As Rybags mentioned: lda $d301 ;Enable BASIC and #$fd sta $d301 lda #>$a000 ; Set RAMTOP to begin of BASIC ROM $a000 sta $6a Edited February 10, 2012 by JAC! 1 Quote Link to comment Share on other sites More sharing options...
russg Posted February 18, 2012 Share Posted February 18, 2012 (edited) There's a really neat program called 'fast fingers' that makes an autorun.sys that types anything you want. It is from Antic 1984, February. You run the BASIC program, type what you want to happen at bootup, and then hit CNTRL-3 to save it to AUTORUN.SYS. FASTFING.zip Edited February 18, 2012 by russg Quote Link to comment Share on other sites More sharing options...
russg Posted February 19, 2012 Share Posted February 19, 2012 (edited) There's a really neat program called 'fast fingers' that makes an autorun.sys that types anything you want. It is from Antic 1984, February. You run the BASIC program, type what you want to happen at bootup, and then hit CNTRL-3 to save it to AUTORUN.SYS. It doesn't have to be AUTORUN.SYS, you can re-name it anything you want if you just want to 'type' something often ie. it is a normal binary load. Edited February 19, 2012 by russg Quote Link to comment Share on other sites More sharing options...
+Larry Posted February 20, 2012 Author Share Posted February 20, 2012 Thanks, Russ. I remember this program from Antic many years ago. ____ Chamberlin, author (or something like that) according to my rusty memory. (?) (I didn't look it up, if by chance I'm right...) -Larry There's a really neat program called 'fast fingers' that makes an autorun.sys that types anything you want. It is from Antic 1984, February. You run the BASIC program, type what you want to happen at bootup, and then hit CNTRL-3 to save it to AUTORUN.SYS. It doesn't have to be AUTORUN.SYS, you can re-name it anything you want if you just want to 'type' something often ie. it is a normal binary load. 1 Quote Link to comment Share on other sites More sharing options...
russg Posted February 21, 2012 Share Posted February 21, 2012 (edited) Thanks, Russ. I remember this program from Antic many years ago. ____ Chamberlin, author (or something like that) according to my rusty memory. (?) (I didn't look it up, if by chance I'm right...) -Larry Right, Craig Chamberlain. It is easy to read the article, if you download the Antic torrent, pdfs and atrs. I'm not going to post the 113 megabyte pdf of the 02/84 Antic. ( I also have the original magazine, but it is easier to look in the torrent and dig it out than dig it out of my Antic boxes.) Edited February 21, 2012 by russg Quote Link to comment Share on other sites More sharing options...
ascrnet Posted July 10, 2018 Share Posted July 10, 2018 (edited) ; Switches on BASIC, re-opens the editor, checks the RBAM and autoruns "AUTORUN.BAS" ; Save executable as "AUTORUN.SYS" ; JAC! - 2010 iocb = $340 ;IOCB base address iocom = iocb+2 ;IOCB command ioadr = iocb+4 ;IOCB buffer address ioaux1 = iocb+10 ;IOCB auxilary byte 1 ioaux2 = iocb+11 ;IOCB auxilary byte 1 ciov = $e456 ;CIO vector open = $03 ;Command: OPEN close = $0c ;Command: CLOSE rw = 12 rwauto = 13 * = $600 start cld clc lda $d301 ;Enable BASIC and #$fd sta $d301 ldx #0 ;Channel 0 lda #close ;Close editor sta iocom,x jsr ciov lda #open ;Open editor to ensure memtop is correct sta iocom,x lda #<editor sta ioadr,x lda #>editor sta ioadr+1,x lda #rw ;read and write sta ioaux1,x lda #0 sta ioaux2,x jsr ciov lda #rwauto ;Switch to automatic input mode sta ioaux1,x lda #0 ;Screen off, will be switch on by the next GRAPHICS statement sta 559 wait lda 20 ;Wait until screen is off cmp 20 beq wait ldx #[lineend-line]-1 ldy #[lineend-line]-1+2 copyline lda line,x sta (88),y dey dex bpl copyline rts editor .byte "E:",$9b ; Disable automatic input mode line .sbyte "POKE 842,12:RUN ",34,"D1:AUTORUN.BAS",34 lineend * = $2e0 .word test Hi JAC!, thanks for your example, I wanted to consult to use it in mads that I have to change? since I made some changes but it does not work, a POKE 842,12:POKE 710,0 is not executed regards Edited July 10, 2018 by ascrnet 2 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted July 10, 2018 Share Posted July 10, 2018 .byte "E:" must be 'E:' instead. * = ... word ... must be run test 1 Quote Link to comment Share on other sites More sharing options...
ascrnet Posted July 11, 2018 Share Posted July 11, 2018 .byte "E:" must be 'E:' instead. * = ... word ... must be run test just change that and I left it like that editor .byte 'E:',$9b line .byte "POKE 842,12:POKE 710,0" lineend run start prints the line in basic and the cursor goes down many times, but the line is not executed. there is my doubt that I am doing wrong or that I am missing. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted July 11, 2018 Share Posted July 11, 2018 Maybe the cursor starts in the 2nd line. Different OS? Will check when I have access to an Atari environment again next week. Quote Link to comment Share on other sites More sharing options...
baktra Posted July 11, 2018 Share Posted July 11, 2018 Shouldn't you disable screen DMA before enabling the BASIC ROM? What if the screen memory or display list happens to be in the A000-BFFF area? Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted July 11, 2018 Share Posted July 11, 2018 I was surprised to see the method of actually patching HATABS in order to redirect E: input via a custom GET routine wasn't mentioned. It's the method used by the SIDE XEX loader and is fairly resilient. 2 Quote Link to comment Share on other sites More sharing options...
ascrnet Posted July 12, 2018 Share Posted July 12, 2018 Maybe the cursor starts in the 2nd line. Different OS? Will check when I have access to an Atari environment again next week. part of the first line, but it does not run. use DOS 2.5 no problem in waiting Quote Link to comment Share on other sites More sharing options...
ascrnet Posted July 12, 2018 Share Posted July 12, 2018 Shouldn't you disable screen DMA before enabling the BASIC ROM? What if the screen memory or display list happens to be in the A000-BFFF area? I deactivated it to see what happened on the screen with the basic I use the A000 memory as recommended. regards Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 14, 2018 Share Posted July 14, 2018 Missing character is because of the direct screen write on top of the cursor, so it gets stomped by the space that's already saved by the Display Handler in OLDCHR. That's a moot issue though because the text needs to be drawn two lines down. Honestly, I wouldn't use direct screen writes, just do one big put command to draw the text and move the cursor back up with control chars. 2 Quote Link to comment Share on other sites More sharing options...
Rybags Posted July 14, 2018 Share Posted July 14, 2018 I really like the HATABS idea that Jon suggested - it sticks to programming etiquette and you could use a counter or special EOF character to instruct the handler to put things back to default. Plus you don't need any screen trickery to hide what's going on. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.