home *** CD-ROM | disk | FTP | other *** search
- ;
- ; This program allows the print screen interrupt to set up the printer
- ; and then reset it after the screen dump.
-
- ; This file is written to assemble with A86.
- ;
- ; 9 Dec 1989
- ;
- ; Steven Key
- ;
- ; The command a86 emmfool.8
- ; will produce a com file that will intercept all extended memory calls, and
- ; return a version number 4.0 for the call 46h, get version. All other calls
- ; will be ignored.
- ;
- ;
-
- TRUE = -1
- FALSE = 0
-
- Main:
- Jmp HIHO ; jump to Terminate code.
-
- Already_Mess db 'Emm foolem already loaded. $',0d,0a
- db 'Copyright Steven Key.',0d,0a
-
- OurID = 077
- ourstack: dw 32 dup 0 ; Internal stack for safety.
- end_stack:
-
- stk_seg dw ? ; Store stack seg here.
- stk_ptr dw ? ; Store stack ptr here.
- CurrentP dw ? ; current selected printer.
-
- OldInt67 label dword far ; print screen handler.
- Oldint67Off dw ?
- Oldint67Seg dw ?
-
- Old2f label dword far ; print screen handler.
- Old2fOff dw ?
- Old2fSeg dw ?
-
- ;
- ; This is our own 02f int handler.
-
- OurTack:
- cs cmp ah,OurID
- jz Is_Us
- cs jmp Old2f
-
- Is_Us:
- or al,al
- jnz Get_Seg
- mov al,0ff ; return 0ff if it's us they want.
-
- Get_Seg:
- cmp al,1
- jnz Badfunction
- mov es,cs
- iret
-
- BadFunction:
- stc
- iret
-
- OurTick: ; this is the resident code.
-
- cmp ah,046
- jne >l1
- mov ax, 0040
- iret
- l1:
- cs jmp oldint67
-
- pb0port = 061 ; port for speaker bit
- errlen1 = 10
- errlen2 = 15
- errlow = 55
- errhi = 55
-
- ErrBeep:
- ; push ax,bx,cx,dx
- ; mov cx, errlen1
- errbeep1:
- ; mov dx,errlow
- ; mov bx,errlen2
- ; call dotone
- ; mov dx,errhi
- ; mov bx,errlen2
- ; call dotone
- ; loop errbeep1
- ; pop dx,cx,bx,ax
- ; ret
-
- DoTone:
- ; push ax,bx,cx
- ; in al,pb0port
- ; mov ah,al
- ;l1:
- ; and al,0fc
- ; out pb0port,al
- ; mov cx,dx
- ;l2:
- ; loop l2
- ; or al,2
- ; out pb0port ,al
- ; mov cx,dx
- ;l3:
- ; loop l3
- ; dec bx
- ; jnz l1
- ; out pb0port,al
- ;
- ; pop cx,bx,ax
- ; ret
-
-
- progsize = $/16
-
-
-
- HIHO:
- ;
- ; See if we are already loaded.
-
- mov ah,OurId
- mov al,0
- int 02f ; let dos tell us if there is another.
- cmp al,0ff
- jnz Get_PID
- push 0
- pop es
- mov al,1
- mov ah,OurID
- int 02f
- jc Get_PID
- mov bx,es
- cmp bx,0
- jz Get_PID
- jmp Already_loaded
-
-
- Get_PID:
- ;
- ; Let's find our ID, and save it.
-
- mov ah,035
- mov al,067 ; extended memory handler.
- int 021
- mov OldInt67Off, bx
- mov OldInt67Seg, es
-
- mov ah,035
- mov al,02f ; tsr manager.
- int 021
- mov Old2foff,bx
- mov Old2fseg,es
-
- mov ah,025 ; set vector
- mov al,067 ; extended memory handler.
- mov dx,offset OurTick
- int 021
-
- mov ds,cs ; put us in the tsr manager chain.
- mov ah,025
- mov al,02f
- mov dx,offset OurTack
- int 021
-
- mov ah,031 ; now tsr
- mov al,0
- mov dx, progsize +1
- int 021
-
- Already_Loaded:
- mov dx, offset Already_Mess
- mov ah,09
- int 021
-
- mov al,2
- mov ah,04c
- int 021
-