home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / tasm / show87.asm < prev    next >
Assembly Source File  |  1988-08-28  |  46KB  |  1,315 lines

  1. ;*********************************************************
  2. ;* Show87 - (C) Copyright 1988 by Borland International  *
  3. ;*              Used with permission of author           *
  4. ;*********************************************************
  5. ;
  6.  title 'Turbo Assembler SHOW87 Program', '8087 State Display'
  7.  page 65,72
  8. ;=============================================================================
  9. ;
  10. ; This a memory resident program to display the present state of an
  11. ; installed 8087 coprocessor.  Once assembled, to execute, type:
  12. ;
  13. ;   SHOW87 [/R]
  14. ;
  15. ; If run without any options, the program executes a DOS shell and can be
  16. ; removed from memory by typing EXIT at any DOS prompt.  If run with the
  17. ; /R option, the progam is made resident and cannot be removed (but uses
  18. ; less memory).  Uses about 5600 bytes of memory with /R, over 8000 without.
  19. ; Requires CONVERT1.INC, CONVERT2.INC, VIDEO1.INC, and VIDEO2.INC on the
  20. ; default drive/path for assembly.
  21. ;
  22. ; The hot key is ALT-7.  Traps interrupt 16H and uses only BIOS routines for
  23. ; display, thus should work on most computers with most software.
  24. ;
  25. ;
  26. ;----------------------------------------------------------------------------
  27. ;8 Ins Ptr  XXXXX | Prec      XX | ST(0) +X.XXXXXXXXXXXXXXXXX +XXXXX XXXXXX S
  28. ;0 Opr Ptr  XXXXX | Round  XXXXX | ST(1) +X.XXXXXXXXXXXXXXXXX +XXXXX XXXXXX H
  29. ;8 Op Code   XXXX | Infin  XXXXX | ST(2) +X.XXXXXXXXXXXXXXXXX +XXXXX XXXXXX O
  30. ;7 Control   XXXX |------------- | ST(3) +X.XXXXXXXXXXXXXXXXX +XXXXX XXXXXX W
  31. ;| Status    XXXX | Cond    XXXX | ST(4)    =XXXXXXXXXXXXXXXX  =XXXX XXXXXX 8
  32. ;S Tag       XXXX | Comp       X | ST(5)    =XXXXXXXXXXXXXXXX  =XXXX XXXXXX 7
  33. ;T ---------------| Test       X | ST(6)    =XXXXXXXXXXXXXXXX  =XXXX XXXXXX |
  34. ;A Stack Top    X | Exam  XXXXXX | ST(7)    =XXXXXXXXXXXXXXXX  =XXXX XXXXXX X
  35. ;T ------------------------------------------------------------------------ X
  36. ;E Except PX UX OX ZX DX IX    Intr Mask PX UX OX ZX DX IX    Ints XXXXXXXX X
  37. ;----------------------------------------------------------------------------
  38. ;
  39. ; Compare: > < = ?
  40. ; Test: + - 0 ?
  41. ; Examine:  +Unorm +NAN -Unorm -NAN +Norm +Infin -Norm -Infin +0 -0
  42. ;           +Dnorm -Dnorm Empty
  43. ; Precision: 24 53 64 ??
  44. ; Rounding:  near Up Down Trunc
  45. ; Infinity:  Proj Affin
  46. ; Interrupts: Enabled Disabled
  47. ;=========================================================================
  48. ;
  49. Ver_Hi          equ     1       ;ones version number
  50. Ver_Lo          equ     10      ;tens version number
  51.  
  52. HotKey          equ     7e00h   ;hot key, Alt-7
  53. StartRow        equ     0       ;screen row offset
  54. StartCol        equ     0       ;screen column offset
  55. Rows            equ     12      ;rows in display
  56. Cols            equ     76      ;columns in display
  57.  
  58. Atr_Bor         equ     07h     ;border attribute
  59. Atr_Mes         equ     70h     ;edge text attribute
  60. Atr_Lin         equ     07h     ;line attribute
  61. Atr_Tex         equ     07h     ;center text attribute
  62. Atr_Set         equ     07h     ;number and settings attribute
  63.  
  64. Sig_Bits        equ     57      ;number of significant bits in real
  65.                                 ;number display
  66.  
  67. ;================================================
  68. ; Main program, execute shell after resetting
  69. ; interrupt 16H.
  70. ;================================================
  71. ;
  72.  
  73. .model TINY
  74. .code
  75. org 100h
  76.  
  77. ;----------------- Program Entry point --------------------------
  78. Entry:
  79.         jmp Init                ;go to initialization
  80.  
  81. ;--- switch stack and set memory allocation
  82.  
  83. Start:
  84.         mov     bx, offset Program_Stack        ;new stack top
  85.         mov     sp, bx                          ;switch to stack
  86.         mov     cl, 4
  87.         shr     bx, cl                          ;make paragraph
  88.         inc     bx                              ;account for extra
  89.  
  90.         test    byte ptr Status, Status1        ;check if resident mode
  91.         jnz     Main1
  92.  
  93.         mov     ah, 4ah                         ;function
  94.         int     21h                             ;execute
  95.  
  96. ;--- save the interrupt data
  97.  
  98. Main1:
  99.         push    bx
  100.         push    es
  101.         mov     ax, 3516h                       ;function and interrupt number
  102.         int     21h
  103.         mov     word ptr Original16, bx         ;save offset
  104.         mov     word ptr Original16+2, es       ;save segment
  105.         pop     es
  106.         pop     bx
  107.  
  108. ;--- load the new interrupt
  109.  
  110.         mov     ax, 2516h                       ;function
  111.         mov     dx, offset Interrupt16          ;entry point offset
  112.         int     21h                             ;execute
  113.  
  114.         test    byte ptr Status, Status1        ;check if resident mode
  115.         jnz     Main3
  116.  
  117. ;--- initialize the EXEC parameter block and enter shell
  118.  
  119.         push    es
  120.         push    ds
  121.         mov     Prog_Off, sp                    ;save stack offset
  122.         mov     Prog_Seg, ss                    ;save stack segment
  123.  
  124.         mov     ax, 4b00h
  125.         mov     bx, offset Parameter_Blk        ;pararmeter block location
  126.         mov     [bx+4], cs                      ;save the present segment
  127.         mov     dx, CmdLoc                      ;program name offset
  128.         mov     ds,cs:[2ch]                     ;             segment
  129.         int     21h
  130.  
  131.         cli
  132.         mov     sp, cs:Prog_Off                 ;restore stack offset
  133.         mov     ss, cs:Prog_Seg                 ;restore stack segment
  134.         sti
  135.         pop     ds
  136.         pop     es
  137.  
  138. ;--- show exit message
  139.  
  140.         sub     al, al
  141.         mov     dx, offset Closemes             ;normal termination message
  142.         jnc     Main2
  143.         mov     al, 0ffh
  144.         mov     dx, offset Errormes             ;error message
  145. Main2 :
  146.         mov     ah, 9                           ;function
  147.         int     21h                             ;show message
  148.  
  149. ;--- finished
  150.  
  151.         push    ax                              ;save return code
  152.         mov     ax, 2516h                       ;function
  153.         lds     dx, Original16                  ;load original interrupt
  154.                                                 ;  location
  155.         int     21h                             ;execute
  156.         pop     ax
  157.  
  158.         mov     ah, 4ch                         ;exit function
  159.         int     21h                             ;execute
  160.  
  161. ;--- resident mode, terminate and stay resident
  162.  
  163. Main3 :
  164.         mov     ax, 3100h                       ;function and return code
  165.         mov     dx, bx                          ;paragraphs to save
  166.         int     21h                             ;execute
  167.  
  168. ;================================================
  169. ; Control recieved through interrupt 16H.
  170.  
  171. Interrupt16 proc far
  172.  
  173. ;--- check if activation key
  174.         sti                                     ;interrrupts on
  175.         cmp     ah, 0                           ;check if key request
  176.         je      Inter1
  177.         cmp     ah, 1                           ;check if status request
  178.         je      Inter2
  179.         jmp     cs:Original16                   ;non-key request,
  180.                                                 ; transfer directly to INT 16
  181.  
  182. ;--- key request, function 0
  183.  
  184. Inter1:
  185.         pushf                                   ;flags on stack
  186.         call    cs:Original16                   ;get key
  187.         cmp     ax, HotKey                      ;check if activation key
  188.         je      Inter5                          ;jump if so
  189.         iret
  190.  
  191. ;--- key status request
  192.  
  193. Inter2 :
  194.         pushf                                   ;flags on stack
  195.         call    cs:Original16                   ; get key status
  196.         jz      Inter3                          ;jump if no key
  197.         pushf                                   ;must save return flags
  198.         cmp     ax, HotKey                      ;check if activation key
  199.         je      Inter4                          ;jump if so
  200.         popf                                    ;not key, restore flags
  201. Inter3 :
  202.         ret 2
  203.  
  204. ;=== activation key detected, proceed with display
  205.  
  206. ;--- status only, must toss out key
  207.  
  208. Inter4 :
  209.         add     sp, 2                           ;throw out flags save
  210.                                                 ;  by status
  211.         sub     ah, ah                          ;get key function
  212.         pushf                                   ;flags on stack
  213.         call    cs:Original16                   ;get key
  214.         mov     ah, 1                           ;reset actual function
  215.  
  216. ;--- save stack
  217.  
  218. Inter5 :
  219.         mov     cs:Stack_Seg, ss                ;segment
  220.         mov     cs:Stack_Off, sp                ;offset
  221.  
  222. ;--- switch to local stack
  223.  
  224.         cli
  225.         push    cs
  226.         pop     ss                              ;set to local segment
  227.         mov     sp, offset Local_Stack          ;set to offset
  228.         sti
  229.  
  230. ;--- save registers
  231.         pushf
  232.         push    ax
  233.         push    bx
  234.         push    cx
  235.         push    dx
  236.         push    di
  237.         push    si
  238.         push    Bp
  239.         push    ds
  240.         push    es
  241.  
  242. ;--- initialize
  243.         push    cs
  244.         pop     ds                              ;set data segment
  245.         push    cs
  246.         pop     es                              ;set other data segment
  247.  
  248.         cli
  249.         fnsave  State_Area                      ;save the 8087 state
  250.         fwait                                   ;synchronize
  251.         sti
  252.  
  253.         cld                                     ;normal direction
  254.         mov     IntFunc, ah                     ;save the function for
  255.                                                 ;   termination
  256.         call    Video_Init                      ;initialize display data
  257.  
  258.         call    Video_Cget                      ;get the cursor location
  259.         mov     CurLoc, dx                      ;save it
  260.  
  261. ;--- save the screen area
  262.         mov     dh, StartRow                    ;first row
  263.         mov     di, offset Save_Area            ;screen save area
  264.  
  265. Inter6 :
  266.         mov     dl, StartCol                    ;first column
  267.  
  268. Inter7 :
  269.         call    Video_Cset                      ;move cursor
  270.  
  271.         mov     ah, 8                           ;function
  272.         mov     bh, Video_Page                  ;get the page
  273.         push    di
  274.         int     10h                             ;execute, get character
  275.         pop     di
  276.         stosw                                   ;store ah and al
  277.         inc     dl                              ;next column
  278.  
  279.         cmp     dl, StartCol+Cols               ;check if past end
  280.         jb      Inter7                          ;loop back if not
  281.         inc     dh                              ;next row
  282.  
  283.         cmp     dh, StartRow+Rows               ;check if past end
  284.         jb      Inter6                          ;loop back if not
  285.  
  286. ;--- show main display
  287.  
  288.         mov     bl, Atr_Set                     ;attribute
  289.         mov     cx, StartRow*256+StartCol       ;upper left corner
  290.         mov     dx, ((StartRow+Rows-1)*256)+StartCol+Cols-1
  291.                                                 ;lower right corner
  292.         call    Video_Cpag                      ;clear screen area
  293.         mov     si, offset Display1             ;main display string
  294.         call    Video_Wstr                      ;write to screen
  295.  
  296. ;--- show stats
  297.  
  298.         call    Display_State                   ;show state
  299.  
  300. ;--- wait for key
  301.  
  302.         mov     dx, ((StartRow+Rows-1)*256)+StartCol+Cols-1
  303.                                                 ;lower right corner
  304.         call    Video_Cset                      ;move cursor there
  305.  
  306.         sub     ah, ah                          ;function number
  307.         pushf
  308.         call    dword ptr Original16            ;get a key
  309.  
  310. ;--- restore the screen area
  311.  
  312.         mov     dh, StartRow                    ;first row
  313.         mov     si, offset Save_Area            ;screen save area
  314.  
  315. Inter8  :
  316.         mov     dl, StartCol                    ;first column
  317.  
  318. Inter9  :
  319.         call    Video_Cset                      ;move cursor
  320.  
  321.         lodsw                                   ;load character
  322.                                                 ;   and attribute
  323.         mov     bl, ah                          ;attribute
  324.         mov     ah, 9                           ;function
  325.         mov     bh, Video_Page                  ;get the page
  326.         mov     cx, 1                           ;count
  327.         push    si
  328.         int     10h                             ;execute, get character
  329.         pop     si
  330.  
  331.         inc     dl
  332.         cmp     dl, StartCol+Cols               ;check if past end
  333.         jb      Inter9                          ;loop back if not
  334.         inc     dh                              ;next row
  335.  
  336.         cmp     dh, StartRow+Rows               ;check if past end
  337.         jb      Inter8                          ;loop back if not
  338.  
  339. ;--- finished
  340.  
  341.         mov     dx, CurLoc                      ;get cursor location
  342.         call    Video_Cset                      ;set it
  343.  
  344.         frstor  State_Area                      ;restore state
  345.  
  346.         pop     es
  347.         pop     ds
  348.         pop     bp
  349.         pop     si
  350.         pop     di
  351.         pop     dx
  352.         pop     cx
  353.         pop     bx
  354.         pop     ax
  355.         popf
  356.  
  357. ;--- restore original stack
  358.  
  359.         cli
  360.         mov     ss, cs:Stack_Seg                ;segment
  361.         mov     sp, cs:Stack_Off                ;offset
  362.         sti
  363.  
  364. ;--- transfer to interrupt 16H as if nothing had happened
  365.  
  366.         mov     ah, cs:IntFunc                  ;save the function
  367.                                                 ;  for termination
  368.         jmp     cs:Original16                   ;transfer to INT 16
  369.         endp                                    ;Interrupt16
  370.  
  371. ;======================================================
  372. ; Display the 8087 state.
  373. ;=======================================================
  374. Display_State proc near
  375.  
  376. ;--- instruction pointer
  377.  
  378.         mov     ax, State_Area+6   ;instruction pointer, lower 16 bits
  379.         mov     bx, State_Area+8   ;                     upper 4 bits
  380.         mov     cl, 12
  381.         shr     bx, cl                          ;put the bits in the bottom
  382.         mov     cx, 5*256+16                    ;display width and base
  383.         mov     dx, 1*256+11                    ;display location offset
  384.         call    Display_Number                  ;display
  385.  
  386. ;--- operand pointer
  387.  
  388.         mov     ax, State_Area+10   ;operand pointer, lower 16 bits
  389.         mov     bx, State_Area+12   ;                 upper 4 bits
  390.         push    cx
  391.         mov     cl, 12
  392.         shr     bx, cl                          ;put the bits in the bottom
  393.         pop     cx
  394.         inc     dh                              ;next row
  395.         call    Display_Number                  ;display
  396.  
  397. ;--- op code
  398.  
  399.         mov     ax, State_Area+8                ;get the op code
  400.         and     ax, 0000011111111111b           ;mask out bits
  401.         or      ax, 1101100000000000b           ;set implicit bits
  402.         sub     bx, bx                          ;clear high word
  403.         mov     ch, 4                           ;new display width
  404.         inc     dh                              ;next row
  405.         inc     dl                              ;next column
  406.         call    Display_Number                  ;display
  407.  
  408. ;--- control word
  409.  
  410.         mov     ax, State_Area                  ;control word
  411.         inc     dh                              ;next row
  412.         call    Display_Number                  ;display
  413.  
  414. ;--- status word
  415.  
  416.         mov     ax, State_Area+2                ;status word
  417.         inc     dh                              ;next row
  418.         call    Display_Number                  ;display
  419.  
  420. ;--- tag word
  421.  
  422.         mov     ax, State_Area+4                ;tag word
  423.         inc     dh                              ;next row
  424.         call    Display_Number                  ;display
  425.  
  426. ;--- stack top
  427.  
  428.         call    Get_Stack                       ;get the stack top
  429.         sub     ah, ah
  430.         add     dx, 0203h                       ;add two to the rows and add
  431.                                                 ;   three to the columns
  432.         mov     cx, 1*256+10                    ;display width and base
  433.         call    Display_Number                  ;display
  434.  
  435. ;--- precision
  436.  
  437.         mov     bl, State_Area+1                ;high word of control
  438.         and     bl, 11b                         ;mask bits
  439.         sub     bh, bh
  440.         mov     cl, 2                           ;width
  441.         mov     dx, 1*256+29                    ;display location offset
  442.         mov     di, offset Dissta3b             ;table
  443.         call    Display_Istr                    ;display string
  444.  
  445. ;--- rounding
  446.  
  447.         mov     bl, byte ptr State_Area+1       ;high word of control
  448.         and     bl, 1100b                       ;mask bits
  449.         sub     bh, bh
  450.         shr     bx, 1
  451.         shr     bx, 1
  452.         mov     cl, 5                           ;width
  453.         inc     dh
  454.         sub     dl, 3                           ;display location offset
  455.         mov     di, offset Dissta4b             ;table
  456.         call    Display_Istr                    ;display string
  457.  
  458. ;--- infinity
  459.  
  460.         mov     bl, byte ptr State_Area+1       ;high word of control
  461.         and     bl, 10000b                      ;mask bit
  462.         sub     bh, bh
  463.         mov     cl, 4
  464.         shr     bx, cl
  465.         mov     cl, 5                           ;width
  466.         inc     dh                              ;next row
  467.         mov     di, offset Dissta5b             ;table
  468.         call    Display_Istr                    ;display string
  469.  
  470. ;--- condition codes
  471.  
  472.         mov     al, byte ptr State_Area+3       ;high byte of status
  473.         call    Adjst_Codes                     ;adjust the condition codes
  474.         sub     bx, bx                          ;clear high word
  475.         mov     cx, 4*256+2                     ;display width and base
  476.         add     dx, 0201h                       ;new location
  477.         call    Display_Number                  ;display
  478.  
  479. ;--- comparison and test
  480.  
  481.         call    Get_Comp                        ;get the index
  482.         mov     cl, 1                           ;width
  483.         add     dx, 0103h                       ;location
  484.         mov     di, offset Dissta1b             ;table
  485.         call    Display_Istr                    ;display string
  486.  
  487.         inc     dh
  488.         mov     di, offset Dissta2b             ;table
  489.         call    Display_Istr                    ;display string
  490.  
  491. ;--- examine
  492.  
  493.         mov     al, byte ptr State_Area+3       ;high byte of status
  494.         inc     dh
  495.         sub     dl, 5                           ;location
  496.         call    Display_Exam                    ;display
  497.  
  498. ;--- exception bit settings
  499.  
  500.         mov     al, byte ptr State_Area+2       ;get the bits
  501.         mov     dx, 10*256+10                   ;display offset
  502.         call    Display_Bits                    ;display
  503.  
  504. ;--- mask bit settings
  505.  
  506.         mov     al, byte ptr State_Area         ;get the bits
  507.         mov     dx, 10*256+41                   ;display offset
  508.         call    Display_Bits                    ;display
  509.  
  510. ;--- interrupts
  511.  
  512.         mov     ax, word ptr State_Area         ;control word
  513.         shl     ax,1                            ;shift bit to high byte
  514.         and     ah, 1b                          ;mask
  515.         mov     bl, ah
  516.         sub     bh, bh
  517.         mov     cl, -8                          ;width
  518.         mov     dx, 10*256+66                   ;display offset
  519.         mov     di, offset Dissta6b             ;table
  520.         call    Display_Istr                    ;display string
  521.  
  522. ;--- show stack data
  523.  
  524.         call    Display_Stack                   ;show stack values
  525.         ret
  526.  
  527. ;--- data
  528.  
  529. Dissta1a db '>',0, '<',0, '=',0, '?',0
  530. Dissta1b dw offset Dissta1a
  531.          dw offset Dissta1a+2
  532.          dw offset Dissta1a+4
  533.          dw offset Dissta1a+6
  534.  
  535. Dissta2a db '+',0, '-',0, '0',0, '?',0
  536. Dissta2b dw offset Dissta2a
  537.          dw offset Dissta2a+2
  538.          dw offset Dissta2a+4
  539.          dw offset Dissta2a+6
  540.  
  541. Dissta3a db '24',0, '??',0, '53',0, '64',0
  542. Dissta3b dw offset Dissta3a
  543.          dw offset Dissta3a+3
  544.          dw offset Dissta3a+6
  545.          dw offset Dissta3a+9
  546.  
  547. Dissta4a db 'Near',0, 'Up',0, 'Down',0, 'Trunc',0
  548. Dissta4b dw offset Dissta4a
  549.          dw offset Dissta4a+5
  550.          dw offset Dissta4a+8
  551.          dw offset Dissta4a+13
  552.  
  553. Dissta5a db 'Proj',0, 'Affin',0
  554. Dissta5b dw offset Dissta5a
  555.          dw offset Dissta5a+5
  556.  
  557. Dissta6a db 'Enabled',0, 'Disabled',0
  558. Dissta6b dw offset Dissta6a
  559.          dw offset Dissta6a+8
  560.  endp   ;Display_State
  561.  
  562. ;================================================
  563. ; Display of the settings of six consecutive
  564. ; bits.
  565. ;
  566. ; In: al= bit pattern; dx= row and column display
  567. ; offset.
  568. ;==================================================
  569. ;
  570. Display_Bits proc near
  571.         mov     ah, al
  572.         mov     bh, 20h                         ;first bit to check
  573.         mov     cx, 6                           ;bits to check
  574.         add     dx, StartRow*256+StartCol       ;real screen location
  575.  
  576. ;--- loop for each bit
  577.  
  578. Disbit1 :
  579.         mov     al, '-'                         ;not set sign
  580.         test    ah, bh                          ;check if set
  581.         jz      Disbit2
  582.         mov     al, '+'                         ;set sign
  583.  
  584. Disbit2  :
  585.         call    Display_Char                     ;display character
  586.         shr     bh,1                             ;shift bit to test
  587.         add     dl, 2                            ;next location
  588.         loop    Disbit1
  589.  
  590.         ret
  591.  endp           ;Display_Bits
  592.  
  593. ;================================================
  594. ; Display the stack values.
  595. ;================================================
  596. Display_Stack proc near
  597.         std
  598.         mov     bx, offset State_Area           ;save area
  599.         add     bx, 14                          ;skip to numbers
  600.         mov     cx, 8                           ;8087 stack entries
  601.         mov     dh, StartRow+1                  ;first display row
  602.  
  603. ;=== display a number
  604.  
  605. Disstk1 :
  606.         push    bx
  607.         push    cx
  608.  
  609.         fld     TBYTE PTR [bx]                  ;load number
  610.  
  611. ;--- get number type or set to empty
  612.  
  613.         push    cx                              ;save stack number
  614.         call    Get_Stack                       ;get the stack top
  615.         mov     cl, al
  616.         mov     ax, word ptr State_Area+4       ;get the tag word
  617.         shl     cl,1                            ;two bits for each tag
  618.         ror     ax, cl                          ;adjust so first tag is
  619.                                                 ;  in low bits
  620.         pop     cx
  621.         mov     ch, 8
  622.         sub     ch, cl
  623.         shl     ch, 1                           ;bits to shift to put set
  624.                                                 ;  tag low
  625.         mov     cl, ch
  626.         shr     ax, cl                          ;tag bits to lower bit
  627.                                                 ;  locations 0 and 1
  628.         and     ax, 11b                         ;mask bits
  629.  
  630. ;--- check type
  631.  
  632.         cmp     ax, 11b                         ;check if empty
  633.         je      Disstk2
  634.  
  635.         fxam                                    ;check number type
  636.         fstsw   Status87                        ;store status
  637.  
  638.         cmp     ax, 10b                         ;check if special
  639.         je      Disstk3                         ;jump if so
  640.  
  641. ;--- normal value
  642.  
  643.         call    Display_Float                   ;display decimal number
  644.         jmp     short Disstk4
  645.  
  646. ;--- empty
  647.  
  648. Disstk2  :
  649.         mov     Status87, 0ffffh                ;set all bits
  650.  
  651. ;--- special number
  652.  
  653. Disstk3   :
  654.         call    Display_Hex                     ;display hexadecimal bit
  655.                                                 ;  pattern
  656.  
  657. ;--- finished with a single stack number
  658.  
  659. Disstk4    :
  660.         mov     al, byte ptr Status87+1         ;high byte of status
  661.         call    Display_Exam                    ;display
  662.         pop     cx
  663.         pop     bx
  664.  
  665.         add     bx, 10                          ;next stack entry
  666.         inc     dh                              ;next row
  667.         loop    Disstk1                         ;loop for each entry
  668.  
  669.         cld
  670.         ret
  671.  endp           ;Display_Stack
  672.  
  673. ;================================================
  674. ; Display a decimal floating point number.
  675. ;
  676. ; In: ST(0)= number; dh= row.
  677. ;
  678. ; Out: dx= row and column one space after number.
  679. ;==================================================
  680. ;
  681. Display_Float proc near
  682.  
  683. ;--- convert number and store
  684.  
  685.         mov     ax, Sig_Bits                    ;number of significant bits
  686.         call    Flt2dec                         ;convert to decimal
  687.         mov     si, offset Number_Store         ;storage for number
  688.         fbstp   Tbyte Ptr [si]                  ;save number string
  689.  
  690. ;--- display the mantissa sign
  691.  
  692.         push    ax                              ;save the exponent
  693.         mov     dl, StartCol+40                 ;column
  694.  
  695.         add     si, 9                           ;goto last byte
  696.         fwait                                   ;let fbstp finish
  697.         lodsb                                   ;get the sign byte
  698.         mov     ah, '+'
  699.         test    al, 80h                         ;check if negative
  700.         jz      Disflt1
  701.         mov     ah, '-'
  702. Disflt1 :
  703.         mov     al, ah                          ;sign
  704.         call    Display_Char                    ;display character
  705.  
  706. ;--- first two digits and decimal point
  707.  
  708.         lodsb
  709.         call    Display_Bhi                     ;high digit
  710.         push    ax
  711.         mov     al, '.'                         ;decimal point
  712.         call    Display_Char                    ;write point
  713.         pop     ax
  714.         call    Display_Blo                     ;low digit
  715.  
  716. ;--- remaining mantissa digits
  717.  
  718.         mov     cx, 8                           ;remaining number of
  719.                                                 ;  packed bytes
  720.  
  721. Disflt2 :
  722.         lodsb
  723.         call    Display_Bhi                     ;high digit
  724.         call    Display_Blo                     ;low digit
  725.         loop    Disflt2
  726.  
  727. ;--- exponent sign
  728.  
  729.         pop     ax
  730.         inc     dl                              ;skip to exponent location
  731.  
  732.         mov     cl, '+'                         ;plus
  733.         add     ax, 17                          ;adjust for decimal point
  734.         jns     Disflt3                         ;jump if not minus
  735.         mov     cl, '-'                         ;minus
  736.         neg     ax
  737. Disflt3 :
  738.         push    ax
  739.         mov     al, cl
  740.         call    Display_Char                    ;display
  741.         pop     ax
  742.  
  743.          ;--- exponent
  744.  
  745.         sub     bx, bx                          ;clear high word
  746.         mov     cx, 5*256+10                    ;load width and base
  747.         call    Display_Number                  ;display
  748.         add     dl, 6                           ;position cursor at end
  749.         ret
  750.  
  751. ;=================================================
  752. ; Display a high packed BCD digit.
  753. ;
  754. ; In: al= packed BCD digits; bl= attribute.
  755. ;==================================================
  756. Display_Bhi proc near
  757.         push    ax
  758.         shr     al, 1
  759.         shr     al, 1
  760.         shr     al, 1
  761.         shr     al, 1                           ;shift the high bits
  762.         add     al, '0'                         ;convert to decimal digit
  763.         call    Display_Char                    ;write point
  764.         pop     ax
  765.         ret
  766.  endp           ;Display_Bhi
  767.  
  768. ;=================================================
  769. ; Display a low packed BCD digit.
  770. ;
  771. ; In: al= packed BCD digits; bl= attribute.
  772. ;==================================================
  773. ;
  774. Display_Blo proc near
  775.         push    ax
  776.         and     al, 0fh                         ;mask relevant bits
  777.         add     al, '0'                         ;convert to decimal digit
  778.         call    Display_Char                    ;write point
  779.         pop     ax
  780.         ret
  781.  endp                   ;Display_Blo
  782.  
  783.  endp                   ;Display_Float
  784.  
  785. ;================================================
  786. ; Display the bit pattern of a floating point
  787. ; number.
  788. ;
  789. ; In: ST(0)= number; dh= row.
  790. ;
  791. ; Out: dx= row and column one space after number.
  792. ;==================================================
  793. ;
  794. Display_Hex proc near
  795.         fstp    Dishex1                         ;store number
  796.         fwait                                   ;wait just in case
  797.  
  798.         mov     al, '='                         ;starting character
  799.         mov     dl, byte ptr StartCol+43        ;column
  800.         call    Display_Char                    ;display
  801.  
  802.         mov     cx, 8                           ;bytes
  803.         lea     si, Dishex1+7                   ;last byte of mantissa
  804.         call    Display_Byts                    ;display
  805.  
  806.         mov     al, '='                         ;starting character
  807.         add     dl, 2                           ;column
  808.         call    Display_Char                    ;display
  809.  
  810.         mov     cx, 2                           ;bytes
  811.         lea     si, Dishex1+9                   ;last byte of exponent
  812.         call    Display_Byts                    ;display
  813.  
  814.         inc     dl                              ;next column
  815.         ret
  816.  
  817. ;--- storage for the tempory real number
  818.  
  819. Dishex1 label Tbyte
  820.         dt ?        ;
  821.  
  822. ;================================================
  823. ; Display backwards bytes.
  824. ;
  825. ; In: si= starting location; cx= bytes.
  826. ;=================================================
  827. ;
  828. Display_Byts proc near
  829.         pushf
  830.         std
  831.         sub     ah, ah                          ;clear high byte
  832.         sub     bx, bx                          ;clear high word
  833.  
  834. Disbys1  :
  835.         lodsb                                   ;load byte
  836.         push    cx
  837.         push    si
  838.         mov     cx, 2*256+16                    ;format
  839.         call    Display_Number                  ;display
  840.         add     dl, 2                           ;next location
  841.         pop     si
  842.         pop     cx
  843.         loop    Disbys1                         ;loop for each byte
  844.         popf
  845.         ret
  846.  endp                   ;Display_Byts
  847.  
  848.  endp                   ;Display_Hex
  849.  
  850. ;================================================
  851. ; Display an FXAM result.
  852. ;
  853. ; In: al= high byte of 8087 status; dx= row and
  854. ; column location.
  855. ;=================================================
  856. ;
  857. Display_Exam proc near
  858.         call    Adjst_Codes                     ;adjust the condition codes
  859.         mov     bx, ax
  860.         mov     cl, 6                           ;width
  861.         mov     di, offset Disexm1b             ;table
  862.         call    Display_Istr                    ;display string
  863.         ret
  864.  
  865. ;--- data
  866.  
  867. Disexm1a db '+Unorm',0, '+NAN',0, '-Unorm',0, '-NAN',0
  868.          db '+Norm',0, '+Infin',0, '-Norm',0, '-Infin',0
  869.          db '+0',0, '-0',0, '+Dnorm',0, '-Dnorm',0, 'Empty',0
  870. Disexm1b dw offset Disexm1a
  871.          dw offset Disexm1a+7
  872.          dw offset Disexm1a+12
  873.          dw offset Disexm1a+19
  874.          dw offset Disexm1a+24
  875.          dw offset Disexm1a+30
  876.          dw offset Disexm1a+37
  877.          dw offset Disexm1a+43
  878.          dw offset Disexm1a+50
  879.          dw offset Disexm1a+70
  880.          dw offset Disexm1a+53
  881.          dw offset Disexm1a+70
  882.          dw offset Disexm1a+56
  883.          dw offset Disexm1a+70
  884.          dw offset Disexm1a+63
  885.          dw offset Disexm1a+70
  886.  
  887.  endp           ;Display_Exam
  888.  
  889. ;================================================
  890. ; Get the stack top number.
  891. ;
  892. ; Out: al= stack number.
  893. ;=================================================
  894. ;
  895. Get_Stack proc near
  896.         mov     al, byte ptr State_Area+3       ;get the high byte
  897.                                                 ;  of the status word
  898.         and     al, 00111000b                   ;mask out stack
  899.         shr     al, 1
  900.         shr     al, 1
  901.         shr     al, 1                           ;adjust
  902.         ret
  903.  endp            ;Get_Stack
  904.  
  905. ;================================================
  906. ; Adjust the condition codes to consecutive bits.
  907. ;
  908. ; In: al= high byte of status.
  909. ; Out: ax= condition codes in consecutive, least
  910. ; significant bit locations.
  911. ;=================================================
  912. ;
  913. Adjst_Codes proc near
  914.         mov     ah, al
  915.         and     al, 00000111b                   ;mask C2 to C0 bits
  916.         and     ah, 01000000b                   ;mask C3 bit
  917.         shr     ah , 1
  918.         shr     ah , 1
  919.         shr     ah , 1                          ;shift bit over
  920.         or      al, ah                          ;combine
  921.         sub     ah, ah
  922.         ret
  923.  endp           ;Adjst_Codes
  924.  
  925. ;================================================
  926. ; Get an index for the comparison and test
  927. ; instructions. Based on the condition codes.
  928. ;
  929. ; Out: bx= index.
  930. ;==================================================
  931. ;
  932. Get_Comp proc near
  933.         sub     bx, bx
  934.         mov     al, State_Area+3                ;high byte of state
  935.         and     al, 01000101b                   ;mask C3 C2 and C0
  936.         cmp     al, 00000000b                   ;check if 0 0 0
  937.         je      Getcom1
  938.         inc     bx
  939.         cmp     al, 00000001b                   ;check if 0 0 1
  940.         je      Getcom1
  941.         inc     bx
  942.         cmp     al, 01000000b                   ;check if 1 0 0
  943.         je      Getcom1
  944.         inc     bx
  945.  
  946. Getcom1:
  947.         ret
  948.  endp           ;Get_Comp
  949.  
  950. ;================================================
  951. ; Display a single character.
  952. ;
  953. ; In: al= character; dx= location.
  954. ;=================================================
  955. ;
  956. Display_Char proc near
  957.         mov     bl, Atr_Set                     ;attribute
  958.         call    Video_Cset                      ;set cursor location
  959.         call    Video_Wchr                      ;write character
  960.         inc     dl                              ;next column
  961.         ret
  962.  endp                   ;Display_Char
  963.  
  964. ;================================================
  965. ; Display a zero padded number to a location.
  966. ;
  967. ; In: bx:ax= number; cl= number base; ch= the
  968. ; display width; dx= location.
  969. ;=================================================
  970. ;
  971. Display_Number proc near
  972.         push    ax
  973.         push    cx
  974.         push    dx
  975.         add     dx, StartRow*256+StartCol       ;real screen location
  976.         call    Video_Cset                      ;move cursor
  977.  
  978.         push    cx
  979.         sub     ch, ch
  980.         mov     dx, bx                          ;high word
  981.         mov     di, offset Number_Store         ;place to store
  982.         call    Convert_Num                     ;convert to string
  983.         pop     cx
  984.  
  985.         mov     al, '0'                         ;pad character
  986.         mov     cl, ch
  987.         sub     ch, ch
  988.         mov     si, di
  989.         call    Video_Wstrr                     ;display number
  990.         pop     dx
  991.         pop     cx
  992.         pop     ax
  993.         ret
  994.  endp           ;Display_Number
  995.  
  996. ;================================================
  997. ; Given an index and a table, displays a space
  998. ; padded string to a location.
  999. ;
  1000. ; In: bx= index; di= table offset; cl= width, if
  1001. ; negative, the string is right justified instead
  1002. ; of left; dx= location.
  1003. ;=================================================
  1004. ;
  1005. Display_Istr proc near
  1006.         push    ax
  1007.         push    bx
  1008.         push    cx
  1009.         push    dx
  1010.         push    si
  1011.  
  1012. ;--- locate cursor
  1013.  
  1014.         add     dx, StartRow*256+StartCol       ;real screen location
  1015.         call    Video_Cset                      ;move cursor
  1016.  
  1017. ;--- display string
  1018.  
  1019.         mov     al, ' '                         ;pad with spaces
  1020.         shl     bx, 1 ;                         ;two bytes for offset
  1021.         sub     ch, ch
  1022.         mov     si, [di+bx]                     ;get the string location
  1023.  
  1024.         cmp     cl, 0
  1025.         jg      Disist1
  1026.  
  1027.         neg     cl                              ;absolute value
  1028.         call    Video_Wstrl                     ;display, left justified
  1029.         jmp     short Disist2
  1030.  
  1031.         Disist1:
  1032.         call    Video_Wstrr                     ;display, right justified
  1033.  
  1034.         Disist2:
  1035.         pop     si
  1036.         pop     dx
  1037.         pop     cx
  1038.         pop     bx
  1039.         pop     ax
  1040.         ret
  1041.  endp           ;Display_Istr
  1042.  
  1043. ;================================================
  1044. ; External files.
  1045.  
  1046.  include Video1.inc
  1047.  include Video2.inc
  1048.  include Convert1.inc
  1049.  include Convert2.inc
  1050.  
  1051. ;================================================
  1052. ; Data.
  1053.  
  1054. ;--- program status
  1055.  
  1056. Status1 equ 01h                                 ;execute in memory
  1057.                                                 ;  resident mode
  1058.  
  1059. Status db 0
  1060.  
  1061. ;--- original interrupt 16H
  1062.  
  1063. Original16 label Dword
  1064.  dw ?                   ;offset
  1065.  dw ?                   ;segment
  1066.  
  1067. ;--- shell parameter block
  1068.  
  1069. Parameter_Blk label Word
  1070.  dw 0                                           ;use default environment
  1071.  dw offset CmdTail                              ;command tail
  1072.  dw ?                                           ;present segment
  1073.  dw -1                                          ;
  1074.  dw -1                                          ;
  1075.  dw -1                                          ;-- no FCB'S
  1076.  dw -1                                          ;
  1077.  
  1078. CmdTail db 0, 13
  1079.  
  1080. ;--- saved stack addresses
  1081.  
  1082. Prog_Off dw ?           ;-- save area through EXEC function
  1083. Prog_Seg dw ?           ;
  1084.  
  1085. Stack_Off dw ?          ;-- save area for alternate int 16
  1086. Stack_Seg dw ?          ;
  1087.  
  1088. ;--- other data
  1089.  
  1090. CmdLoc dw ?             ;offset of command processor in environment
  1091. IntFunc db ?            ;int 16 request
  1092. CurLoc dw ?             ;saved cursor location
  1093.  
  1094. ;--- main display string
  1095.  
  1096. Display1 label Byte
  1097.  db FrmAtr, Atr_Bor, FrmLoc, StartRow, StartCol, 219
  1098.  db FrmHor, 223, Cols-2, 219, FrmLoc, StartRow+1, StartCol
  1099.  db FrmVer, 219, Rows-2, FrmLoc, StartRow+1, StartCol+Cols-1
  1100.  db FrmVer, 219, Rows-2, FrmLoc, StartRow+Rows-1
  1101.  db StartCol, 219, FrmHor, 220, Cols-2, 219
  1102.  
  1103.  db FrmAtr, Atr_Lin, FrmLoc, StartRow+9, StartCol+2
  1104.  db FrmHor, 196, 72, FrmLoc, StartRow+1, StartCol+32
  1105.  db FrmVer, 179, 8, 193
  1106.  
  1107.  db FrmAtr
  1108.  db Atr_Mes
  1109.  db FrmLoc, StartRow+1, StartCol, '8'
  1110.  db FrmLoc, StartRow+2, StartCol, '0'
  1111.  db FrmLoc, StartRow+3, StartCol, '8'
  1112.  db FrmLoc, StartRow+4, StartCol, '7'
  1113.  db FrmLoc, StartRow+6, StartCol, 'S'
  1114.  db FrmLoc, StartRow+7, StartCol, 'T'
  1115.  db FrmLoc, StartRow+8, StartCol, 'A'
  1116.  db FrmLoc, StartRow+9, StartCol, 'T'
  1117.  db FrmLoc, StartRow+10, StartCol, 'E'
  1118.  
  1119.  db FrmLoc, StartRow+1, StartCol+Cols-1, 'S'
  1120.  db FrmLoc, StartRow+2, StartCol+Cols-1, 'H'
  1121.  db FrmLoc, StartRow+3, StartCol+Cols-1, 'O'
  1122.  db FrmLoc, StartRow+4, StartCol+Cols-1, 'W'
  1123.  db FrmLoc, StartRow+5, StartCol+Cols-1, '8'
  1124.  db FrmLoc, StartRow+6, StartCol+Cols-1, '7'
  1125.  db FrmLoc, StartRow+8, StartCol+Cols-1, Ver_Hi MOD 10+'0'  ;
  1126.  db FrmLoc, StartRow+9, StartCol+Cols-1, Ver_Lo/10+'0'
  1127.  db FrmLoc, StartRow+10, StartCol+Cols-1, Ver_Lo MOD 10+'0' ;
  1128.  
  1129.  db FrmAtr, Atr_Tex
  1130.  db FrmLoc, StartRow+1, StartCol+2, 'Ins Ptr'
  1131.  db FrmLoc, StartRow+2, StartCol+2, 'Opr Ptr'
  1132.  db FrmLoc, StartRow+3, StartCol+2, 'Op Code'
  1133.  db FrmLoc, StartRow+4, StartCol+2, 'Control'
  1134.  db FrmLoc, StartRow+5, StartCol+2, 'Status'
  1135.  db FrmLoc, StartRow+6, StartCol+2, 'Tag'
  1136.  
  1137.  db FrmLoc, StartRow+8, StartCol+2, 'Stack Top'
  1138.  
  1139.  db FrmLoc, StartRow+1, StartCol+19, 'Prec'
  1140.  db FrmLoc, StartRow+2, StartCol+19, 'Round'
  1141.  db FrmLoc, StartRow+3, StartCol+19, 'Infin'
  1142.  
  1143.  db FrmLoc, StartRow+5, StartCol+19, 'Cond'
  1144.  db FrmLoc, StartRow+6, StartCol+19, 'Comp'
  1145.  db FrmLoc, StartRow+7, StartCol+19, 'Test'
  1146.  db FrmLoc, StartRow+8, StartCol+19, 'Exam'
  1147.  
  1148.  db FrmLoc, StartRow+1, StartCol+34, 'ST(0)'
  1149.  db FrmLoc, StartRow+2, StartCol+34, 'ST(1)'
  1150.  db FrmLoc, StartRow+3, StartCol+34, 'ST(2)'
  1151.  db FrmLoc, StartRow+4, StartCol+34, 'ST(3)'
  1152.  db FrmLoc, StartRow+5, StartCol+34, 'ST(4)'
  1153.  db FrmLoc, StartRow+6, StartCol+34, 'ST(5)'
  1154.  db FrmLoc, StartRow+7, StartCol+34, 'ST(6)'
  1155.  db FrmLoc, StartRow+8, StartCol+34, 'ST(7)'
  1156.  
  1157.  db FrmLoc, StartRow+10, StartCol+2, 'Except'
  1158.  db FrmLoc, StartRow+10, StartCol+9, FrmStr
  1159.  dw offset Display2
  1160.  db FrmLoc, StartRow+10, StartCol+30, 'Intr Mask'
  1161.  db FrmLoc, StartRow+10, StartCol+40, FrmStr
  1162.  dw offset Display2
  1163.  db FrmLoc, StartRow+10, StartCol+61, 'Ints'
  1164.  
  1165.  
  1166.  db FrmAtr, Atr_Set
  1167.  db 0
  1168.  
  1169. Display2 db 'P  U  O  Z  D  I', 0
  1170.  
  1171. ;--- exit message
  1172.  
  1173. Closemes db 13,10,'SHOW87 is removed from memory.',13,10,'$'
  1174. Errormes db 13,10,'Error: Could not install SHOW87', 13,10,'$'
  1175.  
  1176. ;================================================
  1177. ; Uninitialized data.
  1178.  
  1179. Save_Area label Byte                            ;screen data
  1180.         org $+(Rows * Cols * 2)
  1181. State_Area label UNKNOWN                        ;area to save the 8087 state
  1182.         org $+94
  1183. Status87 label Word                             ;8087 status storage for
  1184.                                                 ;  checking numbers
  1185.         org $+2
  1186. Number_Store label Byte                         ;storage for decimal
  1187.                                                 ;  number strings
  1188.         org $+11
  1189.         org $+100h
  1190. Local_Stack label Byte                          ;local stack for state display
  1191.         org $+100h
  1192. Program_Stack label Byte                        ;main program stack
  1193.  
  1194.         org offset Save_Area                    ;fix location
  1195.  
  1196. ;================================================
  1197. ; Transient code.  Exists in unitialized data
  1198. ; area, must be executed before the data area is
  1199. ; used.
  1200.  
  1201. ;--- display opening message
  1202.  
  1203. Init :
  1204.         mov     dx, offset Openmes              ;message
  1205.         mov     ah, 9                           ;function
  1206.         int     21h                             ;display
  1207.  
  1208. ;--- check for 80x87 installed
  1209.         call    Installed8087                   ;check for 80x87
  1210.         cmp     ax, 1                           ;ax=1 if 80x87 installed
  1211.         je      Init0                           ; else 80x87 is NOT installed
  1212.         mov     dx, offset No8087mes
  1213.         mov     ah, 9                           ;display message indicating
  1214.         int     21h                             ;that no 80x87 is installed
  1215.         jmp     short Init8
  1216.  
  1217. ;--- find command processor
  1218. Init0 :
  1219.         push    es
  1220.         mov     cx, 8                           ;string length
  1221.         sub     di, di                          ;starting offset of environment
  1222.         mov     es, cs:[2ch]                    ;environment segment
  1223.  
  1224. ;--- loop for each string in the environment
  1225.  
  1226. Init1 :
  1227.         cmp     byte ptr es:[di], 0             ;check if end of environment
  1228.         je      Init8
  1229.  
  1230.         mov     cx, 8                           ;string length
  1231.         mov     si, offset Comspec              ;string location
  1232.  
  1233.         repe
  1234.         cmpsb                                   ;compare bytes
  1235.         je      Init3                           ;jump if found
  1236.  
  1237. Init2 :
  1238.         cmp     byte ptr es:[di-1], 0           ;see if stopped on end
  1239.                                                 ;  of string
  1240.         je      Init1
  1241.         inc     di                              ;next byte
  1242.         jmp     Init2
  1243.  
  1244. Init3  :
  1245.         mov     CmdLoc, di                      ;save location
  1246.         pop     es
  1247.  
  1248. ;--- set resident flag
  1249.  
  1250.         mov     si, 80h                         ;command tail
  1251.         lodsb                                   ;get the length
  1252.         or      al, al                          ;check if none
  1253.         jz      Init6
  1254.         mov     cl, al
  1255.         sub     ch, ch                          ;put count in cx
  1256.  
  1257. ;--- loop through characters in command tail
  1258.  
  1259. Init4 :
  1260.         lodsb                                   ;load next byte
  1261.         cmp     al, '/'                         ;check if switch
  1262.         je      Init7                           ;jump if so
  1263. Init5 :
  1264.         loop    Init4                           ;otherwise loop back
  1265.  
  1266. Init6:
  1267.         jmp     Start
  1268.  
  1269. ;--- found slash
  1270.  
  1271. Init7:
  1272.         dec     cx                              ;reduce count
  1273.         jz      Init6                           ;jump if no more bytes
  1274.  
  1275.         lodsb                                   ;load command character
  1276.         sub     al, 'a'-'A'                     ;convert to upper-case
  1277.         cmp     al, 'R'                         ;check if R
  1278.         jne     Init5                           ;if not, go back to loop
  1279.         xor     Status, Status1                 ;set (or clear) flag
  1280.         jmp     Start
  1281.  
  1282. ;--- could not find COMSPEC=
  1283.  
  1284. Init8:
  1285.         mov     dx, offset Errormes             ;error message
  1286.         mov     ah, 9                           ;function
  1287.         int     21h                             ;show message
  1288.  
  1289.         mov     ax, 4cffh                       ;exit function
  1290.         int     21h                             ;execute
  1291.  
  1292. ;=========================================================
  1293. ;returns true if an 8087 or 80x87 coprocessor is installed
  1294. ;=========================================================
  1295. Installed8087   proc near
  1296.     int    11h                ;get BIOS equipment flags
  1297.     and    ax, 2            ;bit is ON if 80x87 is present
  1298.     shr    ax, 1
  1299.     ret
  1300. Installed8087   endp
  1301.  
  1302. ;--- transient data
  1303.  
  1304. Openmes db 13,10
  1305.         db 'SHOW87, Version '
  1306.         db Ver_Hi MOD 10+'0', '.', Ver_Lo/10+'0', Ver_Lo MOD 10+'0','$'
  1307. No8087mes db 13,10
  1308.           db 'No numeric processor detected',13,10,'$'
  1309.  
  1310. ;--- command environment string
  1311.  
  1312. Comspec db 'COMSPEC='
  1313.  
  1314. END Entry
  1315.