Thursday, April 24, 2008

They still work

Late last night I picked one of my books on numerical methods in C, and found a reference to how floating point numbers are treated in the PC family. I was looking for information on how they are formatted for calculations on the old 8087 math coproccessor and its descendants which were incorporated into later Intel processors, but I didn't find it. I didn't fund as much as I wanted to on numerical methods in general, but I do have book back in Nebraska on the subject. However, information on floating point calculations at the machine level is pretty sparse in all my available materials.

Most of what I looked carefully at in C was rehashing things I've already studied, and likewise with C, Progress in assembly also fairly minimal. I'm inching toward being able to use the BIOS routines, which also brings in looking at the interrupt vector table in low memory.
The larger accomplishment came in testing out the mechanics of programming on the three languages I am working on right now.

The night before last I downloaded Turbo C from the internet, and in the process of trying to set it up, accidentally erased everything that wasn't in a separate directory from my C: drive. I tried to undelete it, and found that Win98 doesn't include the undelete command that Dos 5 used to, and since I hadn't gone through the recycle bin. Those files may be theoretically recoverable, but I'm not counting on it. But they included the autoexec.bat file, which set up my assembler TASM for use: I'm not big on mixing working files with those that the assembler itself uses, so I uses a separate work directory. I also recall a config.sys file, which I think tells DOS how to set up my CD, but I may be able to get that back another way. On the positive side, I did get Turbo C set up.

So, I tried everything out. I had several sample programs available for testing: Assembly language. I also had some experience with what can go wrong with assembly language: First, about four typos kept the program from a program from assembling at all, then it wouldn't terminate properly. I rebooted in DOS mode and tried it there, and after it did what it was supposed to, instead of quitting like a well behaved program should, it started giving me garbage on the screen. The, after a keypress, more garbage. What??? So after another reboot, I went back to the source (for the fourth time.. and found it. Instead of the DOS exit routine at interrupt 21 hex, I had sent it to 21 decimal, which was used on the original IBM-PC to set up for cassette tape services. I have no idea what that routine does now except Nothing Good if you call on it by accident.

The trial of BASIC (GW BASIC if you must know) worked well, except for my dyslexia of the fingers, until I was done and wanted to exit the interpreter. Quit didn't work. Exit didn't work. Bye didn't work. Stop didn't work. So another reboot and a hunt on the Internet for the documentation I'd noticed but glanced over last week. Oh. System is the magic word. Well, that wouldn't have occurred to me.
The trial of Turbo C worked better. I This was the compiler I used to learn C, so I was already roughly familiar with its quirks (once I remembered how to send the compiler output into my working directory instead of mixing it up with the compiler's own files). One of the sample programs used an escape code to create a "beep" sound. So, I wondered, will I get a beep?
No such luck. Down with the beepy DOS, up with the musical"Windows" sound. Could I get something else?...maybe, if wanted to do it bad enough to figure out how.
So, I've refreshed myself on the mechanics. Now, If I only had some creativity...

Moving on to physics, I did a little review of mechanics and the mathematical preliminaries. This is the kind of thing that tends to lead me off on tangents, so I'll mention it more later.
Sometime way back when, I picked up a copy of the chemistry textbook I used in high school. No, the fundamentals of chemistry haven't changed as much in 40 years as the state of the art in computer hardware, but a glance through the contents suggested that some concepts I've been a bit fuzzy about are more clearly explained there than in some more recent college-level textbooks.

I've noticed that I've included some computer jargon. Sorry, there's no help for it: I've reached a point where I baffle the beginners and bore the professionals by belaboring the obvious.

PS. One of the sample programs was one for calculating the worth of your weight in gold. So I had to know. I looked up the current price on the internet and modified the program accordingly, put myself on the scale, and came up at just under 5 million dollars.

No comments: