|
发表于 2009-2-12 17:29:22
|
显示全部楼层
DATAS SEGMENT
6 J D2 U9 P" |( ]' e7 c( l ;此处输入数据段代码
4 {7 Q3 H5 P' b: p' ?, C/ v+ t [DATAS ENDS
5 ~" B5 w. l' k6 T7 b
0 u+ w* u- e% Z ^# OSTACKS SEGMENT
& ~! `/ W) ?0 i3 C( _ ;此处输入堆栈段代码
% I h" a/ e) _. ]; SSTACKS ENDS) E# h' ^$ C' A/ d7 {: G2 k
+ B, Q7 n+ _: s- N( n. r) N. M
CODES SEGMENT
9 R5 G$ P H# ]) e' { ASSUME CS:CODES,DSATAS,SS:STACKS
+ B4 Q l: E) S, D3 K: t. w6 y1 i.486
$ b) c, L* o" K! JSTART:
& {- E' A3 L. z+ u" \6 \ MOV AX,0f000h( a5 v9 H* v* u1 A3 m
MOV DS,AX. V) F Z$ ]9 ]" S; ^
;此处输入代码段代码
6 \" C. R& |4 t1 D9 s9 W mov si,09 ~! L$ }" Q: w2 G6 U! Z( p
last: % m/ ^: b( S7 Z
mov eax,[si]& M( \# u8 p9 U5 I
cmp eax,5f4d535fh
; }2 ^0 r6 C& B8 W7 V3 {# u* a6 d je over
( q6 E/ Z8 J# }% N. D add si,10h8 z2 P9 y( |# i6 s4 A/ B
jmp last
* y" @( T+ d# Q% @) n% }/ `
/ U C3 E' b6 S k w/ L over:
3 a+ k: i0 ~* l* e/ _ add si,18h
: O4 ?" ? M6 t! w6 r' S mov eax,[si]3 b1 v$ m# n9 Z) Y
mov si,ax) {2 D& _4 q' Z1 S8 X& e! N
add si,9 u6 P6 w; `9 C* i
mov ax,[si]
: c8 B! |: X+ r, W add al,1
: V% ?& t; o0 o/ c7 ?+ ] mov bl,642 D6 X: p- P$ W3 f) A" M
mul bl: f2 \; u! O- f: b, r6 B
mov bx,ax
! ]6 A' a" N4 X( \3 n& ^ & ~( ]/ a4 K$ N0 V l5 L+ l
call display
0 ^+ n! O4 K' N4 z, { MOV AH,4CH4 g5 x! x9 C' k
INT 21H 9 w5 L4 s2 F1 P! V y* K1 }
: _' c$ }: A3 y) y( ? display proc near! u9 Y: h+ x# y1 P/ E
push ax9 T5 u- C. n0 O
push bx- `/ g2 [6 Y0 d' G
push cx
0 \1 c X& r# |$ x9 M7 i mov ch,4
# @( Z0 [ E5 e/ d$ {2 [ rotate:mov cl,48 _& z2 c! y# u8 _2 p' W5 w9 k
rol bx,cl
' W v( I0 v6 E( W3 u mov al,bl# K: w9 R( N$ H$ u; A2 f
and al,0fh) R% S* k. z/ c6 L9 ?4 y5 |( _0 B
add al,30h+ P1 N# O8 d1 Y/ C0 [
cmp al,3ah
, W$ `7 y+ F& `8 s+ N jl printit
7 G9 {, I8 z& V2 C \ add al,7h
2 \/ w" a# { H, q& w printit:
6 F% N5 ^# `: ?, C) L; G2 [ mov dl,al& \4 P' {* {# x3 k( c
mov ah,2
: k7 k7 z2 Z& W7 A+ \: w int 21h) J( N9 k; q/ n6 f( G [1 C
dec ch9 ?0 t; L, E9 m1 q( k) G0 L5 Z# z% v
jnz rotate) C5 U5 o5 k& P. I g9 J( P
mov dl,20h6 P6 @! I* ]! ?9 ^' D% }8 n, |
mov ah,2h8 @) r& a8 i2 H5 J
int 21h* i: l/ D. j% G- C
pop cx
/ M$ B, o8 l: S pop bx
# e; J! H; z) e: t pop ax/ ]/ h q" V" L; O, q- A
ret
1 @5 I$ A* K4 y$ Q: F9 z display endp
Y' W L j) U$ d8 K
$ K2 H- Y8 c$ }" d1 s5 M. eCODES ENDS
/ w1 J7 r; F+ D! E3 x4 N1 v END START, o2 d/ F9 `% g% @
9 q/ _. p9 J6 O. @: R% ]运行此程序可显示ROM大小.单位以K计算,不过是十六进制的 |
|