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


Groups > comp.sys.apple2.programmer > #3362 > unrolled thread

DOS sector viewer under Prodos

Started bygids.rs@sasktel.net
First post2017-03-12 01:02 -0800
Last post2017-03-21 22:23 -0700
Articles 17 — 6 participants

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


Contents

  DOS sector viewer under Prodos gids.rs@sasktel.net - 2017-03-12 01:02 -0800
    Re: DOS sector viewer under Prodos John Brooks <jbrooks@blueshiftinc.com> - 2017-03-12 08:40 -0700
    DOS sector viewer under Prodos Michael Pohoreski <michael.pohoreski@gmail.com> - 2017-03-15 10:12 -0700
      Re: DOS sector viewer under Prodos gids.rs@sasktel.net - 2017-03-15 17:54 -0700
        Re: DOS sector viewer under Prodos Michael Pohoreski <michael.pohoreski@gmail.com> - 2017-03-15 18:59 -0700
          Re: DOS sector viewer under Prodos John Brooks <jbrooks@blueshiftinc.com> - 2017-03-15 19:59 -0700
            Re: DOS sector viewer under Prodos gids.rs@sasktel.net - 2017-03-16 10:45 -0700
              Re: DOS sector viewer under Prodos gids.rs@sasktel.net - 2017-03-16 11:01 -0700
              Re: DOS sector viewer under Prodos Michael Pohoreski <michael.pohoreski@gmail.com> - 2017-03-17 05:38 -0700
                Re: DOS sector viewer under Prodos gids.rs@sasktel.net - 2017-03-17 11:28 -0700
                  Re: DOS sector viewer under Prodos Antoine Vignau <antoine.vignau@laposte.net> - 2017-03-18 00:36 -0700
                    Re: DOS sector viewer under Prodos gids.rs@sasktel.net - 2017-03-18 03:20 -0700
                      Re: DOS sector viewer under Prodos Steve Nickolas <usotsuki@buric.co> - 2017-03-18 06:29 -0400
                  Re: DOS sector viewer under Prodos Nick Westgate <nick.westgate@gmail.com> - 2017-03-23 16:04 -0700
                    Re: DOS sector viewer under Prodos Michael Pohoreski <michael.pohoreski@gmail.com> - 2017-03-25 15:21 -0700
              Re: DOS sector viewer under Prodos John Brooks <jbrooks@blueshiftinc.com> - 2017-03-21 20:11 -0700
                Re: DOS sector viewer under Prodos gids.rs@sasktel.net - 2017-03-21 22:23 -0700

#3362 — DOS sector viewer under Prodos

Fromgids.rs@sasktel.net
Date2017-03-12 01:02 -0800
SubjectDOS sector viewer under Prodos
Message-ID<25cf59c5-50d8-4878-b03d-a15ff8be07c2@googlegroups.com>
I have always wanted one of these, so I decided to write one.

on the to do list.
make full blown sector editor.
load/store and keep track of different DOS's. (up to 20 so far)
load sectors sequentially in memory and store as a file

Nibble magazine already has a command to LOAD files and CATALOG disk, but would like to implement them in.

Enjouy!

Use arrows or, T or S to change track and sector, ESC quits

REM DOS SECTOR VIEWER

CALL -151
9000:20 FB 91 20 18 92 20 C5 91 20 E5 90 20 53 91 20
9010:1D 90 90 F2 20 8E FD 20 39 FB 4C D0 03 2C 00 C0
9020:10 FB AD 10 C0 C9 B1 F0 25 C9 B2 F0 21 C9 88 F0
9030:36 C9 8B F0 32 C9 95 F0 3F C9 8A F0 3B C9 9B F0
9040:0C 29 DF C9 D4 F0 44 C9 D3 F0 40 D0 D0 60 AD 9B
9050:92 49 80 8D 9B 92 8D 97 92 30 03 A9 B1 2C A9 B2
9060:85 05 68 68 4C 03 90 A6 04 D0 08 A5 03 F0 07 A2
9070:10 C6 03 CA 86 04 18 60 A6 04 E8 E0 10 90 F5 A2
9080:00 E6 03 A5 03 C9 24 90 EB B0 E4 20 8E FD A9 00
9090:20 5B FB A9 08 85 24 8D 7B 05 20 CB 90 B0 25 C9
90A0:03 B0 E8 0A 0A 0A 0A 85 03 20 CB 90 B0 16 05 03
90B0:85 03 C9 23 B0 D5 A9 1B 85 24 8D 7B 05 20 CB 90
90C0:B0 02 85 04 18 60 A9 88 20 ED FD 20 0C FD 20 ED
90D0:FD C9 9B F0 0F 38 E9 B0 90 EC C9 0A 90 06 E9 07
90E0:C9 10 B0 E2 60 20 8E FD A9 00 20 5B FB A9 6A A0
90F0:92 20 3A DB A9 08 85 24 8D 7B 05 A5 03 20 DA FD
9100:A5 03 20 3D 91 A9 0C 85 24 8D 7B 05 A5 02 20 DA
9110:FD A9 1A 85 24 8D 7B 05 A5 04 20 DA FD A5 04 20
9120:3D 91 A9 1E 85 24 8D 7B 05 A5 02 20 DA FD A9 2B
9130:85 24 8D 7B 05 A5 05 20 ED FD 4C 8E FD F8 A2 00
9140:86 02 A0 08 AA 8A 0A AA A5 02 65 02 85 02 88 D0
9150:F4 D8 60 A9 02 20 5B FB A9 05 85 24 8D 7B 05 A2
9160:00 8A 20 DA FD A9 A0 20 ED FD E8 E0 10 90 F2 20
9170:8E FD 20 8E FD A9 00 A6 06 20 41 F9 A9 BA 20 ED
9180:FD A2 10 A0 00 B1 06 20 DA FD A9 A0 20 ED FD C8
9190:CA D0 F2 20 48 F9 A2 10 A0 00 B1 06 F0 0F C9 20
91A0:90 0B 09 80 C9 A0 B0 07 29 1F 09 40 2C A9 AE 20
91B0:ED FD C8 CA D0 E4 20 8E FD 18 A5 06 69 10 85 06
91C0:90 B3 4C 8E FD A5 03 0A 0A 0A 8D 9E 92 A9 00 8D
91D0:9F 92 2E 9F 92 A4 04 B9 3A 92 18 6D 9E 92 8D 9E
91E0:92 20 00 BF 80 9A 92 B0 0A A4 04 A5 74 79 4A 92
91F0:85 07 60 68 68 38 A9 08 4C D0 03 A9 60 8D 9B 92
9200:8D 97 92 20 58 FC A9 B1 85 05 A9 00 85 06 A5 74
9210:8D 9D 92 A9 98 4C ED FD 20 00 BF C5 96 92 C9 52
9220:F0 0F AA 68 68 A9 03 E0 28 F0 02 A9 08 38 4C 09
9230:BE A9 11 85 03 A9 0F 85 04 60 00 07 06 06 05 05
9240:04 04 03 03 02 02 01 01 00 07 00 00 01 00 01 00
9250:01 00 01 00 01 00 01 00 01 01 D4 C9 C1 A0 C2 A0
9260:A0 A0 A0 A0 A0 A0 A0 A0 A0 A0 D4 F2 E1 E3 EB BA
9270:A0 A4 A0 A0 A0 A8 A0 A0 A9 A0 A0 D3 E5 E3 F4 EF
9280:F2 BA A0 A4 A0 A0 A0 A8 A0 A0 A9 A0 A0 A0 C4 F2
9290:E9 F6 E5 BA A0 00 02 00 80 02 03 00 00 00 00 00

BSAVE DOS.SECTOR.VIEW,A$9000,L$2A0

[toc] | [next] | [standalone]


#3363

FromJohn Brooks <jbrooks@blueshiftinc.com>
Date2017-03-12 08:40 -0700
Message-ID<59d8ccae-ac25-418c-b849-951cb52c298f@googlegroups.com>
In reply to#3362
On Sunday, March 12, 2017 at 1:02:46 AM UTC-8, gid...@sasktel.net wrote:
> I have always wanted one of these, so I decided to write one.
> 
> on the to do list.
> make full blown sector editor.
> load/store and keep track of different DOS's. (up to 20 so far)
> load sectors sequentially in memory and store as a file
> 
> Nibble magazine already has a command to LOAD files and CATALOG disk, but would like to implement them in.
> 
> Enjouy!
> 
> Use arrows or, T or S to change track and sector, ESC quits
> 
> REM DOS SECTOR VIEWER
> 
> CALL -151
> 9000:20 FB 91 20 18 92 20 C5 91 20 E5 90 20 53 91 20
> 9010:1D 90 90 F2 20 8E FD 20 39 FB 4C D0 03 2C 00 C0
> 9020:10 FB AD 10 C0 C9 B1 F0 25 C9 B2 F0 21 C9 88 F0
> 9030:36 C9 8B F0 32 C9 95 F0 3F C9 8A F0 3B C9 9B F0
> 9040:0C 29 DF C9 D4 F0 44 C9 D3 F0 40 D0 D0 60 AD 9B
> 9050:92 49 80 8D 9B 92 8D 97 92 30 03 A9 B1 2C A9 B2
> 9060:85 05 68 68 4C 03 90 A6 04 D0 08 A5 03 F0 07 A2
> 9070:10 C6 03 CA 86 04 18 60 A6 04 E8 E0 10 90 F5 A2
> 9080:00 E6 03 A5 03 C9 24 90 EB B0 E4 20 8E FD A9 00
> 9090:20 5B FB A9 08 85 24 8D 7B 05 20 CB 90 B0 25 C9
> 90A0:03 B0 E8 0A 0A 0A 0A 85 03 20 CB 90 B0 16 05 03
> 90B0:85 03 C9 23 B0 D5 A9 1B 85 24 8D 7B 05 20 CB 90
> 90C0:B0 02 85 04 18 60 A9 88 20 ED FD 20 0C FD 20 ED
> 90D0:FD C9 9B F0 0F 38 E9 B0 90 EC C9 0A 90 06 E9 07
> 90E0:C9 10 B0 E2 60 20 8E FD A9 00 20 5B FB A9 6A A0
> 90F0:92 20 3A DB A9 08 85 24 8D 7B 05 A5 03 20 DA FD
> 9100:A5 03 20 3D 91 A9 0C 85 24 8D 7B 05 A5 02 20 DA
> 9110:FD A9 1A 85 24 8D 7B 05 A5 04 20 DA FD A5 04 20
> 9120:3D 91 A9 1E 85 24 8D 7B 05 A5 02 20 DA FD A9 2B
> 9130:85 24 8D 7B 05 A5 05 20 ED FD 4C 8E FD F8 A2 00
> 9140:86 02 A0 08 AA 8A 0A AA A5 02 65 02 85 02 88 D0
> 9150:F4 D8 60 A9 02 20 5B FB A9 05 85 24 8D 7B 05 A2
> 9160:00 8A 20 DA FD A9 A0 20 ED FD E8 E0 10 90 F2 20
> 9170:8E FD 20 8E FD A9 00 A6 06 20 41 F9 A9 BA 20 ED
> 9180:FD A2 10 A0 00 B1 06 20 DA FD A9 A0 20 ED FD C8
> 9190:CA D0 F2 20 48 F9 A2 10 A0 00 B1 06 F0 0F C9 20
> 91A0:90 0B 09 80 C9 A0 B0 07 29 1F 09 40 2C A9 AE 20
> 91B0:ED FD C8 CA D0 E4 20 8E FD 18 A5 06 69 10 85 06
> 91C0:90 B3 4C 8E FD A5 03 0A 0A 0A 8D 9E 92 A9 00 8D
> 91D0:9F 92 2E 9F 92 A4 04 B9 3A 92 18 6D 9E 92 8D 9E
> 91E0:92 20 00 BF 80 9A 92 B0 0A A4 04 A5 74 79 4A 92
> 91F0:85 07 60 68 68 38 A9 08 4C D0 03 A9 60 8D 9B 92
> 9200:8D 97 92 20 58 FC A9 B1 85 05 A9 00 85 06 A5 74
> 9210:8D 9D 92 A9 98 4C ED FD 20 00 BF C5 96 92 C9 52
> 9220:F0 0F AA 68 68 A9 03 E0 28 F0 02 A9 08 38 4C 09
> 9230:BE A9 11 85 03 A9 0F 85 04 60 00 07 06 06 05 05
> 9240:04 04 03 03 02 02 01 01 00 07 00 00 01 00 01 00
> 9250:01 00 01 00 01 00 01 00 01 01 D4 C9 C1 A0 C2 A0
> 9260:A0 A0 A0 A0 A0 A0 A0 A0 A0 A0 D4 F2 E1 E3 EB BA
> 9270:A0 A4 A0 A0 A0 A8 A0 A0 A9 A0 A0 D3 E5 E3 F4 EF
> 9280:F2 BA A0 A4 A0 A0 A0 A8 A0 A0 A9 A0 A0 A0 C4 F2
> 9290:E9 F6 E5 BA A0 00 02 00 80 02 03 00 00 00 00 00
> 
> BSAVE DOS.SECTOR.VIEW,A$9000,L$2A0

Great idea. Thanks!

-JB
@JBrooksBSI

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


#3372

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2017-03-15 10:12 -0700
Message-ID<f40e24d5-0689-481e-9730-6a20c22b96af@googlegroups.com>
In reply to#3362
Not bad !

I *really* like the fact that you can see ALL 256 bytes in the sector.

Any chance of throwing the source of GitHub? That way we can:

* Fix bugs -- i.e. you don't set 80-col mode, you don't disable MouseText, etc.
* Add features -- Add a cursor, make it agDOStic so it works without any DOS loaded, etc.

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


#3375

Fromgids.rs@sasktel.net
Date2017-03-15 17:54 -0700
Message-ID<7897053c-f519-4638-b8f2-306cf4c340f6@googlegroups.com>
In reply to#3372
On Wednesday, March 15, 2017 at 11:12:53 AM UTC-6, Michael Pohoreski wrote:
> Not bad !
> 
> I *really* like the fact that you can see ALL 256 bytes in the sector.
> 
> Any chance of throwing the source of GitHub? That way we can:
> 
> * Fix bugs -- i.e. you don't set 80-col mode, you don't disable MouseText, etc.
> * Add features -- Add a cursor, make it agDOStic so it works without any DOS loaded, etc.



Oh!  those aren't bugs.  My default modes are 80-col on and mousetext off.  ":)

Sorry!  Dont have source.  You will have to make your own.  I just used a combination of the mini-assembler and monitor.

This was a Nibble Magazine program that cataloged a Dos disk.  At the time I just wanted something quick and dirty and it was small enough that I didn't enter the source or convert the ML to source, so just edited the ML code.

The notes and remarks are in the Nibble magazine.  
The program is called "Prodos Linker" out of Nibble Express XI.

The hex dump routine display is also out of Nibble magazine from the two-minute programs magazine.  This program was easier and quicker to patch together than to enter into a word processor.

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


#3376

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2017-03-15 18:59 -0700
Message-ID<c21fcee1-82b5-49e0-98ac-ab61a7d27cfe@googlegroups.com>
In reply to#3375
And here I thought I was the last mini-assembler hold-out. =P That's hardcore.

Thanks for the details -- I can reverse engineer this pretty easily and throw together an asm .S source file soon(ish).

Guess I should add a nibble dump track utility that supports scrolling as well.

Basically the poor man's Copy ][+ disk utils but with some customizations.

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


#3378

FromJohn Brooks <jbrooks@blueshiftinc.com>
Date2017-03-15 19:59 -0700
Message-ID<7439dfff-13c8-430b-9258-1544a8cdb6f0@googlegroups.com>
In reply to#3376
Thanks for the util Rob! It's a great idea.

I used Merlin's Sourceror tool to to create a source file a couple days ago. I'll finish adding labels and then put it on a disk image for others to look at/use/modify.

BTW, here are notes on a few rough patches I found while using & disassembling the program:

1) It reads keyboard input via $C010 which will fail on an Apple II & II+ (//e & later feature)

2) When entering trk/sec input, it prints the key char before checking that it is valid, so pressing the right-arrow key switches to 40 column display on the GS.

3) There are some unused bytes after the code and before the Trk/Sec/Drv text.

4) Pressing "1" will toggle to drive 2. If no disk is in drive 2, the program will abort with an I/O error.

-JB
@JBrooksBSI

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


#3379

Fromgids.rs@sasktel.net
Date2017-03-16 10:45 -0700
Message-ID<ad08c344-a314-4b66-8ff0-dec76bad3cfa@googlegroups.com>
In reply to#3378
On Wednesday, March 15, 2017 at 8:59:54 PM UTC-6, John Brooks wrote:
> Thanks for the util Rob! It's a great idea.
> 
> I used Merlin's Sourceror tool to to create a source file a couple days ago. I'll finish adding labels and then put it on a disk image for others to look at/use/modify.
> 
> BTW, here are notes on a few rough patches I found while using & disassembling the program:
> 
> 1) It reads keyboard input via $C010 which will fail on an Apple II & II+ (//e & later feature)
> 
> 2) When entering trk/sec input, it prints the key char before checking that it is valid, so pressing the right-arrow key switches to 40 column display on the GS.
> 
> 3) There are some unused bytes after the code and before the Trk/Sec/Drv text.
> 
> 4) Pressing "1" will toggle to drive 2. If no disk is in drive 2, the program will abort with an I/O error.
> 
> -JB
> @JBrooksBSI


It definitely is much easier to edit source.

The unused bytes were supposed to be the file types "TIABSRAB" for Dos.  I think I put them in the right order.

Just some quick notes if you plan on making this into an sector editor.

The blocks that are read or written must come in 2 sector pairs and they are out of order for Dos.

Block #0 = sectors 0 and $E
#1 = $C and $D
#2 = $A and $B
#3 = 8 and 9
#4 = 6 and 7
#5 = 4 and 5
#6 = 2 and 3
#7 = 1 and $F

All the sectors listed 2nd here, are in the 2nd half of the block, or page 2 of the buffer.

When editing a sector at a time and writing it back to disk, just be aware that the sectors' corresponding pair is also being written back to disk and that it is not accidentally changed in any way.


I originally started this to view a disk that was downloaded from the internet and unable to catalog or load a file that I wanted due to some bytes inserted into the disk image.  With this utility I could go to a sector, then exit, move the dump to a contiguous part of memory and go back to the utility for another sector.  Before long I had the file in memory and could save it to Prodos.

Since then I have come across over 20 different versions of DOS on DOS disks.  I thought it might be cool to be able to store those DOS's on a Prodos disk and create a DOS disk with the DOS of choice as needed.

An excellent source for the breakdown of the DOS structure can be found here.

www.stason.org/tularc/pc/apple2/faq
see part VI

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


#3380

Fromgids.rs@sasktel.net
Date2017-03-16 11:01 -0700
Message-ID<52edcc87-e7cd-481d-a6cf-4397260ef3b6@googlegroups.com>
In reply to#3379
Another idea of using this utility could be to store .dsk disk images on a Prodos disk and be able to catalog them.

If the Dos disk image was saved as a sparse file under prodos, then the disk image could be quite small in some cases.

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


#3381

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2017-03-17 05:38 -0700
Message-ID<81867dfa-fdbd-4775-985b-7d6544a41e4f@googlegroups.com>
In reply to#3379
> Since then I have come across over 20 different versions of DOS on DOS disks.

You wouldn't happen a list by chance? TIA.

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


#3382

Fromgids.rs@sasktel.net
Date2017-03-17 11:28 -0700
Message-ID<e73e6122-1659-41f5-97f6-be6f2fcc72b0@googlegroups.com>
In reply to#3381
On Friday, March 17, 2017 at 6:38:52 AM UTC-6, Michael Pohoreski wrote:
> > Since then I have come across over 20 different versions of DOS on DOS disks.
> 
> You wouldn't happen a list by chance? TIA.

Other DOS's besides the original Dos Master from Apple

ADos
AMDos
Amperdos
david_dos
diversi dos
Dos 3.4
ESDos
ics dos
Legend QDos
LEK Dos
Nibble Magazine Enhancements for Dos
Oz Dos
Pig Dos
Pronto Dos
Rdos
S&H Dos
Sandys FDos
SBD dos
Sider Dos
Star Dos
UNI Dos
US Dos
ZDos

These should all be Dos 3.3 clones, and not Prodos.  Feel free to add to the list if missing any.

A couple look to may be just personalized versions of DOS but probably don't have a lot of enhancements.

Anyone wanting a copy of all of them in a zip file, send me an email so I have something to reply to.

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


#3383

FromAntoine Vignau <antoine.vignau@laposte.net>
Date2017-03-18 00:36 -0700
Message-ID<51f7a046-9e7d-42fe-9abf-6f457e56217c@googlegroups.com>
In reply to#3382
If RDOS is Roland G.'s DOS, then it is not a DOS 3.3 clone, otherwise I do not know that DOS 3.3 version.
Antoine

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


#3384

Fromgids.rs@sasktel.net
Date2017-03-18 03:20 -0700
Message-ID<23edf90e-1987-4106-9155-ea59d815ab44@googlegroups.com>
In reply to#3383
On Saturday, March 18, 2017 at 1:36:11 AM UTC-6, Antoine Vignau wrote:
> If RDOS is Roland G.'s DOS, then it is not a DOS 3.3 clone, otherwise I do not know that DOS 3.3 version.
> Antoine


The disk is DOS and the name is called RDOSSTOS.DSK and this is what the HELLO program states.

40  PRINT "STOS 1.9.1 IS RESIDENT IN HIGH MEMORY.  RDOS 3.3 IS RESIDENT IN LOW MEMORY."

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


#3385

FromSteve Nickolas <usotsuki@buric.co>
Date2017-03-18 06:29 -0400
Message-ID<alpine.BSF.2.02.1703180628280.22303@frieza.hoshinet.org>
In reply to#3384
On Sat, 18 Mar 2017, gids.rs@sasktel.net wrote:

> On Saturday, March 18, 2017 at 1:36:11 AM UTC-6, Antoine Vignau wrote:
>> If RDOS is Roland G.'s DOS, then it is not a DOS 3.3 clone, otherwise I do not know that DOS 3.3 version.
>> Antoine
>
>
> The disk is DOS and the name is called RDOSSTOS.DSK and this is what the HELLO program states.
>
> 40  PRINT "STOS 1.9.1 IS RESIDENT IN HIGH MEMORY.  RDOS 3.3 IS RESIDENT IN LOW MEMORY."
>
>

Didn't realize that disk was out in the wild. o.O

RDOS is Roland Gustafsson's RDOS, and STOS is just a bunch of hacks I dug 
up on various parts of the Internet (mostly AAL) and applied to DOS 3.3 
myself.

-uso.

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


#3396

FromNick Westgate <nick.westgate@gmail.com>
Date2017-03-23 16:04 -0700
Message-ID<298d2813-ec35-49a0-bc28-f568430cd1a6@googlegroups.com>
In reply to#3382
On Saturday, 18 March 2017 07:28:05 UTC+13, gid...@sasktel.net  wrote:
> AMDos

Perhaps this should be written AmDOS if it's Gary Little's one here:
http://www.textfiles.com/apple/DOCUMENTATION/amdos.info

He mentioned it in passing in this open-apple podcast interview:
http://www.open-apple.net/2014/09/30/show-039-gary-b-little-new-segments-apple-iic-cards/

Cheers,
Nick.

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


#3399

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2017-03-25 15:21 -0700
Message-ID<357471cf-6278-4e96-a2ee-612fd42f83e7@googlegroups.com>
In reply to#3396
I thought DOS 3.3 was the amateur DOS ? :-)

*rimshot*

Still that info. is much appreciated !

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


#3388

FromJohn Brooks <jbrooks@blueshiftinc.com>
Date2017-03-21 20:11 -0700
Message-ID<af65e079-3b96-4459-b8a9-6efcf50e864c@googlegroups.com>
In reply to#3379
On Thursday, March 16, 2017 at 10:45:10 AM UTC-7, gid...@sasktel.net wrote:
> On Wednesday, March 15, 2017 at 8:59:54 PM UTC-6, John Brooks wrote:
> > Thanks for the util Rob! It's a great idea.
> > 
> > I used Merlin's Sourceror tool to to create a source file a couple days ago. I'll finish adding labels and then put it on a disk image for others to look at/use/modify.
> > 
> > BTW, here are notes on a few rough patches I found while using & disassembling the program:
> > 
> > 1) It reads keyboard input via $C010 which will fail on an Apple II & II+ (//e & later feature)
> > 
> > 2) When entering trk/sec input, it prints the key char before checking that it is valid, so pressing the right-arrow key switches to 40 column display on the GS.
> > 
> > 3) There are some unused bytes after the code and before the Trk/Sec/Drv text.
> > 
> > 4) Pressing "1" will toggle to drive 2. If no disk is in drive 2, the program will abort with an I/O error.
> > 
> > -JB
> > @JBrooksBSI
> 
> 
> It definitely is much easier to edit source.
> 
> The unused bytes were supposed to be the file types "TIABSRAB" for Dos.  I think I put them in the right order.
> 
> Just some quick notes if you plan on making this into an sector editor.
> 
> The blocks that are read or written must come in 2 sector pairs and they are out of order for Dos.
> 
> Block #0 = sectors 0 and $E
> #1 = $C and $D
> #2 = $A and $B
> #3 = 8 and 9
> #4 = 6 and 7
> #5 = 4 and 5
> #6 = 2 and 3
> #7 = 1 and $F
> 
> All the sectors listed 2nd here, are in the 2nd half of the block, or page 2 of the buffer.
> 
> When editing a sector at a time and writing it back to disk, just be aware that the sectors' corresponding pair is also being written back to disk and that it is not accidentally changed in any way.
> 
> 
> I originally started this to view a disk that was downloaded from the internet and unable to catalog or load a file that I wanted due to some bytes inserted into the disk image.  With this utility I could go to a sector, then exit, move the dump to a contiguous part of memory and go back to the utility for another sector.  Before long I had the file in memory and could save it to Prodos.
> 
> Since then I have come across over 20 different versions of DOS on DOS disks.  I thought it might be cool to be able to store those DOS's on a Prodos disk and create a DOS disk with the DOS of choice as needed.
> 
> An excellent source for the breakdown of the DOS structure can be found here.
> 
> www.stason.org/tularc/pc/apple2/faq
> see part VI

Below is my disassembly of the util. I'll also upload a disk image with the source & bin soon.

-JB
@JBrooksBSI

*-------------------------------
* Created by gids.rs@sasktel.net
* and various Nibble authors
*
* Disassembly by John Brooks
* 12-Mar-2017
*-------------------------------

            lst     off

            org     $9000

MaxTrack    =       35

            dum     2
ZpDec       ds      1
ZpTrk       ds      1
ZpSec       ds      1
ZpDrive     ds      1
ZpPtr       ds      2
            dend
ZpCh        =       $24
ZpHimem     =       $73

VolName     =       $0280
DosSoft     =       $03D0
Ch80        =       $057B
P8ErrOut    =       $BE09
P8Mli       =       $BF00
IoKbd       =       $C000
IoKbdStb    =       $C010
RmStrOut    =       $DB3A
RmPrntAX    =       $F941
RmPrBlnk    =       $F948
RmSetTxt    =       $FB39
RmTabV      =       $FB5B
RmHome      =       $FC58
RmRdKey     =       $FD0C
RmCrOut     =       $FD8E
RmPrByte    =       $FDDA
RmCOut      =       $FDED

*-------------------------------
SecView
            jsr     Init
NewDrv      jsr     ChkDrv
:Loop       jsr     ReadBlk
            jsr     ShowHdr
            jsr     ShowSec
            jsr     GetKey
            bcc     :Loop

            jsr     RmCrOut
            jsr     RmSetTxt
            jmp     DosSoft

*-------------------------------
GetKey      bit     IoKbd
            bpl     GetKey
            lda     IoKbdStb
            cmp     #"1"
            beq     NewDrive
            cmp     #"2"
            beq     NewDrive
            cmp     #$88
            beq     DecSec
            cmp     #$8B
            beq     DecSec
            cmp     #$95
            beq     IncSec
            cmp     #$8A
            beq     IncSec
            cmp     #$9B
            beq     :Exit
            and     #$DF
            cmp     #"T"
            beq     SetTrkSec
            cmp     #"S"
            beq     SetTrkSec
            bne     GetKey          ;Always

:Exit       rts

*-------------------------------
NewDrive    lda     BlkUnit
            eor     #$80
            sta     BlkUnit
            sta     VolUnit
            bmi     :Drive2
            lda     #"1"
            hex     2C              ;bit
:Drive2     lda     #"2"
            sta     ZpDrive
            pla
            pla
            jmp     NewDrv

*-------------------------------
DecSec      ldx     ZpSec
            bne     DoDecSec
            lda     ZpTrk
            beq     SecExit
DecWrap     ldx     #16
            dec     ZpTrk
DoDecSec    dex
PutSec      stx     ZpSec
SecExit     clc
            rts

IncSec      ldx     ZpSec
            inx
            cpx     #16
            bcc     PutSec
            ldx     #0
            inc     ZpTrk
            lda     ZpTrk
            cmp     #MaxTrack+1
            bcc     PutSec
            bcs     DecWrap         ;Always

*-------------------------------
SetTrkSec
            jsr     RmCrOut
            lda     #0
            jsr     RmTabV
            lda     #8
            sta     ZpCh
            sta     Ch80
            jsr     GetHex
            bcs     :Exit
            cmp     #3
            bcs     SetTrkSec
            asl
            asl
            asl
            asl
            sta     ZpTrk
            jsr     GetHex
            bcs     :Exit
            ora     ZpTrk
            sta     ZpTrk
            cmp     #MaxTrack
            bcs     SetTrkSec
            lda     #27
            sta     ZpCh
            sta     Ch80
            jsr     GetHex
            bcs     :Exit
            sta     ZpSec
:Exit       clc
            rts

*-------------------------------
BadDigit    lda     #$88
            jsr     RmCOut

*--------
GetHex      jsr     RmRdKey
            jsr     RmCOut
            cmp     #$9B
            beq     :Exit
            sec
            sbc     #"0"
            bcc     BadDigit
            cmp     #10
            bcc     :Exit
            sbc     #7
            cmp     #16
            bcs     BadDigit
:Exit       rts

*-------------------------------
ShowHdr     jsr     RmCrOut
            lda     #0
            jsr     RmTabV
            lda     ##<HdrText
            ldy     #>HdrText
            jsr     RmStrOut
            lda     #8
            sta     ZpCh
            sta     Ch80
            lda     ZpTrk
            jsr     RmPrByte
            lda     ZpTrk
            jsr     Bin2Dec
            lda     #12
            sta     ZpCh
            sta     Ch80
            lda     ZpDec
            jsr     RmPrByte
            lda     #26
            sta     ZpCh
            sta     Ch80
            lda     ZpSec
            jsr     RmPrByte
            lda     ZpSec
            jsr     Bin2Dec
            lda     #30
            sta     ZpCh
            sta     Ch80
            lda     ZpDec
            jsr     RmPrByte
            lda     #43
            sta     ZpCh
            sta     Ch80
            lda     ZpDrive
            jsr     RmCOut
            jmp     RmCrOut

*-------------------------------
Bin2Dec     sed
            ldx     #0
            stx     ZpDec
            ldy     #8
            tax
:Loop       TXA
            asl
            tax
            lda     ZpDec
            adc     ZpDec
            sta     ZpDec
            dey
            bne     :Loop
            cld
            rts

*-------------------------------
ShowSec     lda     #2
            jsr     RmTabV
            lda     #5
            sta     ZpCh
            sta     Ch80
            ldx     #0
:ColHdr     TXA
            jsr     RmPrByte
            lda     #" "
            jsr     RmCOut
            inx
            cpx     #16
            bcc     :ColHdr
            jsr     RmCrOut
            jsr     RmCrOut
:DoRow      lda     #0
            ldx     ZpPtr
            jsr     RmPrntAX
            lda     #":"
            jsr     RmCOut
            ldx     #16
            ldy     #0
:NibLoop    lda     (ZpPtr),Y
            jsr     RmPrByte
            lda     #" "
            jsr     RmCOut
            iny
            dex
            bne     :NibLoop
            jsr     RmPrBlnk
            ldx     #16
            ldy     #0
:AscLoop    lda     (ZpPtr),Y
            beq     :BadAsc
            cmp     #' '
            bcc     :BadAsc
            ora     #$80
            cmp     #" "
            bcs     :ShowAsc
            and     #$1F
            ora     #$40
            hex     2C              ;bit
:BadAsc     lda     #"."
:ShowAsc    jsr     RmCOut
            iny
            dex
            bne     :AscLoop
            jsr     RmCrOut
            clc
            lda     ZpPtr
            adc     #16
            sta     ZpPtr
            bcc     :DoRow
            jmp     RmCrOut

*-------------------------------
ReadBlk     lda     ZpTrk
            asl
            asl
            asl
            sta     BlkNum
            lda     #0
            sta     BlkNum+1
            rol     BlkNum+1
            ldy     ZpSec
            lda     Sec2Blk,Y
            clc
            adc     BlkNum
            sta     BlkNum

            jsr     P8Mli
            dfb     $80
            da      RdBlkParam
            bcs     :ReadErr
            ldy     ZpSec
            lda     ZpHimem+1
            adc     Sec2Pag,Y
            sta     ZpPtr+1
            rts

:ReadErr    pla
            pla
            sec
            lda     #8
            jmp     DosSoft

*-------------------------------
Init        lda     #$60
            sta     BlkUnit
            sta     VolUnit
            jsr     RmHome
            lda     #"1"
            sta     ZpDrive
            lda     #0
            sta     ZpPtr
            lda     ZpHimem+1
            sta     BlkDest+1
            lda     #$98
            jmp     RmCOut

*-------------------------------
ChkDrv      jsr     P8Mli
            dfb     $C5
            da      VolParam
            cmp     #$52
            beq     :DrvOk
            tax
            pla
            pla
            lda     #3
            cpx     #$28
            beq     :Skip
            lda     #8
:Skip       sec
            jmp     P8ErrOut

:DrvOk      lda     #$11
            sta     ZpTrk
            lda     #$0F
            sta     ZpSec
            rts

*-------------------------------
Sec2Blk     hex     00,07,06,06
            hex     05,05,04,04
            hex     03,03,02,02
            hex     01,01,00,07

Sec2Pag     hex     00,00,01,00
            hex     01,00,01,00
            hex     01,00,01,00
            hex     01,00,01,01

*-------------------------------
            do      1
            asc     "TIA B           "  ;Unused
            fin

*-------------------------------
HdrText
            asc     "Track: $   (  )  Sector: $   (  )   Drive: ",00

*-------------------------------
VolParam    hex     02
VolUnit     hex     00
            da      VolName

RdBlkParam
            hex     03
BlkUnit     hex     00
BlkDest     da      0
BlkNum      da      0

            lst     off

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


#3389

Fromgids.rs@sasktel.net
Date2017-03-21 22:23 -0700
Message-ID<91a18194-53b6-466c-b0ea-ac31f487aa30@googlegroups.com>
In reply to#3388
> 
> *-------------------------------
> NewDrive    lda     BlkUnit
>             eor     #$80
>             sta     BlkUnit
>             sta     VolUnit
>             bmi     :Drive2
>             lda     #"1"
>             hex     2C              ;bit
> :Drive2     lda     #"2"
>             sta     ZpDrive
>             pla
>             pla
>             jmp     NewDrv
> 
> *-------------------------------


I had made some changes since then.
For NewDrive, change to this to get the "1" and "2" keys to work.


NewDrive sta ZpDrive
         tax
         lda BlkUnit
         asl
         cpx #$b2
         ror
         sta BlkUnit
         sta VolUnit
         pla
         pla
         jmp NewDrv




Since then I have also added the ability to load DOS (tracks 0, 1 and 2) to memory and save as a Prodos file and load the DOS file from a Prodos disk and write back to tracks 0, 1 and 2.

Anyone with a little bit of knowledge of source code can do this.

The key information to note is the Sector to Blocks conversion

Looking at the Sec2Blk line, as you can see block #0 will load sectors 0 and $E, with sector 0 being in the first page of memory, and sector $E is in the second page of memory.  Block #1 will load sectors $D and $C, and so on.


sector      hex     00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F

Sec2Blk     hex     00,07,06,06,05,05,04,04,03,03,02,02,01,01,00,07

Sec2Pag     hex     00,00,01,00,01,00,01,00,01,00,01,00,01,00,01,01



Reading the entire Dos Track will put the sectors in this order in memory.

  00,0E,0D,0C,0B,0A,09,08,07,06,05,04,03,02,01,0F


If all you want to do is save the DOS file to a Prodos disk and write it back
to a Dos disk, then this order is a must.

But if you wish to make a source listing or ML listing, then you will have to put the pages in memory in order.  Page 1 will have to be swapped with Page $E, Page 2 with $D, Page 3 with $C and so on.

It looks like DOS is saved with the sectors in order from 0-$F, where as the save order for the files themselves are usually in reverse order, sector $F to 0, but is still really at the mercy of the t/s list.


I have half a mind to store a program on a DOS disk and write the t/s list so that the sectors read forward from 0-$F and the tracks also read forward, just to see what the sound of the floppy drive sounds like.  :)

[toc] | [prev] | [standalone]


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


csiph-web