This BP7 CRT.ASM patch has been running over 1 year without problems
on
Pentiums up to 300.mhz
Fred ( replace NOSPAM with worldnet.att.net
*
* TURBO PASCAL 7.0 PATCH FOR RUNTIME 200
* MODIFY CRT.ASM as following code segment indicates
*
; Local workspace
;RUNTIME 200 OLD CODE ----------------------------------------
;DelayCnt DW ?
;END OLD CODE ----------------------------------------
;RUNTIME 200 NEW CODE ++++++++++++++++++++++++++++++++++++++++
DelayCnt DD ?
;END NEW CODE ++++++++++++++++++++++++++++++++++++++++
CurCrtSize DW ?
NormAttr DB ?
ScanCode DB ?
BreakFlag DB ?
DATA ENDS
; One-time initialization
Initialize:
;
;
;
@@2: CMP BL,ES:[DI]
JE @@2
MOV BL,ES:[DI]
MOV AX,-28
CWD
CALL DelayLoop
NOT AX
NOT DX
MOV CX,55
; RUNTIME 200 OLD CODE ----------------------------------------
; DIV CX
; MOV DelayCnt,AX
; END OLD CODE
----------------------------------------
; RUNTIME 200 NEW CODE +++++++++++++++++++++++++++++++++++++++
XOR BX,BX
XCHG AX,BX
XCHG AX,DX
DIV CX
XCHG AX,BX
DIV CX
MOV DELAYCNT.W0,AX
MOV DELAYCNT.W2,BX
; END NEW CODE
+++++++++++++++++++++++++++++++++++++++++
IF DPMIVersion
MOV AX,dpmiGetRMCB
MOV SI,OFFSET CtrlBreak
MOV DI,OFFSET RealModeRegs
PUSH DS
POP ES
PUSH CS
POP DS
INT DPMI
PUSH ES
POP DS
MOV AX,dpmiSetRealInt
MOV BL,1BH
INT DPMI
ELSE
PUSH DS
PUSH CS
POP DS
MOV DX,OFFSET CtrlBreak
MOV AX,dosSetInt*256+1BH
INT DOS
POP DS
ENDIF
RET
;END OF CODE SEGMENTS