Jump to content
IGNORED

data from diskdrive ?


Recommended Posts

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... :twisted:

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 :ponder:

 

Thanks !! :)

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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 !!

Link to comment
Share on other sites

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... :ponder:

 

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 :) )

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...