TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: JON GENTIL
from: CRAIG HART
date: 1997-06-05 14:31:00
subject: Ringer 2.0

 > Hello All!
 > This is the second posting of this program, and it works fine now, until
 > it starts to ring.  It locks the computer up...
Hi... this program is full of bugs..!
 > THETSR PROC NEAR
needs to be proc far... since it can be called from anywhere.
 >     MOV AH, 03h                      ;Function 3 (Check serial status)
 >     XOR AL, AL                       ;Clear AL
 >     MOV DX, 01h                      ;COM2
you should preserve all registers - your interrupt routine should never leave 
any registers with values other than what you started with. Push every 
register that is modified and pop it before you return.
 >     INT 14h                          ;GO!
 >     TEST AL,01000000b                ;See if RingIndicator is on
 >     JNE RINGING                      ;If So, it's ringing!
 >     DB 0EAh     ;JMP FAR
 >     OldInt1CSegment DW 0,0           ; Procedural Variable - Init here
 > THETSR ENDP
 > RINGING PROC NEAR
Keep your whole ISR in one procedure. Don't split it up.
 > ENDOFPROG EQU $
 >     MOV DX, OFFSET ENDOFPROG+1
DX contains the number of paragraphs to keep TSR, NOT the absolute location. 
A paragraph is 16 bytes...
so, you should do something like:
mov dx,offset endofprog     ; end addr
shr dx,4                    ; divide by 16
inc dx                      ; add one to cover the last few byes.
which will select, at worst, 16 bytes too much. At the moment you're 
selecting  paragraphs of memory - 16 TIMES too much.
there are just a few things, for staters - there's probably many more faults 
yet.... but keep at it - you are getting closer, slowly.
    Craig
--- FMail/386 1.20+
---------------
* Origin: Communications Barrier BBS (03) 9585 1112, 24hrs (3:632/533)

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™.