IBM PC-DOS 0.9 "HAL" question

Discuss MS-DOS, Windows 1, 2 and 3.
Post Reply
AltairMan
Posts: 16
Joined: Thu Sep 03, 2020 1:47 am

IBM PC-DOS 0.9 "HAL" question

Post by AltairMan »

While I was on The Starman's site the other day (https://thestarman.pcministry.com/DOS/ibm090/index.html) looking for something, I re-read the part on 20HAL which is the program Microsoft used to upload code from their DECSYSTEM-20 to IBM in Boca Raton. When examining the code for 20HAL, I noticed the following frequently-called subroutine:

{lots of PUSHing of registers}
9663:0589 B1 06 mov cl,6
9663:058B 8A D0 mov dl,al
9663:058D E8 FA75 call $-588h
{plenty of POPping}

The negative-offset call from the disassembler is odd, but it's basically a "call cs:5" to the PSP which is the CP/M service request vector. In CP/M, a call to BDOS (the MS-DOS equivalent) was made through a "CALL 0005" after setting up the registers. The register setup is pure CP/M (on the Z80, C=6=Direct Console I/O and E=character to print). So, this is a "print character" routine.

Was the 20HAL program a translation of a CP/M program (i.e., Z80->8086), or was it developed on a CP/M-86 platform (it would have to be a pre-release version because I think CP/M-86 came out later in 1981)? I have to check for other odd register usage that's an artifact of using TRANS86. Often the BC register pair is translated to CX and DE to DX, so using CL and DL makes sense and quite possibly, a translation.

AltairMan
Posts: 16
Joined: Thu Sep 03, 2020 1:47 am

Re: IBM PC-DOS 0.9 "HAL" question

Post by AltairMan »

Following-up on this, it looks like the code accesses COM1 through INT14H and there aren't any embedded Hayes command strings or phone numbers. So, my guess is that the connection was either through a leased line or an acoustic coupler -- the Smartmodem was introduced later in 1981 so I doubt it would have been used for sending code to Boca Raton during the development phase of DOS.

It sends a few strings and waits for a response. That's what I'm working on now.

AltairMan
Posts: 16
Joined: Thu Sep 03, 2020 1:47 am

Re: IBM PC-DOS 0.9 "HAL" question

Post by AltairMan »

Since I can't go back and re-edit my above post...I finally created a web page with my analysis of the 20HAL program here: http://cini.classiccmp.org/hal.htm. The big missing piece is still the software that was on the TOPS-20 system at Microsoft that did the file transfer part, as well as confirming how the connection was made -- I'm emulating it with two acoustic coupler modems (which amazingly still work) and a Panasonic PBX.

Thanks.
Rich

vbdasc
Posts: 350
Joined: Fri Apr 30, 2010 6:14 pm

Re: IBM PC-DOS 0.9 "HAL" question

Post by vbdasc »

AltairMan wrote:
Wed Sep 16, 2020 11:25 pm
Was the 20HAL program a translation of a CP/M program (i.e., Z80->8086), or was it developed on a CP/M-86 platform (it would have to be a pre-release version because I think CP/M-86 came out later in 1981)?
I can't answer your question. But I'm curious why you seem to omit the third, and rather obvious, alternative - that this 20HAL thing was developed for QDOS/86DOS/PCDOS? After all, this CALL CS:0005 is a perfectly valid and documented way to make syscalls up to DOS version 1 at least, and anecdotally it still works even in version 6 and maybe 7?

AltairMan
Posts: 16
Joined: Thu Sep 03, 2020 1:47 am

Re: IBM PC-DOS 0.9 "HAL" question

Post by AltairMan »

I looked at it from the aspect of introduction date -- which system came first -- under the assumption that if you're looking to migrate users from one platform to another or wanted to offer "compatibility" in some form, it would be reasonable to have a similar call sequence. CP/M predated QDOS by a few years -- CP/M was introduced in 1974 while QDOS was introduced in 1980 -- and the only place I had ever seen that call sequence is in CP/M. So, I viewed it as CP/M->QDOS->86-DOS->PC-DOS.

daarch
Posts: 7
Joined: Thu Aug 19, 2021 1:39 pm

Re: IBM PC-DOS 0.9 "HAL" question

Post by daarch »

AltairMan wrote:
Wed Sep 16, 2020 11:25 pm
Was the 20HAL program a translation of a CP/M program (i.e., Z80->8086), or was it developed on a CP/M-86 platform (it would have to be a pre-release version because I think CP/M-86 came out later in 1981)?
It's equally possible that either the assembly source was machine translated from some original z80 CP/M assembly or it was written by a programmer that was used to the "call 5" BDOS system calls that just kept using them on DOS.

The CP/M-86 possibility doesn't make much sense, as the "call 5" BDOS system calls were not supported there. But it's funny how IBM and MS kept the CP/M compatibility "call 0" and "call 5" working in all x86 DOS versions and Digital Research dropped it right on their first 8086 CP/M.

AltairMan
Posts: 16
Joined: Thu Sep 03, 2020 1:47 am

Re: IBM PC-DOS 0.9 "HAL" question

Post by AltairMan »

I agree...the above is more of a musing to point out the timing. CP/M-2.2 was dominant on the S100 platform (which is where Tim's experience was, designing S100 boards for Seattle Computer, starting with the 16K RAM board I believe), and there were plenty of disk controllers out there (which you can see the compilation switches for in the code for the SCP monitor ROM). So, it's very reasonable that it was written or partially-written on a CP/M machine and then translated using his TRANS86 program. That could explain the odd mix of calling conventions in the code, and the inclusion of INT21H calls. The code started on one platform and ended up elsewhere.

It's one of those things I'd love to confirm. I've tried to make some connections to old Microsofties (low-double-digit employees), but I haven't heard back.

Post Reply