PUTR, port?

From: Tony Duell <ard_at_p850ug1.demon.co.uk>
Date: Mon Jan 19 15:56:37 2004

> One friend of mine, in the mid-90s, was hired to help port a MS-DOS
> application to Unix. Most of the application was already in C, but with a
> non-trivial portion in Assembly (mostly the I/O subsystem). My friend just
> basically translated the x86 code to C, pretty much as straight a
> translation as possible. So a routine like:

About 10 years ago (heck, the _modification_ is on-topic...) I needed a
printer for my PERQ, which has a GPIB port. Digging in my junk box, I
found a Commodore unit (off a PET), which, of course, used the Commodore
character codes, not ASCII. The obvious thing to do was to burn a new
EPROM with modified chracter tables and decoding routines in it.

Well, it didn't take long to (a) find said tables and (b) make an adapter
to use normal EPROMs on the Commodore board. The problem was that the
original EPROM contains a self-test checksum routine, so just changing
the tables resulted in a printer that didn't do anything by blink the
frontpanel LED to indicate a failure.

In order to understnad the checksum routine (and to ensure that I'd got
the right value in the checksum byte on the second attempt), I re-coded
the checksum routine in VAX Pascal (the only decent language that I had
access to at the time). I had variables with names 'A', 'X', 'Y',
'carry', etc and procedures called 'adc', 'inx', etc. The resulting
code, which read a bit like 6502 assembly language, wasn't pretty, but it
got the job done!

'A real programmer can write machine code in any language' :-)

-tony
Received on Mon Jan 19 2004 - 15:56:37 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:36:46 BST