|
|
发表于 2009-2-12 17:29:22
|
显示全部楼层
DATAS SEGMENT, k" h1 D+ P& y' K/ p
;此处输入数据段代码
4 c5 E( @2 E2 aDATAS ENDS7 q$ i, H; Q4 E0 g
8 B5 v6 }' ~: wSTACKS SEGMENT( ^9 p$ R6 f$ K0 L) m1 n% Y
;此处输入堆栈段代码8 p" e( G v8 m2 v7 C$ K Q
STACKS ENDS
+ n- x* ?+ D- {! B
) o3 Q6 ~* F3 M3 w' O6 JCODES SEGMENT9 X, t( {. G. q/ ~7 w! @% w: C
ASSUME CS:CODES,DS ATAS,SS:STACKS
& N+ E% u9 j2 K7 q! ?; ].486
\$ X, e. |) p: [; y3 t4 P2 A' @1 x. ASTART:- _0 w: z. r# X, w2 r# [
MOV AX,0f000h0 C4 ?( t4 b3 I# x } D @/ ~
MOV DS,AX
2 @! p. B7 B8 q' A2 f ;此处输入代码段代码
/ Y# d3 [; ^) v: S1 R mov si,00 W$ y$ n% j6 `$ e# o
last:
, r q) Z$ l! c$ U8 c6 K( s; P mov eax,[si]. W" ~7 c2 Y1 \2 t* |! G5 H
cmp eax,5f4d535fh6 r1 P6 n* p& ~0 h
je over
( S! [( \; F( @, J9 ~6 I3 t add si,10h' V6 x7 I, y7 s9 i3 P* m# S
jmp last% H# u* e) ]! m% g
6 ~/ ^' h# }5 |; l! c; r over:
; `7 _6 `+ e k% }; w6 n add si,18h# w( E q" y' f" p$ A5 ?
mov eax,[si]
9 @7 F9 O+ o0 Y, q0 Q mov si,ax9 B6 S( _5 [6 |$ ~3 n" \& G
add si,9
+ }! \7 {4 k$ p2 H3 w: `4 o2 V mov ax,[si]
! X& G- M1 b: P6 a6 V) ?5 O$ ] add al,1
' x9 I' s: D1 F6 d) J& T2 H$ B mov bl,64
4 D+ I; X6 } E" \+ e# W+ u4 S mul bl
& K/ l/ W) q- c0 @: z mov bx,ax# O! Y% z; ?2 e% O) G% ~
6 ~) k9 ~1 }5 O3 r call display6 i' l. v5 @+ Q4 \, G c7 X" |
MOV AH,4CH
5 ?0 @& _) |8 U2 f! @; k+ Q/ Z# V- t INT 21H , O4 d3 S4 R& v+ p# d1 T
7 J' m: ?: ~ M9 n* [" z7 p
display proc near6 U! c1 ~) @1 h4 _, ]3 q# @
push ax
2 c$ [7 a9 N1 i' y push bx) ?9 [9 x- ~7 i( t9 m! U6 U
push cx: ]4 ]) Y% F$ P- r: Y7 u* H
mov ch,4
( d' ?- H) v8 I" z5 |. d7 B rotate:mov cl,4
/ ?1 b* Y% i9 ]* y& h" @8 A rol bx,cl
, b1 I6 Q, B% o mov al,bl
7 q) s2 L2 q$ [ and al,0fh) D8 F# q7 c( O" T* ^% c7 Y* F
add al,30h3 }. q& m: t8 h1 ^5 K( E" W T
cmp al,3ah9 \$ o* N! H2 n& Z: y& S
jl printit$ h* N" n) K. p
add al,7h4 W; G$ b# L7 s
printit:# f0 ^* |7 {- [# F. Q6 A4 m
mov dl,al
$ y- a a C4 M6 X: V; W mov ah,2) t5 |; q+ M; F: p
int 21h& F d9 U G- S7 H2 N+ v& _ g' i" k) E
dec ch
; c4 P* M( `0 a A2 |2 r8 J& A jnz rotate( w9 ~' }4 X: u
mov dl,20h
. Y+ A* C& P/ V( _ mov ah,2h0 z, ? o" h% M8 {
int 21h
3 D# P: P; B4 `0 N pop cx
$ A+ C$ ^ U; H' m, h& B pop bx& C+ F9 H' E- r) U/ {' ?
pop ax
* F+ P. B# ]7 i ret
& H- {/ Z$ U, v, j/ i9 j display endp
- s3 ?6 ~$ P: \1 Z' S2 n) s5 d7 E0 D
, d" M! \; z7 h1 pCODES ENDS
F6 P( I0 Y8 B) i: E' P( q" O END START
% v: N; D J, n" {+ H7 D
5 f# [) w% @ _# [运行此程序可显示ROM大小.单位以K计算,不过是十六进制的 |
|