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

  1.  
  2. ;    FILENAME: OSTORSPC.ASM
  3. ;    Copyright (c) 1988 by Borland International, Inc.
  4. ;
  5. ;    Description: This module implements the routine StoreSpc. StoreSpc
  6. ;    stores any currently stored spaces.
  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 ostorspc
  11.  
  12. include globals.inc
  13.  
  14. _TEXT   segment
  15.  
  16.     StoreSpc proc
  17.  
  18.     ;    Input 
  19.     ;       SpcCnt - flag to determine if there are any spaces to store 
  20.     ;       cx - the current byte count 
  21.     ;       TabOff - offset into the tab table 
  22.     ;    Output 
  23.     ;       TabOff - the column offset is decremented by 1
  24.     ;       SpcCnt - is set to zero 
  25.     ;    Registers modified 
  26.     ;       cx
  27.  
  28.     push     dx
  29.     mov      dx, SpcCnt      ;get number of stored spaces
  30.     or       dx, dx          ;check if any
  31.     jz       stospc1
  32.     call     Spaces          ;store spaces
  33.     add      cx, dx          ;byte count
  34.     sub      TabOff, dx      ;adjust column offset
  35.     mov      SpcCnt, 0       ;reset space count
  36. stospc1:
  37.     pop      dx
  38.     ret
  39.  
  40.     StoreSpc endp
  41.  
  42. _TEXT    ends
  43.  
  44. end
  45.