save data to disk in assemlby (Development MSX Fora)MSX Resource Center MSX Info Update - Finnish MSX madness at its best           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 114 gasten en 1 MSX vriend online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - save data to disk in assemlby

Schrijver

save data to disk in assemlby

norakomi
msx professional
Berichten: 861
Geplaatst: 11 Oktober 2005, 23:20   
hola !!!

Id like to make save files within an assemlby program.
Lets say there is 6 bytes data at $c000-$c005, which I want to save to:
savefile.dat
how does this work???

Anyone an example I can use.......??

gracias !!!
ARTRAG
msx master
Berichten: 1578
Geplaatst: 11 Oktober 2005, 23:43   
look for the i/o routines in vscreen. The routines you need are
in a nice file well commented and ready to use and can be used
both dos 1 and dos2
norakomi
msx professional
Berichten: 861
Geplaatst: 12 Oktober 2005, 20:52   
I never worked with dos,
Could you tell me some more how to do this without dos?
NYYRIKKI
msx master
Berichten: 1494
Geplaatst: 13 Oktober 2005, 08:35   

Replace all CALL 5 commands with CALL #F37D

norakomi
msx professional
Berichten: 861
Geplaatst: 13 Oktober 2005, 16:30   
What about writing and reading sectors to/from disk....
how does that work?

and when I save a file (in basic for instance)
can I then also choose which sectors the file is saved to???
AuroraMSX

msx master
Berichten: 1224
Geplaatst: 14 Oktober 2005, 14:14   
Quote:

What about writing and reading sectors to/from disk....
how does that work?


Have a look at the DOS2 docz.
There are BDOS functions to read/write a sector.

Quote:

and when I save a file (in basic for instance)
can I then also choose which sectors the file is saved to???


Ehm, you don't want to mix disk access at sector level and disk access at filesystem level, unless you're willing to (re)write part of the OS. Really.

Of course it is possible:

  • read the boot sector and check the media ID byte (or use an other means to locate the FAT
  • remember that a double sided disk has 2 (identical) FATs
  • read the FAT
  • see if the sectors you want to write to are still free
  • create FAT and directory entries for your file
  • Spill the data on the sectors
  • Pray that you didn't make any mistake

But why go through all that trouble? Let BDOS take care of the disk management stuff and just write your data to a regular file.

Besides: directly accessing the disk will definitely make your program unsuitable for hard-disks, CF and/or MMC cards, floppies with other geometry than the one you programmed for etc.

 
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.