home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / tasm / osetoptn.asm < prev    next >
Assembly Source File  |  1988-08-28  |  3KB  |  159 lines

  1.  
  2. ;    FILENAME: OSETOPTN.ASM
  3. ;    Copyright (c) 1988 by Borland International, Inc.
  4. ;
  5. ;    Description: This module implements these routines.
  6. ;    SetOpt1 sets input buffer size.
  7. ;    SetOpt2 sets output buffer size.
  8. ;    SetOpt3 sets the byte to end lines.
  9. ;    SetOpt4 clears all tab stops.
  10. ;    SetOpt5 sets a tab stop.
  11. ;    SetOpt6 truncates lines to a specified length.
  12. ;    SetOpt7 sets the left margin.
  13. ;    SetOpt8 deletes the left margin.
  14. ;    SetOpt9 displays a help message.
  15. ;    ASSEMBLY INSTRUCTIONS:  To assemble this module use the following  
  16. ;    TASM command line.     
  17. ;  
  18. ;        TASM osetoptn
  19.  
  20. include globals.inc
  21.  
  22. _TEXT   segment
  23.  
  24.     SetOpt1 proc
  25.  
  26.     ;    Input 
  27.     ;        none
  28.     ;    Output
  29.     ;        input buffer size set
  30.     ;    Registers modified
  31.     ;        none
  32.  
  33.     call    CmdNum         ;get size
  34.     mov     InpBlk+2, cx   ;save
  35.     ret
  36.     SetOpt1 endp
  37.  
  38.     SetOpt2 proc
  39.  
  40.     ;    Input 
  41.     ;        none
  42.     ;    Output
  43.     ;        output buffer size set
  44.     ;    Registers modified
  45.     ;        none
  46.  
  47.     call    CmdNum          ;get size
  48.     mov     OutBlk+2, cx    ;save
  49.     ret
  50.     SetOpt2 endp
  51.  
  52.     SetOpt3 proc
  53.  
  54.     ;    Input 
  55.     ;        none
  56.     ;    Output
  57.     ;        input buffer size set
  58.     ;    Registers modified
  59.     ;        none
  60.  
  61.     call    CmdNum          ;get byte
  62.     mov     EOL, cl         ;save
  63.     ret
  64.     SetOpt3 endp
  65.  
  66.     SetOpt4 proc
  67.  
  68.     ;    Input 
  69.     ;        none
  70.     ;    Output
  71.     ;        all tab stops cleared
  72.     ;    Registers modified
  73.     ;        none
  74.  
  75.     call    TabClear       ;clear all stops
  76.     ret
  77.     SetOpt4 endp
  78.  
  79.     SetOpt5 proc
  80.  
  81.     ;    Input 
  82.     ;        none
  83.     ;    Output
  84.     ;        tab stop set
  85.     ;    Registers modified
  86.     ;        none
  87.  
  88.     call    CmdNum          ;get location
  89.     push    bx
  90.     mov     bx, cx
  91.     dec     bx              ;start numbering at 0
  92.     call    TabSet          ;set tab stop
  93.     pop     bx
  94.     ret
  95.     SetOpt5 endp
  96.  
  97.     SetOpt6 proc
  98.  
  99.     ;    Input 
  100.     ;        none
  101.     ;    Output
  102.     ;        lines truncated to specified length
  103.     ;    Registers modified
  104.     ;        none
  105.  
  106.     call    CmdNum          ;get length
  107.     mov     Trunc, cx       ;save
  108.     ret
  109.     SetOpt6 endp
  110.  
  111.     SetOpt7 proc
  112.  
  113.     ;    Input 
  114.     ;        none
  115.     ;    Output
  116.     ;        left margin set
  117.     ;    Registers modified
  118.     ;        none
  119.  
  120.     call    CmdNum          ;get size
  121.     mov     LeftMar, cx     ;save
  122.     ret
  123.     SetOpt7 endp
  124.  
  125.     SetOpt8 proc
  126.  
  127.     ;    Input 
  128.     ;        none
  129.     ;    Output
  130.     ;        left margin deleted
  131.     ;    Registers modified
  132.     ;        none
  133.  
  134.     call    CmdNum          ;get bytes to delete
  135.     mov     LeftDel, cx     ;save
  136.     ret
  137.     SetOpt8 endp
  138.  
  139.     SetOpt9 proc
  140.  
  141.     ;    Input 
  142.     ;        none
  143.     ;    Output
  144.     ;        left margin deleted
  145.     ;    Registers modified
  146.     ;        none
  147.  
  148.     mov     ah, 9           ;display function
  149.     lea     dx, Help        ;load help location
  150.     int     21h             ;execute
  151.     mov     ax, 4c03h       ;exit function and error code
  152.     int     21h             ;execute
  153.     SetOpt9 endp
  154.  
  155. _TEXT    ends
  156.  
  157. end
  158.