Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2 > #22221 > unrolled thread

Some crude disk image tools

Started bySteve Nickolas <usotsuki@buric.co>
First post2014-10-24 03:29 +0000
Last post2014-10-24 12:05 -0700
Articles 4 — 2 participants

Back to article view | Back to comp.sys.apple2


Contents

  Some crude disk image tools Steve Nickolas <usotsuki@buric.co> - 2014-10-24 03:29 +0000
    Some crude disk image tools Antoine Vignau <antoine.vignau@laposte.net> - 2014-10-24 04:52 -0700
      Re: Some crude disk image tools Steve Nickolas <usotsuki@buric.co> - 2014-10-24 13:52 +0000
        Re: Some crude disk image tools Antoine Vignau <antoine.vignau@laposte.net> - 2014-10-24 12:05 -0700

#22221 — Some crude disk image tools

FromSteve Nickolas <usotsuki@buric.co>
Date2014-10-24 03:29 +0000
SubjectSome crude disk image tools
Message-ID<alpine.DEB.2.02.1410240318230.59485@localhost>
http://3.buric.co/dsktools.dsk.gz

These two tools, MAKE.IMAGE and BURN.IMAGE, are written primarily in BASIC 
and read/write PO disk images of 140K disks.  This is perhaps useful for 
transferring to a high capacity disk to sneakernet to a PC for extraction 
(read: not very useful).

There are 3 short ML routines included in the programs.

Here is the first, the block read wedge:

0000-                        .org      $0300
0300- 20 00 BF     rentry:   jsr       $BF00
0303- 80                     .byte     $80
0304- 11 03                  .word     @3
0306- 90 04                  bcc       @1
0308- A9 FF                  lda       #$FF
030A- D0 02                  bne       @2
030C- A9 00        @1:       lda       #$00
030E- 85 05        @2:       sta       $05
0310- 60                     rts
0311- 03           @3:       .byte     $03
0312- 60                     .byte     $60
0313- 00 80                  .word     $8000
0315- 00 00                  .word     $0000

The second has "81" at 303 instead of "80", and does block writes.

The third checks for a zeroed block, used by Sparse Mode:

0000-                        .org      $0320
0320- A0 00        entry:    ldy       #$00
0322- 84 05                  sty       $05
0324- B9 00 40     @1:       lda       $4000, y
0327- D0 09                  bne       @2
0329- B9 00 41               lda       $4100, y
032C- D0 04                  bne       @2
032E- C8                     iny
032F- D0 F3                  bne       @1
0331- 60                     rts
0332- C6 05        @2:       dec       $05
0334- 60                     rts

An explanation of Sparse Mode: If a block's contents are all $00, it will 
skip writing the block to a file, and those 512 bytes will not be 
allocated in the directory, saving disk space.  This is useful on a 
2-floppy system as you could get some disk images to save despite 
filesystem overhead.  This is the default.

as scanning 512 bytes for 0 is time-consuming in BASIC, I wrote a function 
in ASM to do the work.  Apart from the above functions, everything else is 
written in straight BASIC.

-uso.

[toc] | [next] | [standalone]


#22223

FromAntoine Vignau <antoine.vignau@laposte.net>
Date2014-10-24 04:52 -0700
Message-ID<dda66f71-8107-4f88-8173-04dd78d4ce5e@googlegroups.com>
In reply to#22221
the read and write block mli routines load a block at $8000.
your third routine checks a zeroed block at $4000.

ahem...
av

[toc] | [prev] | [next] | [standalone]


#22224

FromSteve Nickolas <usotsuki@buric.co>
Date2014-10-24 13:52 +0000
Message-ID<alpine.DEB.2.02.1410241351220.61559@localhost>
In reply to#22223
On Fri, 24 Oct 2014, Antoine Vignau wrote:

> the read and write block mli routines load a block at $8000.
> your third routine checks a zeroed block at $4000.
>
> ahem...
> av
>

I know.

If you look at the BASIC code, though, it sets it to 4000 anyway:

310 POKE 786,(S*16)+((D-1)*128):POKE 787,0:POKE 788,64:REM $4000-41FF

-uso.

[toc] | [prev] | [next] | [standalone]


#22230

FromAntoine Vignau <antoine.vignau@laposte.net>
Date2014-10-24 12:05 -0700
Message-ID<ea3d41e5-1ad7-4e7a-82c9-0035bd09b13c@googlegroups.com>
In reply to#22224
Right, thanks. I did not check the BASIC code.
av

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.apple2


csiph-web