Posts: 142
Threads: 6
Joined: Aug 2001
I keep getting this idea popping into my head about writing a gui in QuickBASIC. And lately it has been happening more and more often. Among the ideas for it is a way of handling device drivers. I'll explain it a bit.
My idea is not to store the actual device interaction in the source code. Instead I would be storing it in external files (in either a scripting language or as bytecode). Below is an example of what a graphics driver for mode 13h would look like:
Code:
[driver]
type=graphics
resolution=320x200x8
[entermode]
mov ax, 13h
int 10h
[putpixel]
// Whatever assembly is used to put the pixel
It would work by converting it into whatever Call Absolute can handle and by piping it into it.
My question is... how feasible is this idea?
Posts: 294
Threads: 9
Joined: Oct 2002
heh, its an idea already in use. Windows and linux have these, e.g. windows uses dll's. Its a good idea.
Posts: 3,522
Threads: 189
Joined: Dec 2003
The only problem I can see is that it would be slow, you would have to load the routine for plotting a pixel into memory or it would be like... slow....
[Somewhat ontopic/offtopic]
If you run 2 or more ASM programs at the same time (multitasked, ie: 1 byte there, 1 byte there) wouldn't they ruin the registers for each other?
[/Somewhat ontopic/offtopic]
Posts: 691
Threads: 5
Joined: Apr 2002
Quote:If you run 2 or more ASM programs at the same time (multitasked, ie: 1 byte there, 1 byte there) wouldn't they ruin the registers for each other?
No, because multiprocessing operating systems do what is called a context switch when changing execution from one process to another. The registers of the process that is being scheduled out are stored somewhere in memory, and can be reloaded the next time the process is scheduled. Its not just assembly programs that this happens for, most programs (if not all useful ones) use registers once compiled.
esus saves.... Passes to Moses, shoots, he scores!
Posts: 4,307
Threads: 63
Joined: May 2003
Its feasible and I think i've seen a program which does something similar. It runs two .exes(or what i dont remember) simultaneously, through QB.
But it utilized the same principle.
Posts: 3,288
Threads: 167
Joined: Nov 2001
Very very feasible. :*)
In fact. I have done it already 1 1/2 years ago. Its called AF.LIB
The Load from file version that is.
It was used in "Lone wolf" L_O_J's entry to Vplanets minigame contest. :*)
Posts: 3,522
Threads: 189
Joined: Dec 2003
rel: Where can you/I find it?
Posts: 979
Threads: 27
Joined: Aug 2001
Yeah, I remember that program that ran two .com files at once. It was something CGI Generic Joe wrote I think (or was it Eric Carr? I dont know).