Thelen Posted August 12, 2009 Share Posted August 12, 2009 I want to make an application that can load from disk and fill 32K of atari memory....The program can choose from disk which 32K block (multiple 32K blocks(files) are on disk) will be copied from diskdrive to atari memory. What will be the most easy way to do that ? Probably it's loading atari DOS, start your app, and then the app has disk acces ? But then, every time i compile my source(on pc, MADS) I have to put the executable on the dos disk, load dos from disk in emu, start app in dos....that is a bunch of work to test the program... Is there a more easy way to do that ? And..is it possible someone can give me a very clear sample program how to copy data from disk ? I really don't know anything about atari sio Thanks !! Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 12, 2009 Share Posted August 12, 2009 Do it on the emulator, you can test much quicker. You need to use CIO, not SIO. A quick USR routine might be best. They can be made relocatable so to fit in a string. All of a couple of dozen bytes or so. Then you can just OPEN a file then use something like A=USR(ADR(CIO$),FILE,START,LENGTH) Quote Link to comment Share on other sites More sharing options...
Thelen Posted August 14, 2009 Author Share Posted August 14, 2009 I tries some programs from Assembly Language Programming for the Atari Computers from atariarchives, but i can't seem to let one work which works with the disk drive... I run dos 2.0s, and I have the program cio1.obx standing on disk. With function "L" I load it, and it starts, but when i look in the emu monitor at adress $0680, there is nothing to see ($00's), and I thought that my own program should be loaded there by my own program : ORG $2E0 ;GIVE RUN ADRESS DTA $00,$80 ORG $8000 ; ***************************** ; First, close and open IOCB2 ; ***************************** LDX #$20 ;for IOCB2 LDA #12 ;close command STA ICCOM,X ; into ICCOM JSR CIOV ;do the CLOSE LDX #$20 ;IOCB2 again LDA #3 ;open file STA ICCOM,X ; is the command LDA #4 ;INPUT STA ICAX1,X ; open for INPUT LDA #NAM&255 ;low byte of device STA ICBAL,X ;points to "P:" LDA #NAM/256 ;high byte STA ICBAH,X LDA #1 STA ICBLH,X ;high byte length LDA #$FF STA ICBLL,X ;>low byte length JSR CIOV ;do the OPEN ; ***************************** ; Now we'll PUT THE MESSAGE INTO RAM ; ***************************** LDX #$20 ;by using IOCB2 LDA #3 ;OPEN record STA ICCOM,X ; command LDA #$80 ;address WHERE STORD LOW STA ICBAL,X ; low byte LDA #$06 ;address WHERE STORD HI STA ICBAH,X ; high byte LDA #1 ;length of MSG STA ICBLH,X ; high byte LDA #$FF ;>length of MSG STA ICBLL,X ; low byte JSR CIOV ;put out the line K INC COLR4 JMP K NAM .BYTE "D1:CIO1.OBX",$9B Probably i'm making an easy mistake I use MADS to compile it to .obx Thanks !! Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 14, 2009 Share Posted August 14, 2009 It's got "ORG $8000" so it'll be at that area. You could essentially get away with using a USR routine that just allows you to pass a call address as well as what you want in the A/X/Y registers. Then you could use it to call practically any OS service. Quote Link to comment Share on other sites More sharing options...
Thelen Posted August 14, 2009 Author Share Posted August 14, 2009 Thank for the qiuck reply ! My program is indeed loaded to location $8000, but what the program does, is open the file CIO1.TXT and store the bytes from that file to start location $0680. But it doesn't work, and i don't know why... I don't understand the USR routine (only knows it from basic- but i need a file load routine for in asm, to use in my asm prog ) Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 14, 2009 Share Posted August 14, 2009 Note that program's not relocatable, ie you need to leave it wherever it's assembled to execute from. And the filename is hardcoded. To keep things simple, you're really best off just doing the OPEN/CLOSE stuff in Basic, just use the Asm routine to do the actual CIO call to read the big piece of data. Quote Link to comment Share on other sites More sharing options...
Thelen Posted August 16, 2009 Author Share Posted August 16, 2009 After a long time trying I finally understand the cio ! (and the files get loaded ! ) Thanks ! Quote Link to comment Share on other sites More sharing options...
ilmenit Posted August 17, 2009 Share Posted August 17, 2009 Hi, To solve the same problem I use Franny to copy data on an ATR. I have a DOS 2.5 disc and my main executable is copied there as autorun.sys, which is automatically started. The precompiled version of Franny for Windows is here. regards, Jakub 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.