TSR program help 
Author Message
 TSR program help

This program suppose to stay resident.  Than when you press any key (int 09h)
on the keyboard, it should print a ASCII on the screen.  But it just does not
work.
why? please Help!

for MASM

.model tiny
.code
        org     100h
start:
        jmp     install

oldhandler  dword       ?

newhandler:
        mov     dl,01h               ;print a ASCII on the screen
        mov     ah,02h
        int     21h

        jmp     cs:oldhandler

        ret
install:
        mov     ax,3509h            ;get int 09h handler
        int     21h

        mov     word ptr oldhandler[0],bx
        mov     word ptr oldhandler[2],es

        mov     ax,2509h                ;set int 09h handle
        mov     dx,offset newhandler
        int     21h

        mov     dx,offset install
        mov     cl,4
        shr     dx,cl

        add     dx,1

        mov     ax,3100h             ;terminate and stay resident
        int     21h

        mov     ax,4c00h
        int     21h

end start



Tue, 03 Apr 2001 03:00:00 GMT  
 TSR program help
The way to do it would be this:
- Issue the LOAD Macro to put program in Private Storage
- Issue MODESET Macro to get into Supervisor Mode & Key Protection Zero
- GETMAIN a Common Area equal to your loaded Program, Move your Program From
Your Private Zone to this Area
- Get The Adress of CVT, Then SVC Table, Find an Empty Slot (Dont use 1-199
They are reserved for IBM use), Get LOCAL&GLOBAL Lock upon it Then Modify
the selected slot) -At This Point Pray not no have{*filter*}anything becouse
you might be ending with an IPL- If all if OK Release both LOCKS
- Issue MODESET once more time to get back to Problem Mode

Now your program is resident......
You can invoke  using SVC XXX, XXX being the slot you selected. Remember the
standar register convention to be used when you make a SVC Program and
please... Don't Use MASM, Instead use ASMH or HLASM. Either one will work
here.... even ASMF will do the trick.

Cheers
UnionWay escribi en mensaje

Quote:
>This program suppose to stay resident.  Than when you press any key (int
09h)
>on the keyboard, it should print a ASCII on the screen.  But it just does
not
>work.
>why? please Help!

>for MASM

>.model tiny
>.code
> org 100h
>start:
> jmp install

>oldhandler  dword ?

>newhandler:
> mov dl,01h      ;print a ASCII on the screen
> mov ah,02h
> int 21h

> jmp cs:oldhandler

> ret
>install:
> mov ax,3509h     ;get int 09h handler
> int 21h

> mov word ptr oldhandler[0],bx
> mov word ptr oldhandler[2],es

> mov ax,2509h ;set int 09h handle
> mov dx,offset newhandler
> int 21h

> mov dx,offset install
> mov cl,4
> shr dx,cl

> add dx,1

> mov ax,3100h      ;terminate and stay resident
> int 21h

> mov ax,4c00h
> int 21h

>end start



Tue, 03 Apr 2001 03:00:00 GMT  
 TSR program help

Quote:

> This program suppose to stay resident.  Than when you press any key (int 09h)
> on the keyboard, it should print a ASCII on the screen.  But it just does not
> work.
> why? please Help!

> for MASM

Maybe because Intel programs don't run on a S/370? Repost in the correct
news group and you're more likely to get help.

--

Shmuel (Seymour J.) Metz
Reply to host nsf (dot) gov, user smetz



Tue, 03 Apr 2001 03:00:00 GMT  
 TSR program help
: ... SVC Table, Find an Empty Slot (Dont use 1-199
: They are reserved for IBM use), Get LOCAL&GLOBAL Lock upon it Then Modify
: the selected slot) -At This Point Pray not no have{*filter*}anything becouse
: you might be ending with an IPL- If all if OK Release both LOCKS ...

Shouldn't you use SVCUPDTE instead?
--
| Edward E. Jaffe                | Voice:      (310) 338-0400 x318     |
| Mgr., Research & Development   | Facsimile:  (310) 338-0801          |

| 9841 Airport Blvd, Suite 700   | IBM Mail:   USS24J24 at IBMMAIL     |        
| Los Angeles, CA 90045          | Web page:   www.phoenixsoftware.com |



Tue, 03 Apr 2001 03:00:00 GMT  
 TSR program help
Better yet (along with using SVCUPDTE as Ed suggests), do a LOAD for
your program, save away the length and then issue a DELETE.  After
getting into Key 0 Supervisor State, do your STORAGE OBTAIN for the
length you got earlier.  Then do a "directed LOAD" of the program into
the obtained area and your ADCONS will be relocated for you
automatically.

Bob

Quote:

> The way to do it would be this:
> - Issue the LOAD Macro to put program in Private Storage
> - Issue MODESET Macro to get into Supervisor Mode & Key Protection Zero
> - GETMAIN a Common Area equal to your loaded Program, Move your Program From
> Your Private Zone to this Area
> - Get The Adress of CVT, Then SVC Table, Find an Empty Slot (Dont use 1-199
> They are reserved for IBM use), Get LOCAL&GLOBAL Lock upon it Then Modify
> the selected slot) -At This Point Pray not no have{*filter*}anything becouse
> you might be ending with an IPL- If all if OK Release both LOCKS
> - Issue MODESET once more time to get back to Problem Mode

> Now your program is resident......
> You can invoke  using SVC XXX, XXX being the slot you selected. Remember the
> standar register convention to be used when you make a SVC Program and
> please... Don't Use MASM, Instead use ASMH or HLASM. Either one will work
> here.... even ASMF will do the trick.

> Cheers
> UnionWay escribi en mensaje



Tue, 03 Apr 2001 03:00:00 GMT  
 TSR program help


Quote:
>Better yet (along with using SVCUPDTE as Ed suggests), do a LOAD for your
>program, save away the length and then issue a DELETE.  After getting
>into Key 0 Supervisor State, do your STORAGE OBTAIN for the length you
>got earlier.  Then do a "directed LOAD" of the program into the obtained
>area and your ADCONS will be relocated for you automatically.

Wouldn't it be simpler to use LOAD GLOBAL=YES or the new dynamic LPA
facility?




Tue, 03 Apr 2001 03:00:00 GMT  
 TSR program help


: >Better yet (along with using SVCUPDTE as Ed suggests), do a LOAD for your
: >program, save away the length and then issue a DELETE.  After getting
: >into Key 0 Supervisor State, do your STORAGE OBTAIN for the length you
: >got earlier.  Then do a "directed LOAD" of the program into the obtained
: >area and your ADCONS will be relocated for you automatically.

: Wouldn't it be simpler to use LOAD GLOBAL=YES or the new dynamic LPA
: facility?

I don't think LOAD GLOBAL=YES will work.  The problem is that when you
terminate, your module is deleted.  Dynamic LPA is a nice thought, but
you still need an SVCUPDTE to change the SVC table.
--
| Edward E. Jaffe                | Voice:      (310) 338-0400 x318     |
| Mgr., Research & Development   | Facsimile:  (310) 338-0801          |

| 9841 Airport Blvd, Suite 700   | IBM Mail:   USS24J24 at IBMMAIL     |        
| Los Angeles, CA 90045          | Web page:   www.phoenixsoftware.com |



Tue, 03 Apr 2001 03:00:00 GMT  
 TSR program help
Yes, but...  That reply was meant in the spirit of the thread. <g>

However, I would investigate the following:

1.  ISRs must be far procs by definition.

2.  I am somewhat leary of issuing INTs in ISRs.

3.  Multiplex services should be used to install/deinstall ISRs.

Bob

Quote:



> >Better yet (along with using SVCUPDTE as Ed suggests), do a LOAD for your
> >program, save away the length and then issue a DELETE.  After getting
> >into Key 0 Supervisor State, do your STORAGE OBTAIN for the length you
> >got earlier.  Then do a "directed LOAD" of the program into the obtained
> >area and your ADCONS will be relocated for you automatically.

> Wouldn't it be simpler to use LOAD GLOBAL=YES or the new dynamic LPA
> facility?





Tue, 03 Apr 2001 03:00:00 GMT  
 TSR program help
I am from turkey.  I dont have good english but I can help you if you
understand me. firstly, your code doesnt involv an error but it has
logical erro . You use an interrupt within the another interrupt. You
cannot use any interrupt within the other because of dos restrictions.
but there are some solutions for this problem. I think you must try other
interrupts for example bios interrupts (which deal with keyboard buffer)
you can insert your character to keyboard buffer via this interrupt
Other solutions is that you use

 mov di,01h \ which contain charachter
 mov bx,0b800  
 mov es,bx
 mov bx,0  \ you can change this according to line number you want to use
 mov bx,(di)  
                instead of interrupts
if you want to more send me a mail.
okey byee.



Mon, 09 Apr 2001 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. TSR program help

2. Help Needed on a TSR program

3. Programming TSR, help needed!!!

4. TSR programming (another example program)

5. TSR Program from Hell!

6. TSR PROGRAMMING CONTEST: WINNER GETS....

7. TSR programs

8. TSR Programming Dilema

9. How to write tsr programs? Thanks

10. trapping keys with a tsr program in assembler

11. TSR-Programming

12. TSR-Programming

 

 
Powered by phpBB® Forum Software