Category : Assembly Language Source Code
Archive   : TASMSWAN.ZIP
Filename : CHARS.ASM

Output of file : CHARS.ASM contained in archive : TASMSWAN.ZIP
%TITLE "Display Character/Attribute Reference"

MODEL small

cr EQU 13
lf EQU 10
ChartRow EQU 7


exitCode db 0
welcome db 'Character attributes -- by Tom Swan',cr,lf
db 'Rows = background, Columns = foreground',cr,lf
db 'First char is dim, second char is bright',0
template db ' 00 01 02 03 04 05 06 07',cr,lf
db '00',cr,lf,'01',cr,lf,'02',cr,lf,'03',cr,lf
db '04',cr,lf,'05',cr,lf,'06',cr,lf,'07',0
blinkString db 'This line should be blinking.',0

;--------- from STRINGS.OBJ & STRIO.OBJ
EXTRN StrLength:proc, StrWrite:proc
;--------- from SCREEN.OBJ
EXTRN ScInit:proc, ScGotoXY:proc, ScClrRect:proc
EXTRN ScPokeChar:proc, ScSetBack:proc, ScSetFore:proc
EXTRN ScPokeStr:proc, ScDim:proc, ScBright:proc
EXTRN ScBlink:proc, ScNoBlink:proc

mov ax,@data
mov ds,ax
mov es,ax

call ScInit
call Setup
call Attributes
call Blinking

mov dh,23
mov dl,0
call ScGotoXY
mov ah,04Ch
mov al,[exitCode]
int 21h

PROC Setup
mov ch,0
mov cl,0
mov dh,24
mov dl,79
call ScClrRect
mov dh,1
mov dl,0
call ScGotoXY
mov di, offset welcome
call StrWrite
mov dh,ChartRow
mov dl,0
call ScGotoXY
mov di, offset template
call StrWrite
ENDP Setup

row db ?
column db ?
background db ?
foreground db ?

PROC Attributes
mov [row], ChartRow
mov [background],0
inc [row]
mov al,[background]
call ScSetBack
mov [column],1
mov [foreground],0
add [column],3
mov al,[foreground]
call ScSetFore
call ScDim
call OneChar
inc [column]
call ScBright
call OneChar
inc [foreground]
cmp [foreground],7
jbe @@20
inc [background]
cmp [background],7
jbe @@10
ENDP Attributes

Proc OneChar
mov dh,[row]
mov dl,[column]
mov al,'A'
call ScPokeChar
ENDP OneChar
Proc Blinking
mov al,0
call ScSetBack
mov al,7
call ScSetFore
call ScBright
call ScBlink
mov di,offset blinkString
call StrLength
mov dh,19
mov dl,0
mov si, offset blinkString
call ScPokeStr
call ScNoBlink
ENDP Blinking

END Start

  3 Responses to “Category : Assembly Language Source Code
Archive   : TASMSWAN.ZIP
Filename : CHARS.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: