home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / teseract / source / tspopup.asm < prev    next >
Encoding:
Assembly Source File  |  1988-10-02  |  22.6 KB  |  662 lines

  1. IFNDEF TP4
  2.         PAGE 60,132
  3. ;----------------------------------------------------------------------------
  4. SUBTTL  TesSeRact Revision Level 1
  5. ;-----------------------------------------------------------------------------
  6. ;   TesSeRact(tm) -- A Library of Routines for Creating Ram-Resident (TSR)
  7. ;                    programs for the IBM PC and compatible Personal
  8. ;                    Computers.
  9. ;
  10. ;The software, documentation and source code are: 
  11. ;       Copyright (C) 1986, 1987, 1988 Tesseract Development Team
  12. ;       All Rights Reserved 
  13. ;       c/o Chip Rabinowitz
  14. ;       Innovative Data Concepts
  15. ;       2084 Woodlawn Avenue
  16. ;       Glenside, PA 19038
  17. ;       1-215-884-3373
  18. ;
  19. ;-----------------------------------------------------------------------------
  20. ;   This product supports the TesSeRact Standard for Ram-Resident Program 
  21. ;   Communication.  For information about TesSeRact, contact the TesSeRact 
  22. ;   Development Team at:
  23. ;       Compuserve:    70731,20
  24. ;       MCIMAIL:       315-5415
  25. ;   This MCIMAIL Account has been provided to the TesSeRact Development
  26. ;   Team by Borland International, Inc.  The TesSeRact Development Team
  27. ;   is in no way associated with Borland International, Inc.
  28. ;-----------------------------------------------------------------------------
  29.  
  30. INCLUDE tess.inc
  31. IFDEF   ALLPUBLIC
  32. INCLUDE tspopup.pub
  33. ENDIF
  34.  
  35. .MODEL small
  36.  
  37. EXTRN TSRMAIN:FAR
  38. EXTRN TSRBACKPROC:FAR
  39.  
  40. .CODE
  41.  
  42. EXTRN _TESSGETPSP:near
  43. EXTRN _TESSSETPSP:near
  44. EXTRN _TESSSETUPINTS:near
  45. EXTRN _TESSRESTOREINTS:near
  46.  
  47. EXTRN newint9:dword
  48. EXTRN _TESSRELEASETSR:near
  49. EXTRN TESSBEEP:FAR
  50.  
  51. EXTRN TESS_GLOBALS:byte
  52. EXTRN TESS_USERPARMS:byte
  53.  
  54. PUBLIC _TESSDOPOPUP, _TESSDOBACK, _TESS_VIDMODE, _TESS_VIDPAGE
  55.  
  56. ENDIF
  57.  
  58. ;
  59. ;
  60. ; ***************************************************************************
  61. ;       This is the main popup routine.  It is converted from STAYSAVE.INC
  62. ;               and STAYRSTR.INC, from STAY42.ARC, Copyright 1985, 1986,
  63. ;               Lane Ferris, The Hunter's Helper.  This was adapted from
  64. ;               Version 4.15.
  65.  
  66.  
  67. AltF9           db      0,70h
  68.  
  69. _TESS_VIDMODE       db      0
  70. _TESS_VIDPAGE       db      0
  71.  
  72. _TESSDOPOPUP proc near
  73.  
  74.         ASSUMEDS
  75.  
  76.         cli                             ;no interrupts now!!!
  77.  
  78.         or      WPTR [STATUS],TSRACTIVE ;set active bit
  79.  
  80.         mov     WPTR [USERSS],ss        ;save user's stack segment
  81.         mov     WPTR [USERSP],sp        ;... and stack pointer
  82.                                         ;DS was saved in INT8 or INT28
  83.  
  84.         mov     ss,WPTR [OURSSSP+2]     ;load TSR stack segment ...
  85.         mov     sp,WPTR [OURSSSP]       ;... and stack pointer
  86.  
  87.         sti
  88.  
  89.         push    bp                      ;save all registers except for
  90.         push    di                      ;...AX,BX,CX,DX,DS are restored on exit
  91.         push    si                      ;...from this procedure
  92.         push    es
  93.  
  94. stack_pop:
  95.  
  96.         test    WPTR [STATUS],TSRRELEASED
  97.         jz      get_mode
  98.         jmp     save_regs
  99.  
  100. get_mode:
  101.         mov     ah,0fh                  ;get current video mode
  102.         int     10h
  103.  
  104.         and     al,7fh                  ;mask off nonsequitor high bit
  105.  
  106.         mov     _TESS_VIDMODE,al
  107.         mov     _TESS_VIDPAGE,bh        ;save them
  108.  
  109.         cmp     al,7
  110.         jne     not_mono
  111.  
  112.         call    HerculesMode            ;if carry flag set, we're in text mode
  113.  
  114.         jc      not_mono
  115.  
  116.         xor     al,al
  117.         dec     al
  118.  
  119.         mov     _TESS_VIDMODE,al
  120.         mov     _TESS_VIDPAGE,al
  121.  
  122. not_mono:
  123.         test    WPTR [STATUS],NOPOPGRAPH
  124.         jz      check_cmdline           ;if not flagged, don't worry about it
  125.  
  126.         mov     al,_TESS_VIDMODE
  127.  
  128.         cmp     al,3
  129.         jbe     check_cmdline           ; 0-3 are valid
  130.  
  131.         cmp     al,7
  132.         je      check_cmdline           ; we're in mono text!
  133.  
  134. no_graphics:
  135.         mov     al,BPTR [INWORD4]
  136.         or      al,al
  137.         jz      notmsword
  138.  
  139.         mov     al,BPTR [WASWORD4]      ;did we already do this?
  140.         or      al,al
  141.         jz      flip_word               ;nope -- send the char
  142.  
  143.         mov     BPTR [WASWORD4],0
  144.         jmp     short notmsword
  145.  
  146. flip_word:
  147.         mov     ax,5453h
  148.         mov     bx,21h
  149.         mov     cx,WPTR [IDNUM]
  150.         mov     si,1
  151.         mov     di,offset AltF9
  152.         mov     dx,0
  153.         push    cs
  154.         pop     es
  155.         int     2fh
  156.  
  157.         mov     BPTR [WORD4DELAY],32
  158.         mov     BPTR [WASWORD4],1
  159.         jmp     back_popup
  160.  
  161. notmsword:
  162. IFDEF TP4
  163. IFNDEF ASMCOM
  164.         call    FAR PTR TESSBEEP
  165. ELSE
  166.         call    TESSBEEP
  167. ENDIF
  168. ELSE
  169.         call    TESSBEEP
  170. ENDIF
  171.         jmp     back_popup              ;anything else is graphics -- go away
  172.  
  173. check_cmdline:
  174.         test    WPTR [STATUS],NOPOPCOMMAND
  175.         jz      save_regs               ;if not flagged, don't worry about it
  176.  
  177.         mov     al,BPTR [SAVEDINDOSFLG]
  178.         or      al,al
  179.         jz      save_regs               ;if zero, not at command line
  180.  
  181. IFDEF TP4
  182. IFNDEF ASMCOM
  183.         call    FAR PTR TESSBEEP
  184. ELSE
  185.         call    TESSBEEP
  186. ENDIF
  187. ELSE
  188.         call    TESSBEEP
  189. ENDIF
  190.         jmp     back_popup
  191.  
  192. save_regs:
  193.  
  194.         getdta  <[USERDTA]>             ;save current DTA
  195.  
  196.         call    _TESSGETPSP             ;get current PSP segment
  197.         mov     WPTR [USERPSP],bx       ;...returned in BX
  198.  
  199.         mov     bx,WPTR [OURPSP]        ;set TSR's PSP in BX
  200.         call    _TESSSETPSP             ;...and do it
  201.  
  202.         setdta  <[OURDTA]>
  203.  
  204.         call    SaveExtendedErr         ;save DOS extended err info     ;v0.51 
  205.         call    SaveBreak               ;save Ctrl Break status         ;v0.51 
  206.         call    SaveVerify              ;save current verify state      ;v0.51 
  207.  
  208.         test    WPTR [STATUS],TSRRELEASED
  209.         jz      no_rel_pop
  210.  
  211.         call    _TESSRELEASETSR
  212.  
  213.         jmp     short not_released_pop
  214.  
  215. no_rel_pop:
  216.  
  217.         xor     ax,ax                   ;popup-interrupts (1B, 23 and 24)
  218.         call    _TESSSETUPINTS          ;replace with our handler
  219.  
  220.         push    ds                      ;save DS for after popup
  221.         push    es
  222.  
  223.         mov     ax,WPTR [OURDSEG]       ;load user's data segment
  224.         push    ax
  225.         push    ax
  226.         pop     ds
  227.         pop     es
  228.  
  229.         ASSUMENODS
  230.  
  231. call_popup:
  232.  
  233. IFDEF   TP4
  234. IFNDEF ASMCOM
  235.         call    DPTR PMAIN              ;call the user routine!! (TP ver)
  236. ELSE
  237.         call    TSRMAIN                 ;call the user routine!!
  238. ENDIF
  239. ELSE
  240.         call    TSRMAIN                 ;call the user routine!!
  241. ENDIF
  242.  
  243. done_pop:
  244.         pop     es
  245.         pop     ds
  246.  
  247.         ASSUMEDS
  248.  
  249.         xor     ax,ax                   ;restore interrupts (1B, 23 and 24)
  250.         call    _TESSRESTOREINTS
  251.  
  252. not_released_pop:
  253.         mov     al,BPTR [WASWORD4]
  254.         or      al,al
  255.         jz      wasnotword
  256.  
  257.         mov     ax,5453h
  258.         mov     bx,21h
  259.         mov     cx,WPTR [IDNUM]
  260.         mov     si,1
  261.         mov     di,offset AltF9
  262.         mov     dx,0
  263.         push    cs
  264.         pop     es
  265.         int     2fh
  266.  
  267.         mov     BPTR [WASWORD4],0
  268.  
  269. wasnotword:
  270.         call    RestoreVerify           ;restore Verify setting         ;v0.51
  271.         call    RestoreBreak            ;restore CtrlBreak status       ;v0.51
  272.         call    RestoreExtendedErr      ;restore Extended error info    ;v0.51
  273.  
  274.         setdta  <[USERDTA]>             ;restore interrupted DTA
  275.  
  276.  
  277.         mov     bx,WPTR [USERPSP]       ;replace interrupted PSP
  278.         call    _TESSSETPSP
  279.  
  280.         ASSUMEDS
  281.  
  282. ;
  283. ; ***************************************************************************
  284. ;
  285. ;       CAUTION!!!! THE USER ROUTINE MUST RETURN SS:SP WITH THE SAME
  286. ;               VALUES AS ON ENTRY.  OTHER REGISTERS WILL BE RESTORED
  287. ;               BY THIS ROUTINE.
  288. ;
  289. ; ***************************************************************************
  290. ;
  291. back_popup:
  292.  
  293.         ASSUMEDS
  294.  
  295.         pop     es
  296.         pop     si
  297.         pop     di
  298.         pop     bp
  299.  
  300.         cli
  301.  
  302.         mov     ss,WPTR [USERSS]        ;restore user's stack segment
  303.         mov     sp,WPTR [USERSP]        ;... and stack pointer
  304.                                         ;DS will be restored in INT8 or INT28
  305.         and     WPTR [STATUS],NOT HOTKEYON+TSRACTIVE+SHIFTSON
  306.  
  307.         test    WPTR [STATUS],TSRRELEASED
  308.         jz      b1
  309.  
  310.         or      WPTR [STATUS],HOTKEYON+POPUPSET
  311.         and     WPTR [STATUS],NOT TSRENABLED
  312.  
  313. b1:                                     ;clear hot-key and inuse bits
  314.         sti                             ;enable interrupts again
  315. dopopup_end:
  316.         ret
  317.  
  318. _TESSDOPOPUP endp
  319.  
  320. took_ints db 0
  321.  
  322. _TESSDOBACK proc near
  323.  
  324.         ASSUMEDS
  325.  
  326.         cli                             ;no interrupts now!!!
  327.  
  328.         mov     WPTR [USER28SS],ss      ;save user's stack segment
  329.         mov     WPTR [USER28SP],sp      ;... and stack pointer
  330.                                         ;DS was saved in INT8 or INT28
  331.  
  332.         mov     ss,WPTR [OUR28SP+2]     ;load TSR stack segment ...
  333.         mov     sp,WPTR [OUR28SP]       ;... and stack pointer
  334.  
  335. stack_28:
  336.         sti
  337.  
  338.         push    bp                      ;save all registers except for
  339.         push    di                      ;...AX,BX,CX,DX,DS are restored on exit
  340.         push    si                      ;...from this procedure
  341.         push    es
  342.  
  343.         mov     took_ints,0
  344.  
  345.         test    WPTR [STATUS],TSRACTIVE ;did we already take them?
  346.         jnz     no_ints_1
  347.  
  348.         mov     took_ints,1
  349.  
  350.         xor     ax,ax                   ;popup-interrupts (1B, 23 and 24)
  351.         call    _TESSSETUPINTS          ;replace with our handler
  352.  
  353. no_ints_1:
  354.         getdta  <[USER28DTA]>           ;save current DTA
  355.  
  356.         call    _TESSGETPSP             ;get current PSP segment
  357.         mov     WPTR [USER28PSP],bx     ;...returned in BX
  358.  
  359.         mov     bx,WPTR [OURPSP]        ;set TSR's PSP in BX
  360.         call    _TESSSETPSP             ;...and do it
  361.  
  362.         setdta  <[OURDTA]>
  363.  
  364.         push    ds                      ;save DS for after popup
  365.         push    es
  366.  
  367.         mov     ds,WPTR [OURDSEG]       ;load user's data segment
  368.         mov     es,WPTR [OURDSEG]       ;load user's extra segment
  369.  
  370.         ASSUMENODS
  371.  
  372. call_28:
  373.  
  374. IFDEF   TP4
  375. IFNDEF ASMCOM
  376.         call    DPTR PBACKPROC          ;call the user routine!! (TP4 ver)
  377. ELSE
  378.         call    TSRBACKPROC             ;call the user routine!!
  379. ENDIF
  380. ELSE
  381.         call    TSRBACKPROC             ;call the user routine!!
  382. ENDIF
  383.  
  384. done_28:
  385.         pop     es
  386.         pop     ds
  387.  
  388.         ASSUMEDS
  389.  
  390.         setdta  <[USER28DTA]>           ;restore interrupted DTA
  391.  
  392.         mov     bx, WPTR [USER28PSP]    ;replace interrupted PSP
  393.         call    _TESSSETPSP
  394.  
  395.         cmp     took_ints,0
  396.         je      no_ints_2
  397.  
  398.         xor     ax,ax                   ;restore interrupts (1B, 23 and 24)
  399.         call    _TESSRESTOREINTS        ;restore interrupts 
  400.  
  401. no_ints_2:
  402.  
  403.         ASSUMEDS
  404.  
  405.         pop     es
  406.         pop     si
  407.         pop     di
  408.         pop     bp
  409.  
  410. back_28:
  411.         ASSUMEDS
  412.         cli
  413.         mov     ss,WPTR [USER28SS]      ;restore user's stack segment
  414.         mov     sp,WPTR [USER28SP]      ;... and stack pointer
  415.                                         ;DS will be restored in INT8 or INT28
  416.         sti                             ;enable interrupts again
  417.  
  418. do28_end:
  419.         ret
  420.  
  421. _TESSDOBACK endp
  422.  
  423.  
  424. LpSet   equ     03B9h                   ;Set light pen address
  425. LpReset equ     03BBh                   ;Reset light pen address
  426. Lpff    equ     2                       ;Flip-flop suitable for s/w query
  427. Our6845 equ     03B4h                   ;6845 index register
  428. OurStat equ     03BAh                   ;Display Status Port
  429. NotVSync equ    80h                     ;This bit 0 during vertical
  430.                                         ; retrace
  431. UseHerc db      0ffh
  432.  
  433. HerculesMode    PROC    NEAR
  434.         ASSUMEDS
  435.  
  436. ;******************            Mode Detection              ******************
  437.  
  438.         cmp     UseHerc,0ffh
  439.         jne     AlreadyTested
  440.  
  441.         inc     UseHerc                 ;assume no herc
  442.  
  443.         call    HerculesPresent
  444.         jc      AlreadyTested           ;if carry, no herc found
  445.  
  446.         inc     UseHerc                 ;say we have a herc
  447.         
  448. AlreadyTested:
  449.         cmp     UseHerc,0
  450.         je      textmode
  451.  
  452.         xor     al,al
  453.         mov     dx,OurStat
  454. wait1:                                  ;test for v-sync transition
  455.         in      al,dx
  456.         test    al,NotVSync
  457.         jz      wait1
  458. wait2:
  459.         in      al,dx                   
  460.         test    al,NotVSync
  461.         jnz     wait2
  462.  
  463.         xor     al,al                   ;Reset and Set Light Pen.
  464.         mov     dx,LpReset
  465.         out     dx,al
  466.         mov     dx,LpSet
  467.         out     dx,al
  468.  
  469.         mov     al,16                   ;Look in the 6845 for the offset into
  470.         mov     dx,Our6845              ; buffer when the light pen is
  471.         out     dx,al                   ; tripped - high byte.
  472.         inc     dx
  473.         in      al,dx
  474.  
  475.         cmp     al,0dh                  ;threshold value is 0dh
  476.         jb      test_modeval
  477.  
  478.  
  479. ; Otherwise, must be graphics mode
  480. GraphicsMode:
  481.         clc
  482.         jmp     short R0
  483.  
  484. test_modeval:
  485.         xor     ax,ax                   ;secondary test for some
  486.         mov     es,ax                   ;clone herc cards
  487.         mov     al,es:[465h]
  488.         test    al,2
  489.         jnz     GraphicsMode
  490.  
  491. textmode:
  492. ; Not in hercules graphics mode, set carry flag.
  493.         stc
  494.  
  495.  
  496.  
  497. R0:
  498.  
  499.         ret
  500. HerculesMode    ENDP
  501.  
  502. ; ==========================================================================
  503.  
  504. ; Determines if a Hercules Graphics Card is present.
  505.  
  506. status_port     equ     03BAh           ; To detect the presence of a Hercules
  507.                                         ; Graphics Card, look for bit 7 of the
  508.                                         ; Display Mode Status Port to change.
  509.                                         ; On the HGC this bit goes low on
  510.                                         ; vertical retrace. The IBM boards do
  511.                                         ; not utilize this bit.
  512.  
  513. ID_mask         equ     01110000b       ; To detect the presence of a Hercules
  514. Plus_ID         equ     00010000b       ; Graphics Card Plus or InColor Card,
  515. InColor_ID      equ     01010000b       ; look at bits 4, 5, and 6 in the
  516.                                         ; status port. These bits are held in a
  517.                                         ; particular state on the Graphics Card
  518.                                         ; Plus and InColor Card and are
  519.                                         ; undefined (floating) on the earlier
  520.                                         ; Hercules card.
  521.  
  522.  
  523. HerculesPresent proc near
  524.  
  525. ; * * * Test for the presence of a Hercules Graphics Card
  526.                                         ; or not currently active - quit
  527. HGC_test:
  528.         mov     dx, status_port         ; Display Status Port
  529.  
  530.         xor     bl, bl                  ; clear counter
  531.         in      al, dx                  ; take a reading
  532.         and     al, 80h                 ; save bit seven
  533.         mov     ah, al                  ; and keep it handy
  534.  
  535.         mov     cx, 8000h               ; a nice big loop
  536. examine:
  537.         in      al, dx                  ; get another reading
  538.         and     al, 80h                 ; isolate bit seven
  539.         cmp     al, ah                  ; is it the same ?
  540.         je      no_change               ; no - keep trying
  541.         inc     bl                      ; yes, bit toggled - increment counter
  542.  
  543.         cmp     bl, 10                  ; if we see a change 10 times
  544.         jae     Hercules                ; then we assume that a Hercules
  545.                                         ; Graphics Card is present. The check
  546.                                         ; for 10 positive tests is done
  547.                                         ; just to be on the safe side.
  548. no_change:
  549.         loop    examine                 ; continue until CX = 0
  550.                                         ; if the loop expires without
  551.                                         ; 10 successes we assume that
  552.                                         ; something besides a HGC is present
  553.         jmp     short No_Hercules
  554.  
  555. ; * * * * End of test for Hercules Graphics Card * * * * * * * * *
  556.  
  557. Hercules:
  558.  
  559. ;******* Makes sure light pen is present and working before loading *********
  560. ;  If the light pen is not present or not working, then even if it is a
  561. ;    a hercules we can't test for graphics mode, so return a false.
  562.  
  563.         mov     dx,LpSet
  564.         out     dx,al
  565.         mov     dx,OurStat
  566.         in      al,dx
  567.         test    al,Lpff
  568.         jz      No_Hercules             ;If light pen stuck low, can't do
  569.                                         ;mode test - abort.
  570.         mov     dx,LpReset
  571.         out     dx,al
  572.         mov     dx,OurStat
  573.         in      al,dx
  574.         test    al,Lpff
  575.         jnz     No_Hercules             ;If light pen stuck high, can't do
  576.                                         ;mode test - abort.
  577. ; We made it! Hercules present.
  578.          clc
  579.          jmp    short R1
  580.  
  581.  
  582. No_Hercules:
  583.          stc
  584.  
  585. R1:
  586.         ret
  587. HerculesPresent endp
  588.  
  589. ;-----------------------------------------------------------------;     ;v0.51
  590. ;      SAVE/RESTORE CURRENT BREAK STATE, RELAX BREAK CHECKING     ;     ;v0.51
  591. ;-----------------------------------------------------------------;     ;v0.51
  592. ; Routines Courtesy of Thomas Brandenborg                               ;v0.51
  593. SaveBreak proc near                                                     ;v0.51
  594.         ASSUMEDS
  595.         mov     ax,3302h                ;to swap DL with BREAK value    ;v0.51
  596.         xor     dl,dl                   ;DL=0=relax checking            ;v0.51
  597.         int     21h                     ;current level in DL            ;v0.51
  598.         mov     BPTR [OLDBREAK],dl      ;save current level             ;v0.51
  599.         ret                                                             ;v0.51
  600. ; ------------  RESTORE SAVED BREAK CHECKING LEVEL                      ;v0.51
  601. RestoreBreak:                                                           ;v0.51
  602.         mov     ax,3301h                ;to set break check level       ;v0.51
  603.         mov     dl,BPTR [OLDBREAK]      ;get saved break state          ;v0.51
  604.         int     21h                                                     ;v0.51
  605.         ret                                                             ;v0.51
  606. SaveBreak endp                                                          ;v0.51
  607. ;----------------------------------------------------------------;      ;v0.51
  608. ;      SAVE/RESTORE DOS EXTENDED ERROR INFO (Int21.59)           ;      ;v0.51
  609. ;----------------------------------------------------------------;      ;v0.51
  610. ; Routines Courtesy of Thomas Brandenborg                               ;v0.51
  611. SaveExtendedErr proc near                                               ;v0.51
  612.         ASSUMEDS
  613.         push    di                                                      ;v0.53 - CR
  614.         cmp     BPTR [DOSVERSION],3     ;Verify version is DOS 3+       ;v0.51
  615.         jb      DosExtSaved             ;NO - skip if if not 3.x        ;v0.51
  616.         mov     ah,59h                  ;to get err info from DOS       ;v0.51
  617.         xor     bx,bx                   ;BX must be zero                ;v0.51
  618.         push    ds                      ;save DS (clobbered by DOS)     ;v0.51
  619.         int     21h                     ;ext err info in AX,BX,CX       ;v0.51
  620.         pop     ds                      ;restore DS                     ;v0.51
  621.         mov     WPTR [OLDEXTERR],ax     ;save extended error info       ;v0.51
  622.         mov     WPTR [OLDEXTERR+2],bx                                   ;v0.51
  623.         mov     WPTR [OLDEXTERR+4],cx                                   ;v0.51
  624. DosExtSaved:                                                            ;v0.51
  625.         pop     di                                                      ;v0.53 - CR
  626.         ret                                                             ;v0.51
  627. ; -- Restore the Dos 3+ extended error information                      ;v0.51
  628. RestoreExtendedErr:                                                     ;v0.51
  629.         push    di                                                      ;v0.53 - CR
  630.         cmp     BPTR [DOSVERSION],3     ;verify  DOS 3.+                ;v0.51
  631.         jb      DosExtRestored          ;NO - skip this                 ;v0.51
  632.         mov     dx,offset OLDEXTERR     ;DS:DX=3 words of ext err       ;v0.51
  633.         mov     ax,5d0ah                ;to set ext err info            ;v0.51
  634.         int     21h                                                     ;v0.51
  635. DosExtRestored:                                                         ;v0.51
  636.         pop     di                                                      ;v0.53 - CR
  637.         ret                                                             ;v0.51
  638. SaveExtendedErr endp                                                    ;v0.51
  639. ;-----------------------------------------------------------------;     ;v0.51
  640. ;      SAVE/RESTORE CURRENT VERIFY SETTING    (int 21.54)         ;     ;v0.51
  641. ;-----------------------------------------------------------------;     ;v0.51
  642. ; Routines Courtesy of Thomas Brandenborg                               ;v0.51
  643. SaveVerify proc near                                                    ;v0.51
  644.         ASSUMEDS
  645.         mov     ax,5400h                ;Ask for Verify setting         ;v0.51
  646.         int     21h                     ;00=off, 01=on                  ;v0.51
  647.         mov     BPTR [OLDVERIFY],al     ;save current setting           ;v0.51
  648.         ret                                                             ;v0.51
  649. ;--------  RESTORE Write Verify SETTING                                 ;v0.51
  650. RestoreVerify:                                                          ;v0.51
  651.         mov     ah,2Eh                  ;function to set verify         ;v0.51
  652.         mov     al,BPTR [OLDVERIFY]     ;get saved verify state         ;v0.51
  653.         xor     dx,dx                   ;dx = zero to set flag          ;v0.51
  654.         int     21h                                                     ;v0.51
  655.         ret                                                             ;v0.51
  656. SaveVerify endp                                                         ;v0.51
  657. ;-----------------------------------------------------------------;     ;v0.51
  658.                                                                         ;v0.51
  659. ENDIT
  660.