There is no definition of AH anywhere, I can’t tell where it is coming from. And $13, what is that about?
AH is the high byte of AX a 16 bit register in the 8086. AL is of course the low-byte of AX.
$13 is the hex number of the interrupt used in MSDOS.
What is AH or the Intr() call?
AH is as above. Intr() call is a Pascal call (was it Turbo Pascal, I wonder) to the 8086 interrupt code in a PC.
Yes this knowledge is arcane, and Yes, you 'just have to know it'
That's because this was the only way (Such a kluge!) you could interface the hardware to a "high level language" like Pascal that didn't have that capability built in.
It would probably have been better to use 8086 assembly with MSDOS system calls than Pascal as it was intrinsically able to interface with the hardware where Pascal was not.
But when you're a learner, you do what you can. Even if it turns out to be 'the hard way'.
We all have stuff that lives rent-free in our heads. In my case I can look at a lot of 8-bit hex numbers and know what machine instructions they represent in 8080/Z80 code. Enough of them to look at a hex dump of 8080 machine-code and know roughly what is supposed to happen.
I wonder why uninstalling the hard disk and installing it in a different computer was the best solution.
Were the files so big that it would have used too many floppies? Did the two computers use different sizes of floppies? Could he not afford blank floppies (but he could afford damaging his hard disk)? Did he not have the right software to split a file into pieces to fit on multiple floppies?
Very similar to programming micro controllers, a lot of setting registers to arbitrary values to toggle certain bits high or low to enable/disable device functionality or set some interrupt or other. You needed the data sheet as well as the code to work out what was going on.
Oh yes, a good example is setting a magic value to a registry [1] to make sure your microcontroller (in my case, an ESP32-S3) wouldn't reboot because of the watchdog.
At first, I was confused on the behavior - after reading the datasheet and setting the magic value, it all made sense. I'm pretty sure it will look like wizardry to the next person looking at the magic value alone.
Thankfully code comments are a thing, but magic values are still magic values.
Overall, I'd say the author fell in between the computer generations. After things started to look high-level, but where a lot of the interesting stuff was still very low-level.
One of the first things I learned to do in Commodore-64 basic was poke53280,0 to change screen background color. It was low level for everything, and there was no expectation of the address or the value "making sense" as such; it was just hardware control.
12 comments
[ 33.9 ms ] story [ 1367 ms ] threadAH is the high byte of AX a 16 bit register in the 8086. AL is of course the low-byte of AX.
$13 is the hex number of the interrupt used in MSDOS.
What is AH or the Intr() call?
AH is as above. Intr() call is a Pascal call (was it Turbo Pascal, I wonder) to the 8086 interrupt code in a PC.
Yes this knowledge is arcane, and Yes, you 'just have to know it'
That's because this was the only way (Such a kluge!) you could interface the hardware to a "high level language" like Pascal that didn't have that capability built in.
It would probably have been better to use 8086 assembly with MSDOS system calls than Pascal as it was intrinsically able to interface with the hardware where Pascal was not.
But when you're a learner, you do what you can. Even if it turns out to be 'the hard way'.
We all have stuff that lives rent-free in our heads. In my case I can look at a lot of 8-bit hex numbers and know what machine instructions they represent in 8080/Z80 code. Enough of them to look at a hex dump of 8080 machine-code and know roughly what is supposed to happen.
I was trying to explain how my 12 years old self saw that code
And I had no other resource to turn to at the time
Were the files so big that it would have used too many floppies? Did the two computers use different sizes of floppies? Could he not afford blank floppies (but he could afford damaging his hard disk)? Did he not have the right software to split a file into pieces to fit on multiple floppies?
You could either schlep the hard disk or try to carry 20 - 30 floppies around
With a high chance of at least some of them bring bad
At first, I was confused on the behavior - after reading the datasheet and setting the magic value, it all made sense. I'm pretty sure it will look like wizardry to the next person looking at the magic value alone.
Thankfully code comments are a thing, but magic values are still magic values.
[1]: https://github.com/tinygo-org/tinygo/pull/3937/files#diff-8f...
Meanwhile:
AH came from Registers.Overall, I'd say the author fell in between the computer generations. After things started to look high-level, but where a lot of the interesting stuff was still very low-level.
One of the first things I learned to do in Commodore-64 basic was poke53280,0 to change screen background color. It was low level for everything, and there was no expectation of the address or the value "making sense" as such; it was just hardware control.