home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / TASMSWAN.ZIP / CHARS.ASM < prev    next >
Assembly Source File  |  1989-07-14  |  2KB  |  130 lines

  1. %TITLE  "Display Character/Attribute Reference"
  2.  
  3.     IDEAL
  4.     DOSSEG
  5.     MODEL    small
  6.     STACK    256
  7.  
  8. cr        EQU    13
  9. lf        EQU    10
  10. ChartRow    EQU    7
  11.  
  12.  
  13.     DATASEG
  14.  
  15. exitCode    db    0
  16. welcome        db    'Character attributes -- by Tom Swan',cr,lf
  17.         db    'Rows = background, Columns = foreground',cr,lf
  18.         db    'First char is dim, second char is bright',0
  19. template    db    '    00 01 02 03 04 05 06 07',cr,lf
  20.         db    '00',cr,lf,'01',cr,lf,'02',cr,lf,'03',cr,lf
  21.         db    '04',cr,lf,'05',cr,lf,'06',cr,lf,'07',0
  22. blinkString    db    'This line should be blinking.',0
  23.  
  24.     CODESEG
  25. ;--------- from STRINGS.OBJ & STRIO.OBJ
  26.     EXTRN    StrLength:proc, StrWrite:proc
  27. ;--------- from SCREEN.OBJ
  28.     EXTRN    ScInit:proc, ScGotoXY:proc, ScClrRect:proc
  29.     EXTRN    ScPokeChar:proc, ScSetBack:proc, ScSetFore:proc
  30.     EXTRN    ScPokeStr:proc, ScDim:proc, ScBright:proc
  31.     EXTRN    ScBlink:proc, ScNoBlink:proc
  32.  
  33. Start:
  34.     mov    ax,@data
  35.     mov    ds,ax
  36.     mov    es,ax
  37.  
  38.     call    ScInit
  39.     call    Setup
  40.     call    Attributes
  41.     call    Blinking
  42.  
  43.     mov    dh,23
  44.     mov    dl,0
  45.     call    ScGotoXY
  46. Exit:
  47.     mov    ah,04Ch
  48.     mov    al,[exitCode]
  49.     int    21h
  50.  
  51. PROC    Setup
  52.     mov    ch,0
  53.     mov    cl,0
  54.     mov    dh,24
  55.     mov    dl,79
  56.     call    ScClrRect
  57.     mov    dh,1
  58.     mov    dl,0
  59.     call    ScGotoXY
  60.     mov    di, offset welcome
  61.     call    StrWrite
  62.     mov    dh,ChartRow
  63.     mov    dl,0
  64.     call    ScGotoXY
  65.     mov    di, offset template
  66.     call    StrWrite
  67.     ret
  68. ENDP    Setup
  69.  
  70. UDATASEG
  71. row        db    ?
  72. column         db    ?
  73. background    db    ?
  74. foreground    db    ?
  75.  
  76. CODESEG
  77. PROC    Attributes
  78.     mov    [row], ChartRow
  79.     mov    [background],0
  80. @@10:
  81.     inc    [row]
  82.     mov    al,[background]
  83.     call    ScSetBack
  84.     mov    [column],1
  85.     mov    [foreground],0
  86. @@20:
  87.     add    [column],3
  88.     mov    al,[foreground]
  89.     call    ScSetFore
  90.     call    ScDim
  91.     call    OneChar
  92.     inc    [column]
  93.     call    ScBright
  94.     call    OneChar
  95.     inc    [foreground]
  96.     cmp    [foreground],7
  97.     jbe    @@20
  98.     inc    [background]
  99.     cmp    [background],7
  100.     jbe    @@10
  101. @@99:
  102.     ret
  103. ENDP    Attributes
  104.  
  105. Proc    OneChar
  106.     mov    dh,[row]
  107.     mov    dl,[column]
  108.     mov    al,'A'
  109.     call    ScPokeChar
  110.     ret
  111. ENDP    OneChar
  112. Proc    Blinking
  113.     mov    al,0
  114.     call    ScSetBack
  115.     mov    al,7
  116.     call    ScSetFore
  117.     call    ScBright
  118.     call    ScBlink
  119.     mov    di,offset blinkString
  120.     call    StrLength
  121.     mov    dh,19
  122.     mov    dl,0
  123.     mov    si, offset blinkString
  124.     call    ScPokeStr
  125.     call    ScNoBlink
  126.     ret
  127. ENDP    Blinking
  128.  
  129.     END    Start
  130.