|
各位前輩好,以下的程式為在 big_real_mode 讀取記憶體的值,例如: C:\memory.exe(程式檔名) 01000100(Address)
6 |- b |+ }1 r& P& n M8 u( _
7 r3 |0 }( V }" h- b則會顯示01000100位置的值,但是我另外在DSEG SEGMENT USE16'data'. ?3 R/ a( ]- K' ?0 T5 K( n
/ N" U, J3 Y/ Y# n) s3 w
宣告了Maddress Dword 0,但是程式執行時,會hand住,麻煩前輩給我一些指導,謝謝
* }- d. y: \: J2 ^3 N: h4 @- g6 G) ^8 P9 R/ W2 p4 w
.model small
* K! T C! R! N7 S0 m. Q.386p2 t, x( b! Q9 Q! g2 I- h
DSEG SEGMENT USE16'data'
& c9 G% A, b: u0 i+ X, e2 f7 o; c* a- ~, Z0 w
DESC STRUC+ {& H- \: O: j9 z6 q! L
LimitL DW 0
; C3 @8 R @! V+ E" \3 t& A5 F BaseL DW 0 ( A( |( W0 _9 ~, O; d
BaseM DB 0
' K: j" K* L% f# u& K Attributes DB 0
) c+ U0 e" \$ h4 ?8 ?. p LimitH DB 0 ) e& q9 D8 M5 ?; p# q$ d& m" M: ]
BaseH DB 0 ; ^. v# W4 X3 o, }0 U! J5 G
DESC ENDS' c" y1 b0 d( P$ ^- ^4 K. {
0 e# b' P0 {1 N- L* {, S& \PDesc STRUC
' A. B% t' J( ?) U ] x Limit DW 0 + ^; b3 {- L n4 Z5 p; \5 [$ u/ n
Base DD 0 3 r5 q1 |1 U5 w# n1 ?& b
PDesc ENDS+ d/ l; e, O: W1 I) O
0 [5 d: l1 t7 B
GDT_def Label Fword3 N! \# ]5 @* o' ]( ]
Null_Desc DESC < 0h, 0h, 00h, 00h, 000h, 0>* e4 M! r0 {& o) A1 i; k) \
Data_Desc DESC < 0FFFFh, 0h, 00h, 92h, 0CFh, 0>
; z% |2 y& M6 cGDT_Addr PDesc <$-GDT_def-1, >
& r- Z0 M! x& Q( D4 e7 g5 i
. e: K* n0 i& p% k# ?6 MMaddress Dword 08 r+ N# b/ k& y8 n( U
+ B5 v0 [0 A& i( h2 HDSEG ENDS
- Y" [/ s7 j8 R* vASSUME CS:CSEG,DS:DSEG5 Q; ]2 C! X; g* b5 C- [
! f' k+ o) W* z9 }
CSEG SEGMENT USE16'code' % _. \. C/ \, q( ]7 K5 D
push ds
% f, a7 x9 |* f R push es
9 o# O% I* ^6 O( X push fs
! b# T C0 Q" `4 o" A% J% Y, { push gs
$ v+ [$ O+ m# D% R5 n4 c call big_real_mode & ~5 B! {! |- `( a2 ]
call Get_Commandtail+ z( U# ?: n. d2 B
xor ebx,ebx& m5 W9 @! G& v/ G( ~1 h
mov si,82h
: @, B- ?* I! t/ t mov al,es:[si]8 t9 \; _; F5 C6 C% x+ L, C
cmp al,'r' z* p6 j3 @, f3 r
je R" v1 j% l5 S( o$ g7 f
cmp al,'R') M3 Q% Q8 R! P; X# J
je R
& A( j {) F* U0 n) V cmp al,'w'
Q$ Z3 s% f+ M, [/ c7 y je W
' H# T. f, j! B cmp al,'W' @7 Q3 M9 c* I( m
je W 1 S7 B# j" e* [. q
R:
2 v# y0 v8 a9 G9 Z( f mov si,84h* O7 ?6 P* U& s3 B
mov al,es:[si]7 l1 h5 K1 l$ x" J9 I, `
cmp al,'b'
7 X' c2 v1 _5 T% M je RBT/ t( W$ q' F6 o; R5 y1 d
cmp al,'B'
" R) V5 c7 l# u3 V je RBT
. X, }; ^0 T' P( g cmp al,'w'6 N5 S- d/ ]/ l
je RWR _/ v; e# N* g+ K8 ~7 {
cmp al,'W'
. v" J @. }# Q! i je RWR
/ n- z: G" T6 W cmp al,'d'
7 H% l2 v5 a0 v je RDR2 W6 L3 q$ `5 O* D9 u5 \
cmp al,'D'$ N6 S/ n: {3 a2 j# h8 _( I3 g, m
je RDR ; }9 o" ^. s! p/ ^1 F: J; p# ]) z/ Q
W: ) [) I7 i7 e' P! e! u
mov si,84h
. _, {1 t! ~9 @7 B2 v& Y: \$ i7 d mov al,es:[si]
3 k4 r7 ?8 ~, M) \+ h. A1 A7 E cmp al,'b') \& k( o) E- m, t: N/ o# l8 T2 A
je WBT
$ p$ `$ u' w! y4 G/ ]6 u cmp al,'B'
: r1 S( n4 ?* Z, X$ |2 [, d je WBT
* m: A! v% T- L5 y7 d) Z2 m cmp al,'w'; K8 {0 |9 _, d- @7 [$ x& ]
je WWR
! W1 z' q* w6 L6 W8 A cmp al,'W'
0 R% o/ o" j3 u je WWR
7 b+ }3 t) X2 h! G) } cmp al,'d'
& k3 l3 y4 ?8 A6 |$ U F" e je WDR
. r8 h" ?7 n9 J+ U+ ^ cmp al,'D'% `% E! _8 S" [6 E) g" _- T- Q
je WDR8 C' U. B0 ^8 Z) @
RBT:
, j5 l1 K' H* g9 Z) ] call PSP ( p, a6 k2 G! U* N( V
call crlf
; a8 ]- h8 j0 Q6 w/ W$ d7 _1 U4 ^9 D+ [ mov esi,ebx
/ I2 J0 L7 C; m0 W" e& g; z1 B! | mov eax,fs:[esi]
5 m$ e' A: f+ [/ R/ V6 c2 E out 80h,eax- g. F0 A9 ]% J- M) ]& h7 N9 w
mov ebx,eax
\0 F% j% m6 ?( D2 { call _8bits
0 Y' R4 \0 w0 X/ q' X jmp Exit
5 K/ J7 ]$ g2 f/ z; @1 u$ D& L# \RWR:
0 h& u2 W4 J, w" t) z D% d call PSP
5 w+ y0 o! u: ?9 e7 j! G4 G call crlf
+ D4 O" O/ r' g& U5 A6 K mov esi,ebx
5 O8 ]: ?: l: m O& q mov eax,fs:[esi]5 O; k5 @- R1 P$ Q
out 80h,eax- f5 v/ [2 p& i4 E) N
mov ebx,eax. r9 t- }: w7 U! f( ^5 z. S& Y
call _16bits
1 |" M8 G: o# m3 s* ?, n8 n jmp Exit
9 Q1 q, N2 f8 a% X' nRDR:
" N+ h+ N: Y$ w- c* l0 n9 W call DPSP , Y T8 W9 T S
call crlf
9 Z$ G) o7 f& a1 s( ]3 w! o mov esi,ebx
3 c3 P* R$ B$ i, ]3 u mov eax,fs:[esi]
8 W! O A8 n5 `8 V: i out 80h,eax
7 A/ r) z% D' }/ |/ q. K* V D mov ebx,eax, f* r$ M6 m% w
call _32bits
1 u/ O' {% M1 m& B* R0 I jmp Exit
1 D& L: L G) F% L7 \3 F9 D4 t3 h;------------------------------------------------------------------------------------------------
# z: k1 E6 x3 i* gWBT:
, u z% K% h: O2 J. S* N' y jmp Exit
! L& }8 t( y1 [; rWWR:$ X# v8 @! Z* d& L) b/ l% h
jmp Exit
! s" b' Z' h+ |* Q$ o% Q8 DWDR:
( N/ }2 h( k- Y( [ S, M/ k) k call DPSP
6 l" v3 p7 [* z6 x: i" L; ] mov Maddress,ebx 8 ~/ S( D; y/ {0 P4 r! d) a
call crlf
% r/ n% z" L2 B8 k call WDPSP6 o& a7 a2 M: o9 Q" X$ ?! e# S
mov eax,ebx2 C! ?4 y; O! ~* ~
mov esi,Maddress
7 A) \+ k- M; x! A+ ^" f: _ mov fs:[esi],eax
! x7 Q8 |' e, _0 X! @; ^; A ^ out 80h,eax9 v, X0 q: w7 A
jmp Exit
) G- B' U6 W$ O4 B6 w" g. u;------------------------------------------------------------------------------------------------
. ~8 k4 n7 }& z5 f( J/ hExit:. Z; u; b$ C! O* @& n8 J
call real_mode
0 D7 Q8 i2 T# D; B2 ? pop gs, W) _; Z6 U( q! Z( c
pop fs
. E" D6 X0 n, a( ~' S* Z pop es
# j" s/ z7 A/ w# ^2 t- A* m pop ds & ^6 I2 O J2 _2 p B' D; x! T
.exit
4 z0 L: `$ ]6 o;------------------------------------------------------------------------------------------------; s1 y8 Z4 n$ U# H5 l1 W# ^
big_real_mode proc near
8 t" [0 A% N% z) F3 ^6 Y4 M in al, 92h
) v6 O( }; t# _0 x: ~ or al, 0022 f6 q: D( d- e: X0 A
out 092h, al' A0 z" }$ K+ w6 j# p b9 p
out 0edh, al
6 ^! ]+ \) f6 H- J7 K2 m cli- _9 j7 \8 e0 x. }/ ]
mov eax,DSEG
7 Q) H' ~1 v) r& q shl eax, 4
0 F @: D. u4 Z2 D- k xor ebx, ebx+ a" X# E2 ~& g) z) d, ]/ T
mov ebx, offset GDT_def
1 t9 g9 p( w+ }! [# K( _9 } add eax, ebx6 ^& n# z, F# ?% W
mov dword ptr GDT_Addr.Base, eax
+ I# I/ a% D: D3 w lgdt fword ptr GDT_Addr4 ^7 R% J2 X# O( z! A2 N3 k6 s
mov bx, 8. ~' m% G) w% A+ ?" X2 L0 j0 z, T2 ~
mov eax, cr0- U+ K2 E% |9 X
or al, 1$ N7 w0 d5 Y( W( Y; l
mov cr0, eax
$ e, b, K6 N' D2 Z jmp PMod4 w; k5 f% q8 u
PMod:
+ V7 E) k2 R2 E' M, @ mov fs, bx$ B) v% W9 j4 p" H2 Z1 t
mov gs, bx
: `) @% I* r5 Y mov eax,cr08 }8 d7 M" u( Q
and al, 0FEh3 r* i' R5 B' S) _) V t
mov cr0, eax * d, O; w9 ?% H
jmp RMod" _( Q. H6 N* X6 n$ H2 r) x( d8 w% y# w+ p
RMod:
) N/ m/ X" a+ x+ ]+ ~: [9 q xor ax, ax
& V% ?7 a# s4 c; H. R o mov fs, ax# I- Q8 B3 [6 o4 O! O( n! ]- d3 z
mov gs, ax
9 t$ q5 w n) M4 T sti , D/ b' E. H# ^
ret
6 t; _. o: Z# K3 p% `5 D. V7 ~* v# |big_real_mode ENDP
5 o, t& L4 ~* P/ h;------------------------------------------------------------------------------------------------
' X- | T8 Y( ]1 `7 \, s6 |real_mode proc near& `. P: h% U, W. r% [( h( S; z4 h
in al, 92h
% E1 S! @" g2 d9 b" I and al, 02
, Y5 x8 x7 w. G' C# T out 92h, al 9 z0 I* k& J# h& l v
ret
# ~! B( w; t8 q" Wreal_mode ENDP5 Z5 R6 W, v3 J( w( S9 G
;------------------------------------------------------------------------------------------------
6 j. c5 C% d: u9 H. lGet_Commandtail PROC near
! B4 z; h, ]9 ^ e. ^6 Q4 ?: E mov ah,62h
% c7 U! r" {4 U! ` int 21h
% s, z7 U% v8 o. H p9 z, k+ I* n mov es,bx
0 O/ {$ Z& ? ]- C; @ ret
G: A2 V9 D9 Z7 S! N! c# b, mGet_Commandtail ENDP
9 D$ f0 r* l& [6 [5 p8 G;------------------------------------------------------------------------------------------------
% G! z. `. x/ c! NPSP proc near
0 z% U8 i9 a- @7 b0 H7 U Y& ` xor ebx,ebx5 {' J; O$ E3 x |8 V% P! I' ]1 ~
mov si,89h
: C4 ^$ a. ?" y, {2 m# @ mov al,es:[si]2 }1 o6 x; }+ ^" J; p0 y3 I+ x
call Change) O" \0 r' W. d1 }
mov cl,4
1 O7 p( ]$ s. e; P' t8 P shl ebx,cl, c, V) n0 Q) p! j2 ]3 U' X
add ebx,eax* C1 ^: p; G, D4 W* N W7 U
mov al,es:[si+1]
% F G. G5 d; S5 q call Change
: U5 d: v; a$ Y6 U+ V1 f mov cl,4: x L+ Q7 ^" ^8 d: ]
shl ebx,cl
. I2 [- R, k! ` add ebx,eax
- W6 P' f- U( F5 f+ {2 L mov al,es:[si+2]" x$ Y8 g! v- Y
call Change
4 s# S1 I7 ]9 Q mov cl,4
7 N/ I, k2 Y4 k# X1 e shl ebx,cl
* [) J( }. M/ D% J6 D- a add ebx,eax# F4 J* k/ o! X& w
mov al,es:[si+3]
3 N: ^+ |, t3 Z# t4 @ call Change: v% O4 d, P4 p2 J# C! U; L# i2 Z
mov cl,4
7 l* p: [+ ` ~ shl ebx,cl# h; j+ ^1 R' ?# h& z- }" }
add ebx,eax- \6 V2 f" a7 O% F3 t( M% E) `8 I
mov al,es:[si+4]* d! {8 N: a% n H, A
call Change$ V" H/ @* O! N$ ^0 E4 \
mov cl,4- u, B7 U0 t( m
shl ebx,cl
' x. Y( H; x' s1 W8 E add ebx,eax
4 o+ x% E8 M% f% A- D mov al,es:[si+5]
% w# R5 t, Y; T call Change
& F" G5 l' \4 W- K. p' Z mov cl,4. W9 u; B# J; C' [! D/ k5 Y+ F
shl ebx,cl
# F* v1 N3 ]) Y/ t/ k0 X1 t add ebx,eax
p0 R8 x' t/ i mov al,es:[si+6]3 W% N) ^0 X- e- }' x
call Change
+ l. ?; M' S$ n mov cl,4; S! Y5 ?/ C5 C( f5 |+ `5 g7 {0 r
shl ebx,cl
% A8 }4 W [5 N/ L add ebx,eax4 a) w6 Y$ ]* F# \ u8 ?2 {4 P
mov al,es:[si+7]. {6 F$ ?% ^% F$ A, X' y/ o$ {
call Change4 L+ s2 {0 ?- t4 H8 J4 p- l
mov cl,4+ o# h9 f/ W+ E& N0 g0 [0 k% _ n
shl ebx,cl
0 ]) p# U% ]6 F" s add ebx,eax
- n8 e* m8 L4 w/ B# I. t+ S ret7 ^& g" K6 }9 d* K; @
PSP endp
) a% M$ {; E" a+ a;================================================================================================
) Z' v4 V1 X* ~% S+ {, q0 IDPSP proc near- p& k; F" T5 A5 l9 _/ p! s, H
xor ebx,ebx
1 d, _( h# C2 j9 N9 \4 N. V mov si,8ah
4 ?1 d4 ^+ P* t0 b- v mov al,es:[si]
' d" d/ Z; B) ~ call Change. R- f1 f0 r7 @/ Y. W
mov cl,4
- t5 g! j { m) Y8 G shl ebx,cl9 g W' ^6 k, @* g; i
add ebx,eax# J; P" f; U- Y, g- |
mov al,es:[si+1], V; J' u) Y% l4 N
call Change+ p! P0 g0 K; H! ]* J
mov cl,4
. ^. S+ l6 z8 @: y6 ] shl ebx,cl
0 m, \8 u& w. B; p add ebx,eax/ g r [$ \* d+ l3 X8 X
mov al,es:[si+2]+ x4 @; W$ \# @: X& N3 {
call Change
7 O: q$ R4 c1 ^8 g mov cl,4
& _" p5 d3 e# j- z3 f. \$ e+ F shl ebx,cl
$ ]( k a% p3 v* ] add ebx,eax8 D9 W6 ?. T; ~0 X: o7 l' X
mov al,es:[si+3]$ {6 c* d5 z6 c& J) f$ _" q8 k
call Change
; z$ m6 s. o1 U0 v$ g7 ?1 F mov cl,4; U; f7 ~- p: Q) p$ j5 Q4 C5 M
shl ebx,cl
, }/ ?5 @' T% Y# S add ebx,eax; L) s) q6 Q) l- x4 B5 `- H
mov al,es:[si+4]$ d8 u ]6 n! G: V$ }$ z5 R: L4 d
call Change# {* R8 [1 L& h! p6 }: l
mov cl,4
+ q7 |4 h( p- A shl ebx,cl6 o4 J& K( I2 S* w
add ebx,eax
: _6 p) \! l! I% N- x8 Q; n! B( I mov al,es:[si+5]: H5 W9 T2 f5 d" y
call Change
6 l( F% O- P$ I8 _, T mov cl,4, o' }1 @% k1 a" S
shl ebx,cl) |6 j: j! {6 e, s
add ebx,eax2 { O) ~8 ]' N4 P
mov al,es:[si+6]6 U8 |. B0 d o3 x! d
call Change
$ ^8 g( S: ]! I8 P4 s( R3 D3 K mov cl,4
! _2 r- H% @0 E. f! M V5 Q8 Y shl ebx,cl
# z. K$ b2 n+ ^$ E: j add ebx,eax
; y; t' o0 U% x' d5 s" d mov al,es:[si+7]
' G6 ~0 g' Y) u( r, \4 _" b8 _7 h' B5 x call Change
" c R' {$ e0 I7 _$ F4 A mov cl,4) w. M/ l) k2 q8 W" g
shl ebx,cl. @5 l9 M+ b/ y& h* P. t$ h1 n
add ebx,eax& ^# V# R" h! Y" B; ~
ret
3 A$ R; P$ A vDPSP endp8 `. @; c, |" G1 f/ i' G8 p
;================================================================================================
9 c4 b- j$ R7 j2 I. L6 iWDPSP proc near
8 _4 T# T5 Z/ Q; L xor eax,eax
) |, y) H" V9 t3 M+ q3 Q xor ebx,ebx
, l* y, A% q1 d6 T% G/ w mov si,93h8 V4 Z$ R" k# ]0 `6 }
mov al,es:[si]) w8 X/ K7 E( s3 ? ]1 n
call Change! a; p( U4 F' N" ?5 N' U5 {+ x
mov cl,4
! F# q+ C) y" y. v' t shl ebx,cl% i5 c2 G1 E: D0 `( P% V
add ebx,eax
' f1 {+ z# D' P& Y' @ mov al,es:[si+1]
) F" D: p9 w/ H call Change
4 H3 c" [; S2 V5 j mov cl,45 ]8 o1 ^, K& U; o4 v
shl ebx,cl
5 E" r w3 n3 K& f, j add ebx,eax7 ]% H2 w+ q4 ]+ x U8 ^9 o/ l( A2 c
mov al,es:[si+2]
' H8 W$ A& p* C$ ^$ R% k1 Z call Change
% c+ I; C$ J5 v- X) Q mov cl,4# ^3 s7 z- B* A5 G. N9 d7 M2 N
shl ebx,cl8 n1 |+ O. }0 P9 K
add ebx,eax. a3 s( c2 W! n6 q
mov al,es:[si+3]( D v6 s2 z B# h0 J* x+ H
call Change& f* @4 ]' l4 v8 S5 y, D V
mov cl,4
9 A) D8 [' ?! T/ |7 S shl ebx,cl, X& G! }% M7 m7 F" s
add ebx,eax& y; |4 A5 g( B. e0 n H5 d
mov al,es:[si+4]3 z* B4 H W/ T( O
call Change
5 `- a: u* K3 M/ d mov cl,4
" G( ^, y% P% V shl ebx,cl3 t1 y' ^+ ^6 E2 F. R
add ebx,eax
4 Q( ^* b/ {! i% _ mov al,es:[si+5]) u/ o; z) o N7 R+ S
call Change
w3 w* L' P7 o& I6 h7 P- x, f2 K/ A mov cl,4# h" a- d6 T/ H% N) I3 H6 }
shl ebx,cl
q1 @* y+ z, Q+ l add ebx,eax0 e6 j' k; p0 N7 m. d( _
mov al,es:[si+6]1 B/ _$ v& z3 g6 T
call Change3 [1 Y, A: ^" @) X0 A8 r
mov cl,4
4 x4 I# F% o- S+ R/ }0 j9 ` shl ebx,cl$ |; d+ a Q/ \ K: D9 `
add ebx,eax
$ S% J, N2 o6 w; h6 S/ c mov al,es:[si+7]7 Q- n0 c# M1 J. R
call Change/ v% W4 w6 d: |4 W0 }8 ]# V
mov cl,4
8 [; s1 Q) t! c* X# T% [ shl ebx,cl/ p) }- ]3 p# O
add ebx,eax
, b' I' Q, }" W) v ret
4 W- {- p/ G( Q- L8 u+ N; H+ @WDPSP endp- X' E8 {1 a' D: O5 [
;================================================================================================3 Q6 y1 C' p% v7 A9 A1 v
Change proc near
6 E9 t9 X" y' |7 e2 eA: 5 E/ i- k+ I: [) ]
movzx eax,al
4 l h+ _+ I; r% R1 Q; K% z+ X5 V mov edx,eax9 x/ j3 |" `5 R6 M
cmp eax,'0' + |, b6 a. M: w5 A2 z) o* F/ I- Y0 s
jb A
) c/ ^' `+ E0 y cmp eax,'9' # Y1 c! l: U; v& C) Y* w; V, z. b
ja B9 F# c6 i, x) j! ^+ \
sub eax,'0'
- ^+ E9 _/ ^& t jmp short E
, N! N9 Q2 `8 X, F3 R) v. k2 hB:, w2 M. G9 v, `5 f& z! `- d' \
and eax,0dfh . _( W/ O0 l+ B5 E, r
mov edx,eax
0 o. x% C- h+ v# d6 Y0 j sub eax,37h
3 M X3 h/ g1 s, m( V+ M& k cmp eax,0ah
2 R! T% Q2 @+ a) u8 k! K: ? jb A
0 x+ w1 `: F+ f* v cmp eax,0fh# ]- v2 V# x3 {! T
ja A 6 d/ p+ C+ F/ O- X
E:
8 V8 Y3 \6 c. n! e push eax
. ?( a; J: {- ~- l call PRT + C- [. ]7 u: j+ j& P$ t/ f
pop eax
- P4 ]+ C# R! _# @$ ^% p1 ?; iCExit:- c, w% @, ]! p4 L* Y' K4 {
ret
# o. Y5 q. `2 G9 m; f9 b/ G% eChange endp
# u0 Y* k4 e- b& w) l) v7 j" i0 p6 ];------------------------------------------------------------------------------------------------ w$ u) }1 I, f
PRT proc near
/ Q3 {8 P9 G2 h6 O+ Z7 G5 s mov ah,02h
( U K+ U/ C/ z. N int 21h
3 z9 ]4 q) l# A; j ret
7 Z) v. d7 f, L& Q7 qPRT endp' a) U: n( U; m X
;------------------------------------------------------------------------------------------------/ J2 M4 V6 n6 h" W, `" p5 Q
crlf proc near0 c- f" n- \5 g& L& f
mov ah,02h
; C. j) ?0 ]3 G) @ mov dl,0dh
" w. |* Y0 A2 h0 k int 21h
1 `3 Z8 E9 }" `" H7 I7 P+ e mov ah,02h3 r3 [. z7 k0 V; K
mov dl,0ah
1 z5 _ f' Q( y* f/ d! F% k) C8 I int 21h! I3 r- ]# ]9 ^- M- Q; Q2 Z7 l
ret
% `5 L, D5 w4 X9 B8 w3 [: Kcrlf endp! [, [: L- z T+ N
;------------------------------------------------------------------------------------------------- Z+ K0 i* r% e) _
_32bits proc near
$ D5 }1 S9 E. I6 y# [) F pushad
% d) B8 `2 n6 G( D' S) ^: t mov cl,4
0 {, w& [" G$ g, i* c- _; _4 J% p; n rol ebx,cl7 ?: C* g+ X Q, R0 ^* \
call print_4_bits
: I% m" q* H( E! C$ }' c: F rol ebx,cl S; z6 P" J) }/ v$ B
call print_4_bits- G+ D7 R9 k, E9 a2 c) s: N: H
rol ebx,cl. _$ _1 q4 s% a p c
call print_4_bits/ H( n. A. T/ ]; T1 I
rol ebx,cl5 C4 i$ j7 ~4 [' T1 y/ V
call print_4_bits
- T( z" T n# c- Y( @5 W+ ] rol ebx,cl
- ~; d6 i2 Q" `* R# L call print_4_bits
# K% L& n# C; r, Q rol ebx,cl ~; v# a* K# A: C) }$ f# k$ y
call print_4_bits) [5 W$ w1 ], G6 T
rol ebx,cl
7 V, q( E0 b5 T call print_4_bits1 f! e1 f' T& k0 B4 J
rol ebx,cl2 O: ^5 c9 g0 F1 Q/ p' y2 m
call print_4_bits
: n7 A( \ j) L rol ebx,cl
7 Z ^! S" c" {2 C3 b popad$ b K2 d2 p8 U6 q, U
ret4 F0 v: }4 c! s) _
_32bits endp
7 [1 u8 Y4 U- O% {! J9 K;------------------------------------------------------------------------------------------------
! A) m& N3 g% T9 v+ O6 R_16bits proc near) D! }3 e. N8 V+ r d: l5 D
pusha
" P0 F( a; E/ ? rol bx,cl! X D T8 b" F& L& F3 v
call print_4_bits
* o9 r9 B6 U: x! C5 O3 i# j/ ]0 K+ f" Z rol bx,cl# e. Z+ @ v( [# q3 I
call print_4_bits; [( f8 D; n: X1 q' j4 c
rol bx,cl$ p5 x0 R' E$ i, P3 V: V0 j
call print_4_bits
* w" z3 ]) Q4 n rol bx,cl
6 h; k2 |$ V7 m I2 O, D1 d/ y* d call print_4_bits
) _ X$ A8 B4 Q) c- s! o2 S% J/ [8 B popa s6 r4 g3 A! x2 V
ret
' ~- \ [3 B- {# H+ O. O, B_16bits endp1 o8 q0 a; Z: W( i1 K8 t( o- c8 G( r
;------------------------------------------------------------------------------------------------% [2 t: N3 _( i; u
_8bits proc near; w( U0 F' c5 M6 j3 z' i( w
pusha
2 f; o# m4 u! s6 t. {2 F# \' o rol bx,cl
0 a- _9 c. @7 h0 l# x call print_4_bits6 E: L. p9 G6 [/ p- K+ V7 ^
rol bx,cl- ~( `! _* C. I
call print_4_bits! ^$ ?! `+ C3 y- A7 o
popa; n/ `' q& J- s( B
ret
7 X4 G: i5 X' q. s; A_8bits endp
0 m; e# n2 G' i& \! d3 z& L$ Hprint_4_bits proc near
( B1 i) R N* c* T+ S5 J mov dx,bx
& ]7 {: r& [& B$ f) S! N and dl,0fh
% s: { @ @4 `; y3 ?1 L. Q |/ Z add dl,30h7 V( t" O- O* i% H( l. X: v# Y
cmp dl,3ah) l- p Z' @& k8 ~" T- _% N5 ~- B
jb print$ `* f1 O3 W3 C" M* q# k( K
add dl,7/ {# e& c" v9 S4 c* O
print: ( S/ W9 D6 o; l& m0 g) r8 q2 m
mov ah,23 @1 X+ T3 P3 _ [! q( i
int 21h
7 S3 E. H G; G* u ret
% {! v; _9 K1 u: W5 }print_4_bits endp
3 i- U! k; O/ wCSEG ends
3 q8 m# ?: N A) o, c& REND |
|