|
发表于 2009-2-12 17:29:22
|
显示全部楼层
DATAS SEGMENT
2 v# P8 X4 B( I1 `: M6 L9 ~ ;此处输入数据段代码 4 z) f+ R. P6 i. H
DATAS ENDS- [# f- `/ ^3 ]2 W! b0 q
$ R i% R+ t( Y+ {7 p% D' s" bSTACKS SEGMENT& ~( X5 ~7 ] M; K
;此处输入堆栈段代码
1 L& @* S0 _! W* ISTACKS ENDS" C( F2 w, u8 l$ \0 I8 _" Y: d
+ z( ~( Y6 q0 J9 L: Q% E( n& d- k
CODES SEGMENT4 a! V1 K4 w- Z% N! t: E
ASSUME CS:CODES,DSATAS,SS:STACKS
& O2 Q0 @$ ]2 Q+ f9 d* \9 P+ [1 y" D. W.486
1 `( D! |* q7 y4 W+ b) M+ oSTART:" v2 s6 O3 f# j/ O9 H
MOV AX,0f000h
% H) h& k7 f2 w' | MOV DS,AX* J6 h" i, V2 b& A( k5 I. b
;此处输入代码段代码
6 C2 X% S" F+ s" h6 h/ L0 L mov si,07 I- R- O$ ~) p1 t& N
last:
4 I" B& a- v& }( P mov eax,[si]
- X8 z2 `9 I6 _ cmp eax,5f4d535fh
/ \/ x( c7 D; L je over
0 ?# X; M) M* q% G4 v add si,10h
; o5 p3 |# N& l8 z( J jmp last! S: D$ F5 c4 ?% y# Y; C
$ w+ K- N# C9 P# f' q7 c over:
2 x/ j" w& E8 l# ]7 L add si,18h
) w/ [$ C, ?6 E4 n& z# T3 c) M5 P mov eax,[si]- b8 [5 p! ]) e0 c, x
mov si,ax- j$ c8 @1 i, `2 J+ F0 z. G5 U
add si,9
/ P) T* K& ] l# n mov ax,[si]$ B" X) U; w& S% t3 Q' c
add al,1
! n& w# `2 h6 j2 p3 t, h mov bl,641 T3 @0 S6 k7 v. e( B, F8 E8 ~9 l" v, k
mul bl
f5 o- f1 |5 a3 H) e4 g mov bx,ax4 e# y. ~- t" |
0 _+ R4 }- X4 N
call display; _* s! Q( C7 Z) Q
MOV AH,4CH
6 H, K. [: g6 c, i# d" O) O9 Q9 I7 G* e INT 21H / P) l/ g- s0 |( _
* e6 Z; a, W0 K. r3 x& w. {& n
display proc near
* R' X! }0 N9 _; ~: f. q push ax
, W! \# A* o$ k4 J push bx
# @7 [ ^0 {4 D) D push cx9 \, A! J4 n. D0 v. Z" c2 Q
mov ch,4' |" R% E/ c/ |; @) T4 o2 V
rotate:mov cl,4
2 W3 n9 G% n6 D/ _" X rol bx,cl
7 D; V7 `8 B( I6 y7 U& Y$ A, v mov al,bl. c0 h# @; k5 u
and al,0fh
+ W K7 k1 a) m. _7 t4 c add al,30h& H, M* b" \: a% S9 A# R" ^
cmp al,3ah$ J; }& J1 M. `. _: H9 k8 i
jl printit
' @! r4 y& C* L, m; x# }0 X' x: N add al,7h+ q. V Q/ k$ R9 e- q6 |
printit:( T: y: @6 f% y
mov dl,al
|9 v) ^4 ^7 F1 o1 S8 y( W$ S, g. F mov ah,27 P- z4 \* C0 G" V+ T7 Y2 Y
int 21h6 }1 H! j+ b6 m- E
dec ch( f) m* D3 _* y) }8 w1 z
jnz rotate
3 d3 N- V ?2 l( g, a: u mov dl,20h
7 c4 g9 u2 x7 H5 h mov ah,2h* H' V0 p0 f6 K- y, u0 x# S+ M
int 21h
Y9 o- D( S# C1 ^" o pop cx4 c5 e8 m. K. d- N7 v1 C
pop bx
* C1 k7 J- |4 w, g( \ pop ax1 }/ t/ M5 K% H% M
ret
- a4 f" g, h0 ^8 ^ display endp7 H& P7 ^$ K; c4 X% q4 O
" ^' _7 V' z" E% X3 |3 Z
CODES ENDS
, k4 r% m, \- H$ I+ Z% H END START0 W) [" \/ \) h5 T0 Q9 |' W
9 K; k5 ^; g: \: z7 t) p4 f8 O+ L% T
运行此程序可显示ROM大小.单位以K计算,不过是十六进制的 |
|