I was trying the following TSR which is supposed to capture interrupt no.8 and change screen color every 10 seconds. But either the linker shows a "not enough memory" error, or, nothing appears to happen. Also the program does not seem to be entering the function our(). Please help...

#include "dos.h"
#include"stdio.h"

void interrupt our();
void interrupt (*prev)();
char far *scr=(char far*)0xB8000000L;
int ticks;
unsigned char color;

main()
{       prev=getvect(8);
        setvect(8,our);
	keep(0,10000);
}

void interrupt our()
{
	int i; char c;
	ticks++;
	for(c='A';c<='z';c++)
		printf("%c",c);

	if(ticks==182)
        {
                for(i=1;i<=3999;i+=2)
                        *(scr+i)=color;
                color++;
		ticks=0;
	}

	(*prev)();
}

Edited 5 Years Ago by Rupindersingh: n/a

Windows puts constraints on what you can do in this regard, depending on the version of Windows you are running. You are very likely to crash either the TSR program, another program running at that time, or even Windows itself.

Modern way to do this, would be to use a service, perhaps. Check with your operating system.

Here's another simple TSR I was trying which is supposed to keep the caps lock on, but its not working

#include<dos.h>

void interrupt our();
void interrupt (*prev)();
char far *kb=(char far *)0x417;

main()
{
	prev=getvect(9);
	setvect(9,our);
	keep(0,500);
}

void interrupt our()
{
	(*prev)();
	*kb=*kb|64;
}

and here's a TSR which is simply supposed to toggle small case letter on the screen to capital case, and the other way round, but it does not appear to do its job, plz help....

#include"dos.h"

void interrupt our();
void interrupt (*prev)();
char far *scr=(char far*)0xB8000000L

main()
{
unsigned long int far *p;

p=(char far*)36;
prev=*p;
*p=our;
keep(0,500);
}

void interrupt our()
{
int i;

for(i=0;i<=3999;i+=2)
{
if(*(scr+i)>='A'&&*(scr+i)<='Z')
*(scr+i)+=32;
else if(*(scr+i)>='a' && *(scr+i)<='z')
*(scr+i)-=32;
}
(*prev)();
}

Edited 5 Years Ago by Rupindersingh: n/a

I used to have a book with some examples of this - haven't seen the book in years, but I'll look around and see if I can find it.

The problem with TSR's was, they would work on PC's with a certain design, and peripherals, and OS, but anything else was a maybe, and the further you got away from the author's design of PC, the less of a chance there was of his TSR programs (or any assembly program), working.

TSR's worked if they were made for a particular PC and OS, etc., but they were never officially supported by Microsoft, unless they were made by MS.

From your other forum's posts, I believe you'd really like software engineering, and a small microprocessor board based project, would be right up your alley. Have you looked into any of the Arduino board or other micro board forums/projects?

The more you look into TSR's, the more you'll find they're sort of the smelly rotting corpse, end of the PC engineering world.

But I will look for the book. ;)

What version of DOS are you running? You're not running this inside a Virtual Box/Virtual Machine type environment, right?

Edited 5 Years Ago by Adak: n/a

Thanx Adak. You are right about my sofware engineering ambition. I am running DOS under windows and I am totally cognisant of the fact that DOS is cadevorous rotting operating system, but don't you think that learning DOS before going for windows could give me a better understanding of how things work at the elmentary level, and how things really began manfesting.

Also let me know if you can provide me with some useful resources which you think might be of help, especially if you have things regarding Intel Processors and their architecture and instruction set.

Edited 5 Years Ago by Rupindersingh: n/a

I think there is nothing you can learn better in DOS (Dirty Operating System, wasn't it :icon_twisted:) environment than Windows. I would suggest you partition your hard disk and run Linux for alternative environment for nice way to do things. DOS has so little support for youtr programs that you end up writing half operating system yourself, including device drivers and kind of multitasking TSR misuse of interrupts instead of real multitasking.

You can start with for example: http://www.advancedlinuxprogramming.com/alp-folder

Edited 5 Years Ago by pyTony: n/a

Thanx Adak. You are right about my sofware engineering ambition. I am running DOS under windows and I am totally cognisant of the fact that DOS is cadevorous rotting operating system, but don't you think that learning DOS before going for windows could give me a better understanding of how things work at the elmentary level, and how things really began manfesting.

Also let me know if you can provide me with some useful resources which you think might be of help, especially if you have things regarding Intel Processors and their architecture and instruction set.

I would skip DOS, then. Google up info on the 8088 or 8086 cpu (first PC cpu), and then work your way up through the 80186, 80286 and especially the 80386. The AMD (not Intel) design for keeping compatibility with 8088 software, while moving to a flat memory model, etc., was a HUGE breakthrough. Intel couldn't match it, and paid big bucks to use the AMD design (which is still the basis for the cpu, although it's been enhanced many times over by both Intel and AMD).

For hands on learning though, you can't beat the simple(r) micro boards like Arduino, and etc. Those little kits are a blast and a half, and (if you don't burn them up), then can be used for several different projects. There, the simplicity of the board makes so many things jell in how digital micro electronics work.

You can't run TSR's on top of Windows anymore - I know I tried it a couple times in Windows XP, and it wouldn't work.

This question has already been answered. Start a new discussion instead.