home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
TUTOR.ZIP
/
DEMO3.ASM
< prev
next >
Wrap
Assembly Source File
|
1995-01-28
|
3KB
|
72 lines
start: mov ds,cs ;data segment = code segment
mov ax,3 ;reset text mode =
int 10h ;clear the screen.
call cursof ;turn off the cursor
mov es,0b800h ;text mode video segment
mov ah,1 ;medium blue
mov di,>s0 ;list 7 medium colors
mov si,844 ;video location to start diz2
mov cx,7 ;display 7 lines
call diz2 ;display
mov ah,9 ;start bright blue on black
mov di,>s1 ;list 7 bright colors
mov si,1964 ;video location to start diz2
mov cx,7 ;display 7 lines
call diz2 ;display
mov ah,15 ;bright white
mov cx,1 ;display 1 line
mov di,>s2 ;exit message
mov si,0 ;display top left
call diz2 ;do it
mov ah,0 ;await key press
int 16h ;keyboard
cmp ah,1 ;Esc key
jz exit ;if so, go to exit
jmp start ;start all over
diz2: mov al,[di] ;get character to display
inc di ;next one
cmp al,0 ;test for zero end of string
jz diz3 ;if so, go to diz3
mov es:[si],ax ;display ASCII char.+ attribute
add si,2 ;next video mem address
jmp diz2 ;continue
diz3: inc ah ;next color
add si,98 ;next video mem to display
loop diz2 ;display 7 lines bright colors
ret ;return to next after call
exit: mov ax,3 ;reset text mode video
int 10h ;also turns cursor ON
mov ax,4c00h ;exit instruction
int 21h ;return to DOS> prompt
s0:
db 'This is medium blue on black',0
db 'This is medium green on black',0
db 'This is medium cyan on black',0
db 'This is medium red on black',0
db 'This is medium magenta on black',0
db 'This is medium orange on black',0
db 'This is medium white on black',0
s1:
db 'This is bright blue on black',0
db 'This is bright green on black',0
db 'This is bright cyan on black',0
db 'This is bright red on black',0
db 'This is bright magenta on black',0
db 'This is bright yellow on black',0
db 'This is bright white on black',0
s2: db 'Esc to exit',0
curson: mov ah,1 ;set cursor type
mov cx,0607h ;cursor type
int 10h ;do it
mov dx,0 ;cursor position
jmp >c1 ;> = forward jump
cursof: mov dx,1900h ;cursor out of view on text
c1: mov ah,2 ;set cursor position
mov bh,0 ;page zero in text mode
int 10h ;do it
ret ;return to call+next instruct.