TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: JON GENTIL
from: HUGH NOLAND
date: 1997-06-04 14:38:00
subject: Ringer 2.0

JG> This is the second posting of this program, and it works fine now, until 
it
JG> starts to ring.  It locks the computer up...
 
    Your Tsr alters a lot of registers without restoring them.  The computer
is almost guaranteed to hang.  If you are worried about using the Dos
stacks (which well you might be), set up a local stack.  BUT SAVE ALL
REGISTERS.
 
JG> .model tiny
JG> .code
JG> org 100h
 
   I'm never quite sure what I get when I use the 'simplified
directives'.  Try
 
   cseg   segment
   assume cs:cseg
   org 100h
 
JG> START:
JG>     MOV AX, CS                       ;SET DS=CS w/out using stack
JG>     MOV DS, AX
 
   Not necessary.  When Dos loads a COM program it sets all the
segment registers to point to the code segment.
 
JG> JMP LOADUP                           ;Goto Loading Section for TSR
;
;
;
JG> THETSR PROC NEAR
 
    Save all registers
 
JG>     MOV AH, 03h                      ;Function 3 (Check serial status)
JG>     XOR AL, AL                       ;Clear AL
JG>     MOV DX, 01h                      ;COM2
JG>     INT 14h                          ;GO!
JG>     TEST AL,01000000b                ;See if RingIndicator is on
JG>     JNE RINGING                      ;If So, it's ringing!
 
Restore all registers before exiting Tsr
You need to do things in a different order in order to do that.
 
JG>     DB 0EAh     ;JMP FAR
JG>     OldInt1CSegment DW 0,0           ; Procedural Variable - Init here
JG> THETSR ENDP
 
;
;When writing or reading from the screen, my advice would be to use
;direct screen access rather than going through either Dos or the
;BIOS
;
 
 
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 916-893-8079 * (1:119/88)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.