SwedaGuy
Experienced Member
Hello all! Long time, no type...I'm pretty sure it's been a few years since I hit this forum. Someone has really spiffed up the place.
I'm posed with an interesting task, though I must admit the practical applications are limited.
I'm writing an interrupt handler to intercept data from a keyboard (not THE keyboard, but rather a serial-attached special purpose keyboard), interpret the keystrokes and update certain totalizers and counters. Basically, when a byte is received on the COM port (2), my program needs to spring into action and handle the data. This may involve printing on an attached printer or alpha numeric pole display (COM 1), feeding back to the keyboard (COM 2) or sending data to a MICR encoder (COM 3).
I'm thinking this has to be done in Assembler, due to the fact that I have to fit a ton of processing into the 64K limit of a .COM file. Actually, the processing has to be in one 32K block and the data has to be in the other 32K block. This leads me to my problem: The data portion of the code has to always be loaded into the same segmentffset. There are a few segments for me to choose from, but no matter which I choose, I can't just let DOS decide when the program is launched where to stick it...the data always has to be at the pre-specified segment and offset. If you are wondering why, one specific 32K block of RAM (preselected by dip-switch) is shadowed by Non-Volatile RAM, and that is where the data needs to go so it can be retained when the power is shut off.
That said, I've done quite a bit of work in assembler, mostly 8085, so I understand the fundamentals, and have read over a book called "Memory Resident Programming on the IBM PC" by Thomas Wadlow. The book gives me the information on how to create a resident application, and has some interesting examples, but nothing on actually determining the location in memory in which the application should run--which is weird, as it goes into replacing the interrupt vector, but doesn't tell you how to derive the number that goes into the table--or how to make your program load in a pre-defined space.
Am I even on the right track, or am I missing something obvious? If it matters, I've got MS Macro Assembler 5.x. The machine is a 386, but I want to keep to the basic 8086 instruction set if possible.
I'm confident that if I can get the skeleton in place, handling the keystrokes and other I/O will be fairly straightforward, but I'm lost on this one foundation element of the program...
Thanks for any suggestions or guidance!
I'm posed with an interesting task, though I must admit the practical applications are limited.
I'm writing an interrupt handler to intercept data from a keyboard (not THE keyboard, but rather a serial-attached special purpose keyboard), interpret the keystrokes and update certain totalizers and counters. Basically, when a byte is received on the COM port (2), my program needs to spring into action and handle the data. This may involve printing on an attached printer or alpha numeric pole display (COM 1), feeding back to the keyboard (COM 2) or sending data to a MICR encoder (COM 3).
I'm thinking this has to be done in Assembler, due to the fact that I have to fit a ton of processing into the 64K limit of a .COM file. Actually, the processing has to be in one 32K block and the data has to be in the other 32K block. This leads me to my problem: The data portion of the code has to always be loaded into the same segmentffset. There are a few segments for me to choose from, but no matter which I choose, I can't just let DOS decide when the program is launched where to stick it...the data always has to be at the pre-specified segment and offset. If you are wondering why, one specific 32K block of RAM (preselected by dip-switch) is shadowed by Non-Volatile RAM, and that is where the data needs to go so it can be retained when the power is shut off.
That said, I've done quite a bit of work in assembler, mostly 8085, so I understand the fundamentals, and have read over a book called "Memory Resident Programming on the IBM PC" by Thomas Wadlow. The book gives me the information on how to create a resident application, and has some interesting examples, but nothing on actually determining the location in memory in which the application should run--which is weird, as it goes into replacing the interrupt vector, but doesn't tell you how to derive the number that goes into the table--or how to make your program load in a pre-defined space.
Am I even on the right track, or am I missing something obvious? If it matters, I've got MS Macro Assembler 5.x. The machine is a 386, but I want to keep to the basic 8086 instruction set if possible.
I'm confident that if I can get the skeleton in place, handling the keystrokes and other I/O will be fairly straightforward, but I'm lost on this one foundation element of the program...
Thanks for any suggestions or guidance!