home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / asm_programming / TEST / DISSOLVE.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-02-06  |  1.8 KB  |  51 lines

  1. ; original code by Colin Stearman
  2. CODE    SEGMENT
  3.     ORG 100H
  4.     ASSUME CS:CODE,DS:CODE,ES:CODE
  5.      
  6. START:
  7.      jmp    begin
  8.      db     'ߥ.ÑîkådëMû$'
  9. begin:   MOV    AH,15                   ; GET VIDEO STATE
  10.      INT    10H
  11.      MOV    DX,2000                 ; BYTES TO IN 80X25 SCREEN
  12.      MOV    BX,0B000H               ; MONO SCREEN
  13.      CMP    AL,7
  14.      JE     screen
  15.      MOV    BX,0B800H               ; COLOR SCREEN
  16.      CMP    AL,3                    ; IS IT COLOR TEXT?
  17.      JA     EXIT                    ; Bye Bye
  18.      CMP    AL,1                    ; 80X25 COLOR?
  19.      JA     screen
  20.      SHR    DX,1                    ; ONLY 1000 BYTES TO DO
  21. screen:  MOV    ES,BX                   ; set es to screen segment
  22. diss:    MOV    CX,DX                   ; set bytes in screen
  23.      XOR    BX,BX                   ; set flag to say we changed a byte
  24.      XOR    DI,DI                   ; start at offset zero
  25. mainloop:
  26.      MOV    AX,ES:[DI]              ; get character and attribute
  27.      CMP    Al,20H                  ; is it a space, nothing to change?
  28.      JZ     next                    ; yes so do nothing
  29.      CMP    AL,' '                  ; second stage filter
  30.      JL     increase                ; is it less than a space?
  31.      DEC    AL                      ; no so decrease 1 towards space
  32.      JMP    SHORT movit
  33. increase:
  34.      INC    AL                      ; increase towards space
  35. movit:
  36.      MOV    ES:[DI],AX
  37.      INC    BX                      ; setting changed flag
  38. next:
  39.      INC    DI                      ; next word
  40.      INC    DI
  41.      LOOP   mainloop                ; do all bytes in screen
  42.      CMP    BX,00                   ; did we change something?
  43.      JNZ    diss                    ; yes so do it all over till all spaces
  44. EXIT:
  45.      MOV    AH,4CH                  ; return to DOS
  46.      INT    21H 
  47.  
  48.  
  49. CODE    ENDS
  50.     END START
  51.