Txtprint.com -

Txtprint.com -

̳

ʳ

ASM-86 :

TXTPRINT.COM -


.

1. .

2. i . .

3. .

4.

5. i

i , i i ii.

i.

i.

.

.


txtprint.com - , , . , , -, , . , , , . , 2 DOS - `, ` - . , TXTPRINT.COM .

, , , . (, , ), INT 08H, INT 09H, INT 28H, INT 2FH TXTPRINT.COM ` . , ( ). ` 򳺿 , , TXTPRINT.COM `.


1.

TXTPRINT.COM . ` ( HELP-, .). ` TXTPRINT.COM . . ϳ , ( ). , , 2 DOS-`.

. DOS .

2. , .

, ( -, .), , , , .

TXTPRINT.COM , , `. (ASM-86) TASM 2.0.

:

n ;

n ; ;

n ;

n ;

n `;

n `.

. 3.

3.

, i i i "" (popup) .

( ) , i `i i , iii i .

MS-DOS ii i DOS, - i i DOS. i i i . i DOS `i i i popup - . , i i i , i - , i i, i DOS.

i i i i ii i i DOS . I . , i BIOS 10H i, i i 16H, i i i ii BIOS. i, i - , .

BIOS - i .

I i ii i, i i DOS. , ii DOS. i .

, ( ) i i ii . ii i ii DOS i, i ii i (i DOS ), . i i DOS 34H.


34H. DOS

: AH = 34H

: ES:BX -

, , , , . ` , COMMAND.COM DOS 0AH, , , DOS . DOS, :


Int_21h PROC far

sti

pushf

cmp ah,0Ah ; 0ah,

jnz Exec ; .

Fn0Ah:

push ax ; 0ah,

mov ah,0bh ; ,

int 21h ; `

cmp al,0 ; .

pop ax

jnz Exec

push cx

mov cx,4000h

Delay: loop Delay ;

pop cx

jmp short Fn0Ah ; .

Exec:

or byte ptr cs:DOS_busy,01h ;

; DOS.

Popf ; .

pushf

call dword ptr cs:[Int_21h_vect]

pushf

and byte ptr cs:DOS_busy,0feh ;

; .

popf

ret 2

Int_21h_vect dd ?

Dos_busy db 0

Int_21h ENDP

0AH . ( DOS 0BH 01H 16H). , 0AH. , - , DOS CF .

, DOS. , , ` .

DOS - , DOS. , , . , 25H ( ), 26H ( ) DOS, 13H BIOS.

25H 26H - . , .

DOS ` 28H. , , PRINT, DOS, DOS , .

28H . , , , , .

, , , . 28H , , , , . . , 28H, DOS 00H - 0CH.

, DOS , , 28H? . , , , , . DOS, .

.

, . , 24H. , Ctrl+Break. MS-DOS , 23H.

DOS, , , . .

Ctrl+Break. Ctrl+Break. , Ctrl+Break DOS 00H - 0CH, , - . , DOS 00H-0CH, Ctrl+Break .


33H. Ctrl+Break

: AH = 33H

AL = 0 -

1 - .

DL ( AL=1) = 0 -

1 -

: DL ( AL 0) -

:

0 -

1 -

DOS 33H.

- 23H, , IRET.

( ) MS-DOS AX, DI, SI, BP 24H. : - Abort, Retry, File or Ignore? (, , ), DOS, . 䳿 AL( ).

4. ,

, , . . . `, DOS 3.2 , DOS WINDOWS`95. , . . EPSON- .

5.

TXTPRINT.COM - . , COM - , : TASM TXTPRINT.ASM, TLINK TXTPRINT.OBJ /T. ϳ TXTPRINT.COM. ϳ , ScrollLock. ϳ , ENTER . BackSpace, , ESC , . ϳ ScrollLock. , TXTPRINT.COM ` Ctrl+Alt+Esc.  , , , TXTPRINT.COM.

08H, 09H, 28H, 2FH, 23H 24H. TXTPRINT.COM , , ` , , .


i , i i ii

i .. - i i

i .i. - i i

i. - ii

.. -

. -

- i

popup - ,

DOS - i

BIOS - /

INT -

PC - '

WINDOWS - i


1. . IBM PC : , 1991.

2. . IBM PC . .: ,1992.

3. . "-" MS-DOS. .: , 1995.

4. TeachHelp

5.


TXTPRINT.COM - . , COM - , : TASM TXTPRINT.ASM, TLINK TXTPRINT.OBJ /T. ϳ TXTPRINT.COM. ϳ , ScrollLock. ϳ , ENTER . BackSpace, , ESC , . ϳ ScrollLock. , TXTPRINT.COM ` Ctrl+Alt+Esc.  , , , TXTPRINT.COM.

08H, 09H, 28H, 2FH, 23H 24H. TXTPRINT.COM , , ` , , .

` . , .


; TXTPRINT.ASM -

;

; :

; TASM TXTPRINT.ASM

; TLINK /t TXTPRINT.OBJ

;**************************************************

cr equ 13 ; " ".

lf equ 10 ; " ".

start_offset equ 0b8h ;

;

; .

internal_flags record Sf:1,Rf:1,Af:1,Tf:1,Pf:1 ;

; 1=

; 1=Int_08h

; 1=

; 1= ""

; 1= ""

.model tiny

.code

org 100h

entry:

jmp boot ; .

shift = offset callvideo - start_offset ;

; .

flags_offset = offset resident_sign - shift ;

callvideo proc

; -BIOS.

push di

push si

push bp

int 10h

pop bp

pop si

pop di

ret

callvideo endp

sethandler proc

; .

push ax

mov ah,35h

int 21h

mov word ptr [di],bx

mov word ptr [di+2],es

pop ax

mov ah,25h

int 21h

ret

sethandler endp

resethandler proc

; .

push ds

mov dx,word ptr [di]

mov ds,word ptr [di+2]

mov ah,25h

int 21h

pop ds

ret

resethandler endp

include beep.asm

include typestr.asm

include message.asm

include remove.asm

include main.asm

include prepare.asm

include take&prn.asm

int_28h proc far

test byte ptr cs:[flags_offset],mask Sf or mask Rf

jz pass_28h ; , .

test byte ptr cs:[flags_offset],mask Af or mask Tf

jnz pass_28h ; , .

or byte ptr cs:[flags_offset],mask Af

call prepare ; .

and byte ptr cs:[flags_offset],not(mask Sf or mask Rf or mask Af)

pass_28h: ; .

jmp dword ptr cs:[int_28h_vect-shift]

int_28h_vect dd ?

int_28h endp

int_08h proc far

test byte ptr cs:[flags_offset],mask Tf or mask Af; or mask Df

jnz pass_08h ; , .

or byte ptr cs:[flags_offset],mask Tf ;

; Int_08h.

pushf ;

call dword ptr cs:[int_08h_vect-shift] ; .

test byte ptr cs:[flags_offset],mask Sf or mask Rf

jz end_08h ; , .

push di ; DOS.

push es

mov es,word ptr cs:[dos_flag_seg-shift]

mov di,word ptr cs:[dos_flag_off-shift]

test byte ptr es:[di],0ffh

pop es

pop di

jnz end_08h ; DOS , .

or byte ptr cs:[flags_offset],mask Af ;

; START.

call prepare ; .

and byte ptr cs:[flags_offset],not(mask Sf or mask Rf or mask Af)

end_08h:

and byte ptr cs:[flags_offset],not mask Tf ;

iret ; Int_08h.

pass_08h: ;

jmp dword ptr cs:[int_08h_vect-shift] ; .

int_08h_vect dd ?

int_08h endp

int_09h proc far

push ax ; AX.

in al,60h ; .

cmp al,70 ; ScrollLock.

jne remove_test

mov ah,2 ; Shift state.

int 16h

and al,0h

cmp al,0h

jne pass_09h

or byte ptr cs:[flags_offset],mask Sf

jmp short end_09h

remove_test:

cmp al,1 ; Esc ?

jne pass_09h

mov ah,2 ; Shift state.

int 16h

and al,0ch

cmp al,0ch

jne pass_09h

or byte ptr cs:[flags_offset],mask Rf

end_09h:

in al,61h ; .

push ax

or al,80h

out 61h,al

pop ax

out 61h,al

mov al,20h

out 20h,al

pop ax

iret

pass_09h:

pop ax ;

jmp dword ptr cs:[int_09h_vect-shift]; Int_09h.

int_09h_vect dd ?

int_09h endp

int_2fh proc far

cmp ax,8900h ;

jne pass_2fh ; 89, .

mov al,0ffh ;

iret ; .

pass_2fh:

jmp dword ptr cs:[int_2fh_vect-shift]

int_2fh_vect dd ?

int_2fh endp

exeptions proc far

int_24h: mov al,3 ; " ".

int_23h: iret ; .

int_24h_vect dd ?

int_23h_vect dd ?

exeptions endp

dos_flag_off dw ?

dos_flag_seg dw ?

resident_sign internal_flags <>

;-----

boot: ; ( ).

mov si,offset start_string

call teletype

multiplex_test:

mov ax,8900h ;

int 2fh ; .

cmp al,0

je install ; , .

mov si,offset reboot_message ;

call teletype ;

call teletype_keys ; , ""

int 20h ; .

install:

call teletype_keys ; ""

cld ;

mov di,start_offset ; PSP.

mov si,offset callvideo

mov cx,boot-callvideo

rep movsb

mov cx,sethandler-shift

mov al,09h ;

mov dx,int_09h-shift ; Int09h.

mov di,int_09h_vect-shift

call cx

mov al,2fh ;

mov dx,int_2fh-shift ; Int2fh.

mov di,int_2fh_vect-shift

call cx

mov al,28h ;

mov dx,int_28h-shift ; Int28h.

mov di,int_28h_vect-shift

call cx

mov al,08h ;

mov dx,int_08h-shift ; Int08h.

mov di,int_08h_vect-shift

call cx

mov ah,34h ;

int 21h ; DOS.

mov word ptr ds:[dos_flag_off-shift],bx

mov word ptr ds:[dos_flag_seg-shift],es

mov es,word ptr ds:[002ch] ;

mov ah,49h ; DOS.

int 21h

mov dx,boot-shift ; ,

int 27h ; .

include teletype.asm

teletype_keys proc near

; .

mov si,offset hot_keys_mess1

call teletype

mov si,offset hot_keys_mess2

call teletype

mov si,offset hot_keys_mess3

call teletype

mov si,offset hot_keys_mess4

call teletype

mov si,offset hot_keys_mess5

call teletype

mov si,offset hot_keys_mess6

call teletype

mov si,offset hot_keys_mess7

call teletype

ret

teletype_keys endp

start_string db "Screen text printer. Version 1.0.",cr,lf,0

hot_keys_mess1 db "Use ",0

hot_keys_mess2 db "ScrollLock",40 dup (0)

hot_keys_mess3 db " to activate text printer and",cr,lf,0

hot_keys_mess4 db "Ctrl + Alt + Esc ",34 dup(0)

hot_keys_mess5 db " to remove it from memory.",cr,lf,lf,0

hot_keys_mess6 db "Use Enter to label text and",cr,lf,0

hot_keys_mess7 db "BackSpace to print it. Use Esc to cancel.",cr,lf,0

reboot_message db cr,lf,"Text Taker has already"

db " been installed !",7,cr,lf,lf,0

io_error_mess db "I/O failure.",cr,lf,lf,lf,0

end_entry:

END entry

;****************** ʳ TXTPRINT.ASM ************************

; PREPARE.ASM

; .

;*************************************************************

prepare proc

cli ; .

mov word ptr cs:[stack_offset-shift],sp

mov word ptr cs:[stack_seg-shift],ss

push cs

pop ss

mov sp,start_offset

sti

push ax ; .

push bx

push cx

push dx

push di

push si

push bp

push ds

push es

push cs

pop ds

mov al,23h ; Int23h.

mov dx,int_23h-shift

mov di,int_23h_vect-shift

call sethandler

mov al,24h ; Int24h.

mov dx,int_24h-shift

mov di,int_24h_vect-shift

call sethandler

mov ah,15 ;

call callvideo ; .

cmp al,2

je set_param

cmp al,3

je set_param

cmp al,7

jne end_prepare ; , .

set_param: ; .

mov byte ptr ds:[current_video_page-shift],bh

mov ah,03h ; .

call callvideo

mov word ptr ds:[cursor_loc-shift],dx

test byte ptr ds:[flags_offset],mask Sf

jz begin_remove

call start

jmp short restore_cursor

begin_remove:

call remove

restore_cursor:

mov bh,byte ptr ds:[current_video_page-shift]

mov dx,word ptr ds:[cursor_loc-shift] ;

mov ah,2 ; .

call callvideo

end_prepare:

mov al,23h ; Int 23h.

mov di,int_23h_vect-shift

call resethandler

mov al,24h ; Int 24h.

mov di,int_24h_vect-shift

call resethandler

pop es ; .

pop ds

pop bp

pop si

pop di

pop dx

pop cx

pop bx

pop ax

cli ; .

mov ss,word ptr cs:[stack_seg-shift]

mov sp,word ptr cs:[stack_offset-shift]

ret

prepare endp

stack_offset dw ?

stack_seg dw ?

cursor_loc dw ?

current_video_page db ?

;******************* ʳ PREPARE.ASM *************************

; MAIN.ASM

;

;*************************************************************

start proc

mov bp,sp ;

sub sp,13 ; ` .

mov byte ptr ds:[flag-shift],0 ; .

mov byte ptr ds:[fl2-shift],0

mov byte ptr ds:[xx-shift],dl

mov byte ptr ds:[yy-shift],dh

rd:

call kurpos ; .

call delay ; .

in al,60h ; .

cmp al,14 ; BackSpace ?

jne nn ; - .

or byte ptr ds:[flags_offset],mask Pf ; ,

mov ah,01h ; 0 ,

mov dx,0

int 17h

call unlabel ;

jmp hi ; .

nn:

cmp al,28 ; ENTER ?

jne n0 ; - .

call here

n0:

cmp al,72 ; UP ?

jne n1 ; - .

cmp byte ptr ds:[yy-shift],0 ; .

jne n00

mov byte ptr ds:[yy-shift],25

jmp n00

rd1:

call keybuf

jmp rd

n00:

dec byte ptr ds:[yy-shift] ; Y 1.

call kurpos ; .

n1:

cmp al,80 ; DOWN ?

jne n2 ; - .

cmp byte ptr ds:[yy-shift],25 ; .

jne n11

mov byte ptr ds:[yy-shift],0

n11:

inc byte ptr ds:[yy-shift] ; Y 1.

call kurpos ; .

n2:

cmp al,75 ; LEFT ?

jne n3 ; - .

cmp byte ptr ds:[xx-shift],0 ; .

jne n22

mov byte ptr ds:[xx-shift],80

dec byte ptr ds:[yy-shift]

n22:

dec byte ptr ds:[xx-shift] ; X 1.

call kurpos ; .

n3:

cmp al,77 ; RIGHT ?

jne n4 ; - .

cmp byte ptr ds:[xx-shift],80 ; .

jne n33

mov byte ptr ds:[xx-shift],0

inc byte ptr ds:[yy-shift]

n33:

inc byte ptr ds:[xx-shift] ; X 1.

call kurpos ; .

n4:

cmp al,1 ; ESC ?

jne rd1 ; - .

cmp byte ptr ds:[fl2-shift],0 ;

je hi ; .

call unlabel

; .

hi:

call keybuf ; .

mov sp,bp

ret ; .

start endp

; :

scrr db ?

xx db ?

yy db ?

x1 db ?

y1 db ?

tx db ?

ty db ?

wx db 2

wy db 2

fl2 db 0

flag db 0

;******************** ʳ MAIN.ASM **************************

; TAKE&PRN.ASM

; .

;*************************************************************

keybuf proc

; .

push es

push ax

sub ax,ax

mov es,ax

mov al,es:[41ah] ;

mov es:[41ch],al ; .

pop ax

pop es

ret

keybuf endp

delay proc

; .

push cx

mov cx,60

l1:

push cx

mov cx,20000

l2:

loop l2

pop cx

loop l1

pop cx

ret

delay endp

del2 proc

; .

push cx

mov cx,6000

a2:

loop a2

pop cx

ret

del2 endp

here proc

; .

push ax

cmp byte ptr ds:[flag-shift],0

je nh

mov al,byte ptr ds:[wx-shift]

cmp byte ptr ds:[xx-shift],al

jne lab

mov al,byte ptr ds:[wy-shift]

cmp byte ptr ds:[yy-shift],al

je rr

lab:

call labela ; .

jmp rr

nh:

mov al,byte ptr ds:[xx-shift]

mov byte ptr ds:[x1-shift],al

mov al,byte ptr ds:[yy-shift]

mov byte ptr ds:[y1-shift],al

rr:

pop ax

mov byte ptr ds:[flag-shift],1

ret

here endp

kurpos proc

; .

push ax

mov ah,02h

mov dh,byte ptr ds:[yy-shift]

mov dl,byte ptr ds:[xx-shift]

mov bh,0

call callvideo

pop ax

ret

kurpos endp

labela proc

; .

cmp byte ptr ds:[fl2-shift],0

je f0

call unlabel

call ifswap

jmp f1

f0:

mov al,byte ptr ds:[x1-shift]

mov byte ptr ds:[wx-shift],al

mov al,byte ptr ds:[y1-shift]

mov byte ptr ds:[wy-shift],al

call ifswap

f1:

mov byte ptr ds:[fl2-shift],1

mov al,byte ptr ds:[x1-shift]

mov byte ptr ds:[tx-shift],al

mov al,byte ptr ds:[y1-shift]

mov byte ptr ds:[ty-shift],al

hh:

push cx

push dx

mov ah,02h ; .

mov dh,byte ptr ds:[ty-shift]

mov dl,byte ptr ds:[tx-shift]

mov bh,0

call callvideo

mov ah,08h ; /.

mov bh,0

call callvideo

mov byte ptr ds:[scrr-shift],ah

mov ah,09h ; .

mov bl,byte ptr ds:[scrr-shift]

add bl,15

mov cx,1

mov bh,0

call callvideo

pop dx

pop cx

mov dl,byte ptr ds:[tx-shift]

cmp dl,byte ptr ds:[xx-shift]

je ok

as:

inc byte ptr ds:[tx-shift]

cmp byte ptr ds:[tx-shift],80

jne hh

mov byte ptr ds:[tx-shift],0

inc byte ptr ds:[ty-shift]

jmp hh

ok:

mov al,byte ptr ds:[yy-shift]

cmp byte ptr ds:[ty-shift],al

je rro ; , ,

jmp as ; .

rro:

mov al,byte ptr ds:[xx-shift]

mov byte ptr ds:[wx-shift],al

mov al,byte ptr ds:[yy-shift]

mov byte ptr ds:[wy-shift],al

ret

labela endp

unlabel proc

; .

push ax

push dx

push cx

mov al,byte ptr ds:[x1-shift]

mov byte ptr ds:[tx-shift],al

mov al,byte ptr ds:[y1-shift]

mov byte ptr ds:[ty-shift],al

tl:

mov ah,02h ; .

mov dh,byte ptr ds:[ty-shift]

mov dl,byte ptr ds:[tx-shift]

mov bh,0

call callvideo

mov ah,08h ; /.

mov bh,0

call callvideo

mov byte ptr ds:[scrr-shift],ah

call ToPrn

mov ah,09h ; .

mov bl,byte ptr ds:[scrr-shift]

sub bl,15

mov cx,1

mov bh,0

call callvideo

mov al,byte ptr ds:[wx-shift]

cmp byte ptr ds:[tx-shift],al

je don

nt:

inc byte ptr ds:[tx-shift]

cmp byte ptr ds:[tx-shift],80

jne tl

call PrnEnt

mov byte ptr ds:[tx-shift],0

inc byte ptr ds:[ty-shift]

jmp tl

don:

mov al,byte ptr ds:[wy-shift]

cmp byte ptr ds:[ty-shift],al

je ex ; , ,

jmp nt ; .

ex:

pop ax

pop cx

pop dx

ret

unlabel endp

ToPrn proc

; .

test byte ptr ds:[flags_offset],mask Pf ; .

jz outp ; - .

mov ah,00h

mov dx,0

int 17h ; .

call del2

outp:

ret

ToPrn endp

PrnEnt proc

; ENTER

test byte ptr ds:[flags_offset],mask Pf ; .

jz notp ; - .

mov ah,0

mov dx,0

mov al,0ah ; CR.

int 17h

mov ah,0

mov dx,0

mov al,0dh ; LF.

int 17h

notp:

ret

PrnEnt endp

ifswap proc

push ax

mov al,byte ptr ds:[y1-shift] ; Y1 YY

cmp al,byte ptr ds:[yy-shift]

jg zq

jl qw

mov al,byte ptr ds:[x1-shift] ; X1 XX

cmp al,byte ptr ds:[xx-shift]

jng qw

zq: ; ,

mov al,byte ptr ds:[yy-shift] ; .

mov byte ptr ds:[y1-shift],al

mov al,byte ptr ds:[xx-shift]

mov byte ptr ds:[x1-shift],al

mov al,byte ptr ds:[wx-shift]

mov byte ptr ds:[xx-shift],al

mov al,byte ptr ds:[wy-shift]

mov byte ptr ds:[yy-shift],al

qw:

pop ax

ret ;

ifswap endp

;******************* ʳ TAKE&PRN.ASM ***********************

; REMOVE.ASM

;

;*************************************************************

test_vector proc

; .

mov ah,35h

int 21h

cmp bx,dx

jne exit

mov dx,es

cmp cx,dx

exit:

ret

test_vector endp

remove proc

mov cx,cs

mov di,test_vector-shift

mov al,09h ; Int09h.

mov dx,int_09h-shift

call di

jne not_remove

mov al,2fh ; Int2fh.

mov dx,int_2fh-shift

call di

jne not_remove

mov al,28h ; Int28h.

mov dx,int_28h-shift

call di

jne not_remove

mov al,08h ; Int08h.

mov dx,int_08h-shift

call di

je uninstall

not_remove:

mov ax,notremove_mess-shift

push ax

push ax

call mess

ret

uninstall:

mov ax,remove_mess-shift

push ax

xor ax,ax

push ax

call mess

mov cx,resethandler-shift

mov al,09h ; Int09h.

mov di,int_09h_vect-shift

call cx

mov al,2fh ; Int2fh.

mov di,int_2fh_vect-shift

call cx

mov al,28h ; Int28h.

mov di,int_28h_vect-shift

call cx

mov al,08h ; Int08h.

mov di,int_08h_vect-shift

call cx

cli

push cs

pop es

mov ah,49h ; `.

int 21h

ret

remove_mess db ' has been',0,'REMOVED form memory. ',0

notremove_mess db ' UNABLE to',0,'remove. Not on the top. ',0

remove endp

;********************* ʳ REMOVE.ASM ***********************

; MESSAGE.ASM

; .

;*************************************************************

xchgmess proc

mov di,code_table-shift ;

mov si,attribute_table-shift ;

; .

mov cx,6

mov dh,10

loop_1: ; .

push cx

mov cx,30

mov dl,25

loop_2: ; .

push cx

mov ah,2

call callvideo

mov ah,8

call callvideo

cmp dh,15

jb lab_1

cmp dl,27

jb exch_noth

jmp short exch_attr

lab_1:

cmp dh,11

jb lab_2

cmp dl,52

ja exch_attr

jmp short exch_code

lab_2:

cmp dl,52

ja exch_noth

exch_code:

xchg al,byte ptr [di] ; .

inc di

exch_attr:

xchg ah,byte ptr [si] ; .

inc si

exch_noth:

mov bl,ah ; .

mov cx,1

mov ah,9

call callvideo

inc dx

pop cx

loop loop_2

inc dh

pop cx

loop loop_1

mov dx,1900h ; .

mov ah,02h

call callvideo

ret ; .

xchgmess endp

mess proc

push bp

mov bp,sp

push bx

mov bh,byte ptr ds:[current_video_page-shift]

mov bl,byte ptr ds:[attribute_table-shift]

push bx ; .

call xchgmess

pop bx

mov dx,0b29h ; .

mov si,word ptr [bp+6]

call typestr

mov dx,0c1bh

call typestr

push bx ; .

mov cx,2

mess_loop:

mov di,550

mov bx,30

call beep

mov di,1100

call beep

loop mess_loop

pop bx

wait_mess:

mov ah,0 ; .

int 16h

call xchgmess ; .

pop bx

pop bp

ret 4 ; .

mess endp

; .

attribute_table db 29 dup(4eh),14 dup (206),13 dup (4eh)

db 07h,07h

db 28 dup (4eh)

db 07h,07h

db 4eh,26 dup (206),4eh

db 07h,07h

db 28 dup (4eh)

db 30 dup (07h)

; .

code_table db '============================'

db '!Screen Printer: !'

db '! !'

db '! press any key... !'

db '============================'

;****************** ʳ MESSAGE.ASM *************************

; TYPESTR.ASM

; .

;*************************************************************

typestr proc

typestr_loop:

mov ah,2 ; .

call callvideo

lodsb

or al,al ; ,

jz end_typestr ; .

mov cx,1

mov ah,9

call callvideo

inc dx ;

jmp short typestr_loop ; .

end_typestr:

push dx ; .

mov dx,1900h

mov ah,2

call callvideo

pop dx

ret ; .

typestr endp

;******************** ʳ TYPESTR.ASM ************************

; BEEP.ASM

; .

;*************************************************************

beep proc

; .

push bx ; .

push cx

push di

mov di,1000

mov al,0b6h ; .

out 43h,al

mov dx,14h ;

mov ax,4f38h ; 1331000/.

div di

out 42h,al ; 2.

mov al,ah

out 42h,al ; 2.

in al,61h ;

push ax ; .

or al,3

out 61h,al ; .

wait_beep:

mov cx,01fffh

speaker_on:

loop speaker_on

dec bx ; ˳ ?

jnz wait_beep ; ͳ. .

pop ax ; .

out 61h,al ; .

pop di ; .

pop cx

pop bx

ret ; .

beep endp

;********************* ʳ BEEP.ASM *************************

; TELETYPE.ASM

; .

;*************************************************************

teletype proc

mov bh,0 ; .

cld

type_next_char:

lodsb ; AL.

mov ah,0eh

cmp al,0 ; , .

je end_teletype

call callvideo ; .

jmp short type_next_char

end_teletype:

ret

teletype endp

;******************** ʳ TELETYPE.ASM **********************



2010