: (OutTextXY, SetTextStyle)

: (OutTextXY, SetTextStyle)

̳

ʳ

,

: ASM-86

: (OutTextXY, SetTextStyle)

: . . 02 - 1

..

:

..

ʳ 2004 .


1.

1.1

1.2

1.3

2.

3.

4.

5.


, . , , , . , .

, , , , . , , . . ASM - 86.

, MS-DOS, BIOS. , : , , . ASM-86, . , . , : , , , . , , .

, ASM-86 , . , ASM-86, .


1.

. , , . . 256 .

, .

1.1

- OutTextXY SetTextStyle. , , . , , .

1.2

, . 13h. ³ 320 200 256 . . , , . 64000, (). . , , , .

10h . - 00h.

: - 00h

AL - 13h ( )

:

10h, 02h - , 01h - . . 21h .

1.3

:

vvod - . AL ;

vvodvsego - ;

vvkoor - ;

probeli - ;

vivstr - ;

priglash - ;

ramka - ;

, . .

BIOS: 8*8, 8*16 8*14. .

, .


2.

, :

80286

640 .

MS-DOS 4.0


3.

MS-DOS OC Windows.

ϳ . , . , , . ϳ , , . ϳ - . .


4.

, . , , . . 256 .

, .


5.

1. " Turbo Assembler"

2. " IBM"

3. . " ".

4. . " IBM PC "

5. .. Assembler DOS, Windows Unix


). ˳

dseg segment

hor dw 0

ver dw 0

y dw 0

x dw 0

razm db 0

sdvig dw 0

stroka db 9

buf db 5 dup (0)

koord dw 5 dup (0)

buftxt db 22 dup (?)

mes1 db ' : $'

mes3 db '1 - $'

mes4 db '2 - DOS$'

mes5 db ' X $'

mes6 db ' Y $'

mes7 db ' a : $'

mes8 db '1 - 8 X 14$'

mes9 db '2 - 8 X 8$'

mes10 db '3 - 8 X 16$'

mes11 db ' $'

mes12 db ' $'

mes13 db ' $'

mes14 db ' : $'

mes15 db '1 - C - (_) $'

mes16 db '2 - C - (_) $'

r1 db '=======================================$'

r2 db ' $'

r3 db ' $'

r4 db ' $'

r5 db ' $'

r6 db ' $'

r7 db 'L=======================================-$'

indeks dw 0

dseg ends

sseg segment stack

db 256 dup (?)

sseg ends

cseg segment stack

assume cs: cseg,ds: dseg,ss: sseg

vvod proc

lea dx,buf

mov ah,3fh

mov cx,3

mov bx,0

int 21h

mov al,buf

sub al,'0'

ret

vvod endp

vvodvsego proc

call ramka

mov dx,0b1eh

lea cx,mes5

call vivstr

call vvkoor

mov dx,0b1eh

lea cx,mes6

call vivstr

call vvkoor

call ramka

mov dx,0a1ch

lea cx,mes7

call vivstr

mov dx,0c23h; .

mov cx,1

call probeli;

lea cx,mes8

call vivstr

mov dx,0d23h; .

mov cx,1

call probeli;

lea cx,mes9

call vivstr

mov dx,0e23h; .

mov cx,1

call probeli;

lea cx,mes10

call vivstr

mov dx,0a35h; .

mov cx,1

call probeli;

call vvod

rcl al,1

mov byte ptr koord+4,al

rcr al,1

cmp al,1

je dal2

cmp al,2

je dal3

mov razm,16

jmp kon1

dal3:

mov razm,8

mov byte ptr koord+4,3

jmp kon1

dal2:

mov razm,14

kon1:

inc indeks

inc indeks

call ramka

mov dx,0b1ch

lea cx,mes12

call vivstr

call vvkoor;

call ramka

mov dx,0b1dh

lea cx,mes13

call vivstr

call vvkoor;

call ramka

mov dx,0b1ah

lea cx,mes14

call vivstr

mov dx,0c1eh; .

mov cx,1

call probeli;

lea cx,mes15

call vivstr

mov dx,0d1eh; .

mov cx,1

call probeli;

lea cx,mes16

call vivstr

mov dx,0b37h; .

mov cx,1

call probeli;

call vvod

cmp al,1

je dal

mov hor,0

mov al,razm

add al,2

mov byte ptr ver,al

jmp kon2

dal:

mov hor,10

mov ver,0

kon2:

ret

vvodvsego endp

vvkoor proc

mov dx,0d26h

mov cx,3

call probeli

mov ah,3fh

mov bx,0

mov cx,6

lea dx,buf

int 21h

mov dx,ax

XOR AX, AX

MOV AL, buf; AL - ASCII-

SUB AL, '0';

cmp dx,3; 3 ?

je vse; ,

cmp dx,4

je dva

jmp tri

dva:

mov bx,10; 10 DX

mul bx; . 10

xor bx,bx; BX

mov bl,buf+1; BL - ASCII-

sub bx,'0';

add ax,bx;

jmp vse

tri:

mov bx,100; 100 DX

mul bx; . 10

mov cx,ax; .

xor ax,ax; AX

mov al,buf+1; AL - ASCII- 2-

sub ax,'0';

mov bx,10

mul bx; - 10 - 10

add cx,ax; +

xor ax,ax

mov al,buf+2; AL - ASCII- 2-

sub ax,'0';

add cx,ax; ++

mov ax,cx

vse:

xor bx,bx

mov bx, indeks

mov koord+bx,ax;

inc indeks

inc indeks

ret

vvkoor endp

probeli proc

mov ah,02

int 10h

mov ax,0920h;

mov bx,009fh

int 10h

ret

probeli endp

vivstr proc

mov bh,00h

mov ah,02

int 10h

mov dx,cx

mov ah,9

int 21h

ret

endp vivstr

priglash proc

mov dx,0b1ch

lea cx,mes1

call vivstr

mov dx,0c21h

mov cx,1

call probeli

lea cx,mes3

call vivstr

mov dx,0d21h

mov cx,1

call probeli

lea cx,mes4

call vivstr

ret

endp priglash

ramka proc

mov cx,0914h;

mov dx,0f3ch

mov ax,0600h

mov bh,01fh

int 10h

mov cx,0a15h; .

mov dx,0e3bh

mov ax,0600h

mov bh,01bh

int 10h

;

lea ax,r1;

mov sdvig,ax; . sdvig

mov cx,7; -

next1:

push cx

mov cx,sdvig

mov dh,stroka

mov dl,14h

call vivstr

inc stroka; .

add sdvig,42; .

pop cx

loop next1

mov stroka,9

ret

endp ramka

begin:

mov ax,dseg

mov ds,ax

mov es,ax

opyat:

mov ax,03h ;

int 10h

mov ax,1003h; .

mov bl,0

int 10h

mov cx, 2000h; .

mov ah,01h

int 10h

call ramka;

call priglash;

mov dx,0b35h; .

mov cx,1

call probeli;

mov ah,3fh;

mov bx,0

mov cx,3

lea dx,buf

int 21h

mov al,buf;

cmp al,'1'

je text

jmp kon

text:

call vvodvsego;

call ramka

mov dx,0b1fh

lea cx,mes11

call vivstr ;

mov dx,0d1fh

mov cx, 20

call probeli;

mov ah,3fh

mov bx,0

mov cx,22

lea dx,buftxt

int 21h;

dec ax

dec ax

push ax

mov dx,koord+8

mov ax,hor

mul dx

mov hor,ax

mov dx,koord+8

mov ax,ver

mul dx

mov ver,ax

mov ax,13h

int 10h

mov ax,1130h; \

mov bh,byte ptr koord+4; - ; /

int 10h; /

mov di,0

pop cx

vivodvs: ;

push cx;

mov al,buftxt+di;

push di; ;

mov cl,razm; \

mul cl; -

mov si,ax; /

mov ah,0

mov bx,koord

mov x,bx

mov bx,koord+2

mov y,bx

mov cl,razm

glavn: ;

push cx;

mov cx,koord+8

cikl:

push cx

push es;

mov bx,x;

mov ax,y; Y

mov dx,320

mul dx

add ax,bx

mov di,ax; .

dec di

mov dx,koord+4;

mov al,es: [bp+si] ;

mov cx,0a000h; -

mov es,cx; /

mov cx,8;

zdvig:

rol al,1; 1

jnc n4; CF=0,

push cx

mov cx,koord+8

n7: ;

add bx,1; -

cmp bx,317; /

ja n8; ,

inc di;

mov es: [di],dl;

loop n7

n8:

pop cx

jmp n6

n4:

add di,koord+8

n6:

loop zdvig

pop es;

pop cx

inc word ptr y; . Y

loop cikl

inc si; .

pop cx

loop glavn

pop di;

inc di; .

mov ax,koord

add ax,hor

mov koord,ax

mov ax,koord+2

add ax,ver

mov koord+2,ax

cmp koord,319;

ja zaderg; ,

cmp koord+2, 199;

ja zaderg; ,

pop cx;

loop vivodvseh

jmp zaderg

vivodvseh:

jmp vivodvs

zaderg:

mov ah,00

int 16h

mov indeks,0

jmp opyat

kon:

mov ax,4c00h

int 21h

cseg ends

end begin


). .


. .

28. 28

. .

28 28

. .

28 28


. 27

.26

.

28


. .

27 26

.

26

.

26

.

26

.

26

. 26




. . 32

31

. 33

.

32





2010