|
发表于 2009-2-12 17:29:22
|
显示全部楼层
DATAS SEGMENT8 E2 j: h# p. t4 T
;此处输入数据段代码 0 N9 a7 Z6 p# D9 k% L
DATAS ENDS
4 X6 y+ f5 e( B1 E) N( a% _5 l O; ^9 n( {7 E1 M
STACKS SEGMENT
4 D6 j" Q G/ \- q1 b ;此处输入堆栈段代码( M& V5 {) l; ?# I, b8 r- R
STACKS ENDS) p+ q [* y3 ^# t
: c7 R3 X1 |, E* J L) F3 @
CODES SEGMENT# n# D$ D3 I7 s% B
ASSUME CS:CODES,DSATAS,SS:STACKS. k' B) x, i1 N- i- O
.486. O |. O5 M# V% b
START:+ H* \6 v1 v& b9 V! m
MOV AX,0f000h, `9 k/ Y% W: R6 e+ Y
MOV DS,AX% Y# I; G4 K& V l) r2 }8 u0 M
;此处输入代码段代码- Y$ i* S( b2 n( |% `) G! J+ L
mov si,0
4 U' X; [; F* ]: d5 C last: ; O9 }' J+ y# i7 }4 E
mov eax,[si]' G- r$ i. m$ Z7 G& m
cmp eax,5f4d535fh6 Y* q' n! q$ c3 Q6 G8 n3 L
je over) A9 j$ u- q% l7 t
add si,10h
" K: \) b- W' Z5 u. ?1 V jmp last7 c- k' U' ], j3 V. W* P X8 M
* X& z; w' Z1 @* a5 m
over:
. {( Y0 ~. j5 D/ b4 G1 X; j add si,18h7 ?4 |. e6 Q0 P0 M7 A
mov eax,[si]3 ?+ L0 q% B3 R" Y; O
mov si,ax0 `; V4 j: f, a( y
add si,99 d- ]* G* B" j- E
mov ax,[si] R( \9 _6 J A5 O9 z
add al,14 R5 a5 y* L9 k( x0 Y, W8 s, F
mov bl,64
, m$ a, W3 i' ~8 O& D mul bl* i( y. n: w( F9 e8 l
mov bx,ax" U) \$ Q) {! S l# L
% f9 ^+ {% b1 ]* `- j6 _" R9 X! ~7 K$ { call display
& ?5 Z5 e6 T d- L# ?6 I9 l MOV AH,4CH" C/ u* o1 n! i' P8 \; q+ u* S
INT 21H
5 B7 k9 C) S9 W0 h/ ?* ?7 q * `# E' A' F6 ^/ v" I
display proc near: B; M! q; {4 M( L5 M4 m E. B
push ax
+ `; S. w3 d5 P- z% l8 Z" } push bx* i- e5 w) o; U! Q. W! y5 `# O
push cx
3 L% h7 c- f' [* E, m2 l9 |$ d mov ch,4" ]) X% z3 w4 c; j
rotate:mov cl,4
$ [# r% n6 }& z1 O8 U rol bx,cl0 V9 X9 L$ s* h4 h
mov al,bl) t$ L0 W! u! ]2 t9 l7 a* [4 H
and al,0fh# O) W/ c8 q2 K V5 O
add al,30h
: O( J& N1 w9 w- O, o cmp al,3ah2 A. @; k: N+ c) u8 @, ]% N4 ]% [6 L
jl printit9 l+ X* N: N# v1 u, o& I
add al,7h2 {+ N7 ~% o: N6 H
printit:
8 U- I9 g6 [' H7 v- Z mov dl,al
q, e2 l# t0 f3 V |9 L mov ah,26 t: x0 h, J1 ]
int 21h+ s5 B G4 M5 [6 S ?7 B* ^
dec ch- c$ }1 X' s& y* {& r g& p+ o/ B! r/ [7 n
jnz rotate Y$ m' t" y1 X$ o* z
mov dl,20h
6 v F, g Z+ W mov ah,2h% V: Y, j, m- {0 f9 X
int 21h
! _6 E0 k4 k# t pop cx
) b2 J) m2 v3 |9 H6 |! T$ P$ K pop bx/ V* b8 p% b% K8 H1 n! ?9 c
pop ax
& k% u" z6 m+ r* L+ ]/ @: j ret5 y0 C8 L( R" J% M
display endp
7 F3 k6 J! S' f5 U$ l% z u6 k; z4 E$ E) N
CODES ENDS
+ L5 l! x. V$ q6 ^, A3 |! U# g END START
, c% f1 y! o% `2 e
w) L2 _5 Q) G: m运行此程序可显示ROM大小.单位以K计算,不过是十六进制的 |
|