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

  1.  
  2. ;    FILENAME: OTABRSET.ASM
  3. ;    Copyright (c) 1988 by Borland International, Inc.
  4. ;
  5. ;    Description: This module implements the routine TabReset. TabReset 
  6. ;    sets tap stops every eight columns. 
  7. ;    This module uses MASM mode syntax and standard segment directives. 
  8. ;    ASSEMBLY INSTRUCTIONS: To assemble this module use the following 
  9. ;    TASM command line. 
  10. ;        TASM otabrset
  11.  
  12. include globals.inc
  13.  
  14. _TEXT   segment
  15.  
  16.     TabReset proc
  17.  
  18.     ;    This procedure sets tab stops every 8 columns.   A tab is
  19.     ;    represented by the number 1 in the tab table.
  20.     ;    Input
  21.     ;        TabTbl - starting location of the tab table
  22.     ;        TabEnd - ending location of the tab table
  23.     ;    Output
  24.     ;        TabTbl - cleared and set to null
  25.     ;    Registers modified
  26.     ;        none
  27.  
  28.     call    TabClear        ;clear all tab stops first
  29.  
  30.     push    cx
  31.     push    di
  32.     sub     cx, cx          ;initial column count
  33.     lea     di, TabTbl      ;table location
  34.  
  35. tabres1:
  36.     cmp     di, TabEnd      ;check if at end
  37.     je      tabres3
  38.     cmp     cx, 8           ;check if at tab stop
  39.     je      tabres2
  40.     inc     cx
  41.     inc     di
  42.     jmp    tabres1
  43.  
  44. tabres2:
  45.     mov     BYTE PTR [di], 1
  46.     sub     cx, cx
  47.     jmp    tabres1
  48.  
  49. tabres3:
  50.     pop     di
  51.     pop     cx
  52.     ret
  53.     TabReset  endp
  54.  
  55. _TEXT    ends
  56.  
  57. end
  58.