I am practicing assembly language for some time and i am kind of getting into it. I started doing TSR programs, like scanning input from keyboard and such things.
The thing that is still confusing to me is how can i run my terminated program when certain key is pressed.
The most basic thing i am trying to create is to display my name at the start of the screen when for example "^" key is pressed. Note that i want this to happen after my program executes
Like you see on the picture. Imagine i started ma program "test.com". And in my "test.com" program i wrote TSR code that whenever i press "^" key my name is written at the start of the screen. Now as you can see on the picture my program is finished and i can run new program. But when i press "^" key i still want to write my name at the start of the screen although program is not running anymore.
Sorry for such detailed post but i want to be sure you understand what am i asking. I know basic/advanced assembly programing, i am familiar with changing interupts with custom routine and everything. I worked with TSR programs that do stuff when they are executed, not after.
I would also appreciate if u do not post stupid answers like "why are you doing this", and "woah, you live in the past it is useless". I have my own reasons for doing this, but its obviously for practice reasons. And it will be nice if only people who actually know assembly could answer me, not people who want to get more answers for badges...
The thing i would like most is if someone could write me a sample code of what i am asking or at least some instructions, like what interupt i should use to do this.
Thanks in advance
I figured it out now. The trick is you only have to edit your BIOS interrupt, and than type something like this
mov ax,3100h ; *This will terminate program and make it resident in RAM memmory*
mov dx,ammount_of_memmory ; *This is the amount of memmory i want to reserve for my program*
int 21h ; *This is the DOS system call to execute our program*
That way you can change what will happen if you press certain key on keyboard. However, if we want to display message, when certain action occurs, we need to put it directly on video memory rather than using standard print functions.