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