|
|
发表于 2009-2-12 17:29:22
|
显示全部楼层
DATAS SEGMENT3 B B5 a. z* p' W& _# V; K3 C
;此处输入数据段代码
) Z: b9 L4 g$ UDATAS ENDS8 Z. m+ g! x- |: W
/ H k( J: z7 ? tSTACKS SEGMENT
4 @( Q K( o8 Z) D! l; ~ ;此处输入堆栈段代码6 @8 d* x c( ^
STACKS ENDS
# S. v! U8 [9 T, y" B: `6 J
6 q2 c) t7 w* s+ S0 I" nCODES SEGMENT7 ?) f% S1 |$ z! n1 I% K( j" ~
ASSUME CS:CODES,DS ATAS,SS:STACKS
$ T0 o3 t% N4 s ]5 e; x.486: i+ `$ G5 S2 O$ E) @
START:# d) k5 G- v8 D7 }" e5 l7 g8 N
MOV AX,0f000h! t7 _/ k7 ?- V8 H, X7 V- C
MOV DS,AX. y v9 X! L" j E4 n$ h* A( q1 s
;此处输入代码段代码
- Z3 B6 [& t" x5 h: D mov si,0) a) S& c! |! ]; D, k
last:
$ W) ]9 F# g: v; I mov eax,[si]' |: H* K" @' F" H
cmp eax,5f4d535fh
g8 f' @+ `0 C$ R7 t# a$ z- ~ je over
) U9 F, w* Z: U5 t) i+ S add si,10h$ f" f. a) q) D* I) M
jmp last
/ R2 e5 A. B" |8 _% o
, J" u- _0 u3 [. _$ ~7 c5 t over:4 i: w# f" m- G0 A4 v; k* t
add si,18h0 \- N/ [0 ?( I: c* _0 _+ p* o" m' W
mov eax,[si]" q# D7 F0 i8 Y" C+ ]$ w9 J7 T0 {
mov si,ax/ c- {* N) @, P! I. }- }
add si,9
8 n1 E5 i* }9 L( J2 w L mov ax,[si]+ {8 `% m3 N! S0 y4 i" T, m+ a; Y
add al,19 K' u' O" N- }% b: e
mov bl,64
# x$ I$ r" f& i3 }( j1 D0 I mul bl
% H+ W. v( g% M) F8 P# n5 v mov bx,ax1 l9 u/ i ]% g6 X8 w
7 M- Q1 t% U1 y+ G
call display9 Q4 J$ }& W) K6 A, N; \9 w
MOV AH,4CH& h4 k. x( D% D% K
INT 21H - V* ]- \0 s! {) ~# A
) S1 V y% V) j+ r display proc near' K4 S, a8 Z8 X6 ~
push ax* \# i9 c }! H O( D! a1 h5 |0 g
push bx' a6 C, I- k( q, D
push cx( i) c4 Z7 C! s/ F' p1 u
mov ch,4. P2 `/ ?6 X/ X9 P
rotate:mov cl,46 l& N( T! `$ o" W
rol bx,cl: G s: T# M( z+ l& z+ I, d% e! E
mov al,bl
' r$ _# E. U5 a% r( ], e and al,0fh2 L) o& Q9 z6 I" H( H9 O4 X- [0 `
add al,30h" m5 P4 s* f0 m! w- O
cmp al,3ah$ n6 y+ q' z0 X2 H
jl printit
5 y; T, G s& w% Y9 E# v$ x, e; n add al,7h9 I2 D& `) w- t6 m
printit:" v3 T0 }/ J. ?* [% X
mov dl,al
2 [/ k6 f. p: b: v) [3 c3 L/ U mov ah,2; @8 \9 O, ]1 B7 V# B% Y- R
int 21h
( Z2 r- X: s9 E( |1 [+ Q. L( C dec ch" ^. L8 M& @6 I/ K& t0 O, M
jnz rotate* n% _9 R: P; k9 F& ~
mov dl,20h
$ P) c: u- C8 k' F7 m; F( U: f mov ah,2h! t0 }7 a3 _6 _$ L3 ^2 R! n
int 21h8 ]3 {: K) t. Y
pop cx
) J( G9 A3 h2 ?# }3 c2 d- j. v pop bx9 Y, p0 Q: V4 g/ c+ [2 F' |
pop ax {2 R: n3 F# `& Z+ J6 X' ^& t
ret3 R1 L) F% \# N. B4 K2 W. D; L
display endp
5 w; |; Q9 Q. C: g& R5 {
! Q0 M: J' P) A4 t6 QCODES ENDS6 `3 z3 ^2 h `/ I6 ?; Y% i
END START
. h3 m$ `8 M ^' F# j+ ~# L+ t
% I- t1 |5 |4 c' L- t# X运行此程序可显示ROM大小.单位以K计算,不过是十六进制的 |
|