Program Power Programmer's Toolbox ROM

discussion of games, software, hardware & emulators relating to the Acorn Atom and Acorn System machines.
Post Reply
User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Program Power Programmer's Toolbox ROM

Post by hoglet » Wed Apr 04, 2018 11:04 am

Program Power Programmer's Toolbox ROM

We now have many (at least five) versions of this ROM.
pp_toolbox.zip
(51.96 KiB) Downloaded 18 times
It would be nice to decide which is the most recent original version.

Here are some notes...

1) with CRC 6C9E called PROGRAMMER'S TOOLKIT but with the (C) message replaced by spaces
(this came from MAME, sha1sum faa0394232caf7626499c9bc57c6af36017fe852)
(also here: http://www.acornatom.nl/atomarch/Acl2-05/Pp-tk)
(also here: http://www.acornatom.nl/atomarch/An90-02/Toolkit.r)
(also here: http://www.acornatom.nl/sites/fpga/www. ... n_roms.zip)
(also here: https://fjkraan.home.xs4all.nl/comp/atom/)
(also here: viewtopic.php?p=76228#p76228)

2) with CRC 6B06 called PROGRAMMER'S TOOLBOX but with the (C) message removed
(this came from Phill, identical to 6C9E apart from the name/(C) message differences)
(also present on a disk called toolbox_roms.40t)
(also here: viewtopic.php?p=76228#p76228)

3) with CRC 660E called PROGRAMMER'S TOOLBOX (C) PROGRAM POWER
(this came from MAME, sha1sum b80736c7a63152d89e66b9848e197b54f698aedc)

4) with CRC 1904 called PROGRAMMER'S TOOLBOX (C) PROGRAM POWER
(this came from John Ferguson here)

5) with CRC 0D78 called PROGRAMMER'S TOOLBOX (C) PROGRAM POWER
(this came from http://www.acornatom.nl/atomarch/dd-14/Toolkit)
(most different from all the others, so could a later version)
(possible one or two corruptions at the end)

It might be interesting to delve into what some of the non-cosmetic differences are.

viewtopic.php?p=76204#p76204
herklots wrote:The Toolkit ROM ("LINK #AF00 or LINK 44800. The screen will clear and the message PROGRAMMERS TOOLKIT will be displayed") was written I believe by Jim Baker and sold first by him and then Program Power as Programmers Toolbox. The ROMS are identical apart from the initiation message (kit versus box). I have both sets of ROMs and instructions if you don't have 'em...
Some photos of the original Program Power documentation here:
http://www.demsamys.talktalk.net

Dave
Last edited by hoglet on Thu Apr 05, 2018 12:37 pm, edited 3 times in total.

User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by hoglet » Wed Apr 04, 2018 12:28 pm

Difference # 1

Code: Select all

0D78.hex:00000cd0  3c 03 99 57 03 99 72 03  88 d0 f1 60 c5 0d d0 06  |<..W..r....`....|
1904.hex:00000cd0  3c 03 99 57 03 99 72 03  88 10 f1 60 c5 0d d0 06  |<..W..r....`....|
660E.hex:00000cd0  3c 03 99 57 03 99 72 03  88 d0 f1 60 c5 0d d0 06  |<..W..r....`....|
6B06.hex:00000cd0  3c 03 99 57 03 99 72 03  88 d0 f1 60 c5 0d d0 06  |<..W..r....`....|
6C9E.hex:00000cd0  3c 03 99 57 03 99 72 03  88 d0 f1 60 c5 0d d0 06  |<..W..r....`....|
Location #ACD9 is 10 (BPL) in version "1904" and D0 (BNE) in all other versions. This affects the behaviour of the ZERO command. In "1904" it also zeros the @ variable, which is inconsistent with the documentation (which states A-Z are cleared).

Difference # 2

Code: Select all

0D78.hex:00000f60  c4 d2 4c 45 7f c4 d3 c4  cb 45 44 7f d8 c4 4b 4e  |..LE.....ED...KN|
1904.hex:00000f60  c4 d2 4c 45 7f c4 cb c4  cb 45 44 7f d8 c4 4b 4e  |..LE.....ED...KN|
660E.hex:00000f60  c4 d2 4c 45 7f c4 d3 c4  cb 45 44 7f d8 c4 4b 4e  |..LE.....ED...KN|
6B06.hex:00000f60  c4 d2 4c 45 7f c4 d3 c4  cb 45 44 7f d8 c4 4b 4e  |..LE.....ED...KN|
6C9E.hex:00000f60  c4 d2 4c 45 7f c4 d3 c4  cb 45 44 7f d8 c4 4b 4e  |..LE.....ED...KN|
Location #AF66 is CB in version "1904" and D3 in all other versions. I think this was a typo in the name of the DELETE command, making it DELELE in "1904".

Difference # 3

Code: Select all

0D78.hex:000004b0  26 b0 08 20 31 c2 e6 04  20 65 c4 4c e4 c4 20 dd  |&.. 1... e.L.. .|
1904.hex:000004b0  26 b0 08 20 31 c2 e6 04  20 65 c4 20 e4 c4 60 ff  |&.. 1... e. ..`.|
660E.hex:000004b0  26 b0 08 20 31 c2 e6 04  20 65 c4 4c e4 c4 20 dc  |&.. 1... e.L.. .|
6B06.hex:000004b0  26 b0 08 20 31 c2 e6 04  20 65 c4 20 e4 c4 60 ff  |&.. 1... e. ..`.|
6C9E.hex:000004b0  26 b0 08 20 31 c2 e6 04  20 65 c4 20 e4 c4 60 ff  |&.. 1... e. ..`.|
Two bytes are saved in versions "0D78" and "660E" (replacing JSR #C4E4;RTS with JMP #C4E4, which allows the following code (TRACE I think) to start as #A4BE rather than #A4C0. This is probably to allow a bug to be fixed.
Last edited by hoglet on Wed Apr 04, 2018 5:00 pm, edited 1 time in total.

User avatar
oss003
Posts: 2797
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by oss003 » Wed Apr 04, 2018 2:07 pm

The original ROM should be called at #AF00 and should display the (C) PROGRAM POWER string.
This means that versions 6C9E and CB06 aren't original.

The state of @ shouldn't be affected so version 1904 also isn't original.

Missing the RESTORE command is also wrong so version 0D78 is also changed.

This leaves version 660E ......

Greetings
Kees

User avatar
oss003
Posts: 2797
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by oss003 » Wed Apr 04, 2018 2:17 pm

I also noticed this one, don't know if you already have it.

Greetings
Kees
Attachments
Toolkit.zip
(19.62 KiB) Downloaded 16 times

User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by hoglet » Wed Apr 04, 2018 2:30 pm

oss003 wrote:I also noticed this one, don't know if you already have it.
Where did you find this version?

That is actually the 0D78 version, which is the most unusual and has some corruptions I think. For example, the last byte is FF and should be 46 ("F") so the FIND command doesn't work. Also KEY has been modified to KEI, which looks like a 1-bit error rather than a deliberate change.

User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by hoglet » Wed Apr 04, 2018 2:36 pm

oss003 wrote:Missing the RESTORE command is also wrong so version 0D78 is also changed.
I was wrong about this, it does actually have the RESTORE command, and it works.

Dave

User avatar
oss003
Posts: 2797
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by oss003 » Wed Apr 04, 2018 2:36 pm

I found it somewhere in my rom repository.....

User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by hoglet » Wed Apr 04, 2018 2:40 pm

oss003 wrote:The original ROM should be called at #AF00 and should display the (C) PROGRAM POWER string.
This means that versions 6C9E and CB06 aren't original.
Agreed.
oss003 wrote: The state of @ shouldn't be affected so version 1904 also isn't original.
I expect this was a bug, so this is probably an earlier version.
oss003 wrote: Missing the RESTORE command is also wrong so version 0D78 is also changed.
I was wrong about RESTORE, it is there.

But there are lots of other differences.
oss003 wrote: This leaves version 660E ......
This does seem to be the best version, but I'm still struggling to decide if 0D78 is earlier than this or later.

Dave

User avatar
1024MAK
Posts: 8110
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by 1024MAK » Wed Apr 04, 2018 4:19 pm

So which, if any of these is the version allegedly written and distributed by Jim Baker before Program Power started distributing it?

The versions where the area for the copyright message is filled with spaces, do look like copies. But are the spaces replacing the Program Power copyright message or a Jim Baker copyright message?

Mark

User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by hoglet » Wed Apr 04, 2018 4:48 pm

1024MAK wrote:So which, if any of these is the version allegedly written and distributed by Jim Baker before Program Power started distributing it?

The versions where the area for the copyright message is filled with spaces, do look like copies. But are the spaces replacing the Program Power copyright message or a Jim Baker copyright message?
Actually, if there is a version that Jim distributed before Program Power did, then I don't think we have it.

The two versions with modified copyrights (6C9E and 6B06) look like they are derived from 1904, and that has a Program Power copyright.

User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by hoglet » Wed Apr 04, 2018 5:35 pm

I'm still trying to work out whether 0D78 is earlier or later than the other versions, as there are quite a few non-cosmetic differences. I'm starting to think it's later, but has a couple of bytes of corruption (which we can easily fix).

I've got disassemblies of 660E and 0D78:
pp_toolbox.zip
(21.49 KiB) Downloaded 14 times
Here's a difference in the VECTOR command:

660E

Code: Select all

        LDX     #$00
        STX     L0004
        JSR     LC8BC

        LDA     L0025
        ORA     L0034
        ORA     L0043
        BNE     LAD74

        LDA     L0016
        CMP     #$02
        BCS     LAD74

.LAD62
        ASL     A
        ASL     A
        CLC
        ADC     #$03
        TAX
        LDY     #$03
.LAD6A
        LDA     LAD75,X
        STA     L0214,Y
        DEX
        DEY
        BPL     LAD6A

.LAD74
        RTS
0D78

Code: Select all

        LDX     #$00
        STX     L0004
        JSR     LC8BC

        LDA     L0025
        ORA     L0034
        BNE     LAD72

        LDA     L0016
        CMP     #$02
        BCS     LAD72

.LAD60
        ASL     A
        ASL     A
        CLC
        ADC     #$03
        TAX
        LDY     #$04
.LAD68
        LDA     LAD75,X
        STA     L0213,Y
        DEX
        DEY
        BNE     LAD68

.LAD72
        STY     L0004
        RTS
Anyone got a view on which if these is "better"?

It looks to me like version "660E" leaves an item on the workspace stack, which might mess up subsequent commands.

Here's a small test program:

Code: Select all

10 VECTOR 0
20 PRINT 22/7
30 END
Version "0D78" prints 3 (correct), where as Version "660E" prints 0 (as do all other versions).

That seems quite conclusive to me.

Dave

User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by hoglet » Wed Apr 04, 2018 6:54 pm

Right, I think I can now time order all of these versions, by tracking bug fixes.

(For version number I'm using the Atom CRC of the raw 4096 byte ROM file)

The earliest version is 1904, the one that John just found.

There are two bugs that appear only in this version, and that are fixed in later versions:
- the ZERO command also clears the @ variable
- the DELETE command is incorrectly named as DELELE

The next versions are 6B06 and 6C9E.

These contains fixes for the above two bugs, but also have had the copyright removed, and in 6C9E the name TOOLBOX changes to TOOLKIT. There are no other differences between 6B06 and 6C9E.

There is one bug that appears in these (and earlier versions), and that is fixed in later versions:
- the RENUMBER command allows the basic stack to overflow, so will incorrectly renumber programs with >15 numeric GOTO/GOSUBs

The next version is "660E".

This contains fixes for the above three bugs, and also has the copyright in place.

There is one bug that appears in this (and earlier) versions, and that is fixed in later versions:
- the VECTOR command allows the basic stack to get unbalanced, so a subsequent expression evaluates incorrectly

The latest version is "0D78".

This contains fixes for the above four bugs, and also has the copyright in place.

This seems to have developed two regressions, possibly corruptions:
- AFF8 is 48 and should be 59: this KEY command to KEI
- AFFF is FF and should be 4F: makes the FIND command inaccessible

I'll continue to compare 660E and 0D78, as there are a couple of other significant changes.

Dave

User avatar
oss003
Posts: 2797
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by oss003 » Wed Apr 04, 2018 9:30 pm

Well done Dave .... =D>
I think that renaming commands was done when the Atom had a ROM switchboard and Branquart installed.
You don't want the same command names because then you don't know which one is used so you rename them ......

Greetings
Kees

User avatar
daveejhitchins
Posts: 4533
Joined: Wed Jun 13, 2012 5:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by daveejhitchins » Thu Apr 05, 2018 7:25 am

oss003 wrote:You don't want the same command names because then you don't know which one is used so you rename them ......
Couldn't you use a proceeding letter to differentiate between different ROM commands - as seems to be a common method elsewhere?

Dave H :D
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ARA III, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

User avatar
oss003
Posts: 2797
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by oss003 » Thu Apr 05, 2018 7:32 am

daveejhitchins wrote:Couldn't you use a proceeding letter to differentiate between different ROM commands - as seems to be a common method elsewhere?
If you didn't have the source, a letter of the command was changed by poking another letter direct in the romcode.

Greetings
Kees

User avatar
daveejhitchins
Posts: 4533
Joined: Wed Jun 13, 2012 5:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by daveejhitchins » Thu Apr 05, 2018 8:12 am

oss003 wrote:
daveejhitchins wrote:Couldn't you use a proceeding letter to differentiate between different ROM commands - as seems to be a common method elsewhere?
If you didn't have the source, a letter of the command was changed by poking another letter direct in the romcode.

Greetings
Kees
I'd guessed that . . . But thought a first letter change would have been easier to 'remember' than any other change?

Dave H :D
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ARA III, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

User avatar
hoglet
Posts: 7697
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Program Power Programmer's Toolbox ROM

Post by hoglet » Thu Apr 05, 2018 12:33 pm

Updated disassemblies of all five versions (using the improved BeebDis 0.91):
pp_toolbox_v2.zip
(54.34 KiB) Downloaded 15 times
The complete list of changes between 660E and 0D78 is:
- LINK #AF00 now directly sets the BRK vector (rather than only via OSRDCH) so the toolkit can be initialised in a program
- the VECTOR command no longer allows the basic stack to get unbalanced (causing a subsequent expression to evaluate incorrectly)
- the VAR# command's output format has changed (improved?)
- all JSR FEFB calls now JSR A0A5 (which is JMP FEFB) (so one place to patch printer output ?)
- a corrupt basic program will result in ERROR 174 rather than an infinite loop

Post Reply