Assembler







,
.
. ,

. C
""
.
.
 
. 10.8 ,
, .
BIOS . ,
CX DX, ,
.
,
.
,
.
 
Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:07:03
. 10.8 Page 1-1
 
 
PAGE ,132
TITLE . 10.8
0000 CODE SEGMENT
ASSUME CS:CODE
0000 SCROLL PROC FAR
0000 55 PUSH BP
0001 8B EC MOV BP, SP
0003 8B 76 06 MOV SI, [BP+6] ;
0006 8B 0C MOV CX, [SI] ;
0008 0A C0 OR AL, AL
000A B7 07 MOV BH, 7
000C B8 0601 MOV AX, 601h
000F 75 0C JNZ WINDOW1 ;
0011 B9 0200 MOV CX, 200h ; 1
0014 BA 1010 MOV DX, 1010h
0017 DO_SCROLL:
0017 CD 10 INT 10h
0019 5D POP BP
001A CA 0002 RET 2
001D WINDOW1:
001D B9 0514 MOV CX, 514h ; 2
0020 BA 1224 MOV DX, 1224h
0023 EB F2 JMP DO_SCROLL
0025 SCROLL ENDP
0025 CODE ENDS
END
 
. 10.8
 
. 10.8,
, ,
. ,
,
CALL. .10.9()
SCROLL. CALL
(FAR CALL)
.
DS. SCROLL
SI ,
CX. .10.9(b)
, SCROLL
BP , SP
BP. ,
.
,
. , ,
, RET 2,
. ,
.
 
Ĵ Ĵ
SP> 堠 SP> -
BP <BP
Ĵ Ĵ
򠠠 [BP+2]

Ĵ Ĵ
[BP+4]

Ĵ Ĵ
堠 [BP+6]

Ĵ
 
(a) (b)
. 10.9
 
SCROLL
. ,
, (2, 0) (16, 16)
. ,
(5, 20), (18,
36). ,
.
BIOS.
BIOS .
 
. 10.10 ,
SCROLL.
,
. -
.
 
, , -
.
P$.
. 10.8.
. -
,
.
.
A
1 CLS
5 DEFINT A-Z
10 P$=CHR$(&H55)+CHR$(&H8B)+CHR$(&HEC)+CHR$(&H8B)+CHR$(&H76)+CHR$(&H6)
20 P$=P$+CHR$(&H8B)+CHR$(&HC)+CHR$(&HA)+CHR$(&HC9)+CHR$(&HB7)+CHR$(&H7)
30 P$=P$+CHR$(&HB8)+CHR$(&H1)+CHR$(&H6)+CHR$(&H75)+CHR$(&HC)+CHR$(&HB9)
40 P$=P$+CHR$(&H0)+CHR$(&H2)+CHR$(&HBA)+CHR$(&H10)+CHR$(&H10)+CHR$(&HCD)
50 P$=P$+CHR$(&H10)+CHR$(&H5D)+CHR$(&HCA)+CHR$(&H2)
60 P$=P$+CHR$(&H0)+CHR$(&HB9)+CHR$(&H14)
70 P$=P$+CHR$(&H5)+CHR$(&HBA)+CHR$(&H24)+CHR$(&H12)+CHR$(&HEB)+CHR$(&HF2)
100 ENTRY!=(PEEK(VARPTR(P$)+1))+(PEEK(VARPTR(P$)+2))*256
110 IF ENTRY!>32768! THEN ENTRY%=ENTRY!-65536! ELSE ENTRY%=ENTRY!
120 A$=""
130 L=0:R=1
140 LOCATE 1,1:PRINT " . . .
200 LOCATE 15,1:PRINT A$;
210 CALL ENTRY%(L)
220 LOCATE 18,21:PRINT A$;
230 CALL ENTRY%(R)
240 A$=RIGHT$(A$,9)+LEFT$(A$,1)
250 GOTO 200
. 10.10 -
 
P$,

VARPTR. CALL
,
VARPTR. C
,
. VARPTR
P$.
ENTRY!.
0 65536,

, -32768 32767.
ENTRY%.
,
SCROLL.
 
,
.

. ,
,
.

.
 
,
, .
DEBUG.
:
DEBUG, BASIC.COM ( BASICA.COM,
).
P$ ( ,
), CHR$($HCC). -
INT 3 . ,

,
DEBUG. 0CCH
( 055H). DEBUG
. ,
,
. , , ,
-

.