; FIX123.M68  1.5(7)  Created Nov/84, Last modified 13-Mar-85
; Patches to FIX.LIT[1,4]  version 1.1(120)  701-705-065-424
; by Michael Rosenberg & Irv Bromberg, Medic/OS Consultants
COPY PATCH                              ; includes SEARCH SYS
OVER 1,1,0,120.,0
NVER 1,1,0,120.,3                       ; flag 3 patches installed
OHASH 701,705,065,424
NHASH 342,042,141,720

JCB     =A5
Atemp   =A6
Dtemp   =D7

J.DEC=<J.HEX_8.>  ; decimal bit = hex bit shifted left 8 positions

; Patch to display Decimal mode properly
.=2272
CALL    ShowMode
BR      L2306
.=2306
L2306:

; Patch to use TCRT for cursor up output instead of ^K which doesn't work
; on all terminals:
.=12506
       JMP     UpPatch
.=12514
Ret1:

; Patch to allow floating point oparations to take place in one step
.=13040
       JMP     FltPch
.=13046
Ret2:

.=33126
FltPch: CMPW    D7,#47100
       JNE     Ret2
       MOV     A6,204(A0)
       MOVW    (A6),210(A0)
       MOVW    #47161,(A6)
       MOVW    -2(A6),A5
       SUBW    #<47100-40>,A5
       ORW     #32768.,74(SP)
       MOV     A6,76(SP)
       MOV     2064(A0),A6
       MOVW    2070(A0),D1
       ANDW    #31.,D1
       ANDW    #-32.,(A6)
       ORW     D1,(A6)
       ADD     A5,A5
       MOV     0(A5)[A5],A6
       REST    A0-A5,D0-D7
       MOV     (SP),-(SP)
       MOV     A6,4(SP)
       POP     A6
       RTN

; Patch for cursor up
UpPatch:MOVW    #^H0FF03,D1
       TCRT
       MOV     2012(A0),D0
       JMP     Ret1

ShowMode:MOVW   JOBTYP(Atemp),Dtemp
       ANDW    #J.DEC,Dtemp
       BEQ     Hex
       TYPE    <decimal >
       MOVB    #10.,1240(A0)   ; force base 10 for expression evaluations
       RTN
Hex:    TYPE    <hex     >
       RTN
       END