|
各位前輩好,以下的程式為在 big_real_mode 讀取記憶體的值,例如: C:\memory.exe(程式檔名) 01000100(Address)! N9 s5 c7 G) c+ r$ x# B A; z
& v: c9 ]$ R9 }# B( n; b7 F' H
則會顯示01000100位置的值,但是我另外在DSEG SEGMENT USE16'data'' Z) ?" t& S" d8 a; b
1 ^5 |& t6 G+ n, k* J宣告了Maddress Dword 0,但是程式執行時,會hand住,麻煩前輩給我一些指導,謝謝 . j) c6 `" }: U$ j3 U4 F* i
+ D# a( W, Y9 P* k: `4 h# i
.model small* ~% e! U, H) h8 U6 R* t* q+ Y+ G
.386p3 e! P2 J7 Y3 b) q( g
DSEG SEGMENT USE16'data' 6 E5 q* x* Q4 r/ a7 I
. @: t8 X' i4 }1 E+ \% H: y3 N
DESC STRUC; Y3 Y; @9 k; @9 ~
LimitL DW 0
+ I1 g9 e' U( M/ M9 ^ BaseL DW 0 . y+ `+ x% A/ q* Y% G9 S
BaseM DB 0
& k: j& ]6 j! x) c Attributes DB 0 * m. Y n- Q7 w; f
LimitH DB 0
. [* m. l L9 [ BaseH DB 0
# b' s9 a9 Q1 Z. eDESC ENDS8 Y9 k5 s5 L% u$ ?& V0 i
# \9 F* B3 n X7 l5 g# Z4 F0 M" x
PDesc STRUC
4 d6 g) n. H9 L8 ? Limit DW 0 * D9 K+ y- {" y$ Y, x0 w
Base DD 0
' Q1 @' Z. X, `9 S5 q+ x0 qPDesc ENDS" [7 P3 c/ K' H+ l& P ]
( a/ o0 ^: i: q5 G! v6 a( i8 bGDT_def Label Fword/ F9 M; `; {0 Y9 |! [/ G
Null_Desc DESC < 0h, 0h, 00h, 00h, 000h, 0>8 e+ j6 p5 q, K3 l& b
Data_Desc DESC < 0FFFFh, 0h, 00h, 92h, 0CFh, 0>
3 b6 H9 [$ ]9 }8 ?& @GDT_Addr PDesc <$-GDT_def-1, >
+ P0 f5 K( Z/ N0 p1 s$ V% [2 h5 m4 z* K* i# m8 b- ?
Maddress Dword 05 o( ^; g8 T1 z
9 g, z% r& b7 q/ ]8 W( FDSEG ENDS , I7 T! p& b/ W6 J" r8 W
ASSUME CS:CSEG,DS:DSEG% o4 o2 g2 k0 _8 K
% _5 u0 p$ k, `# M
CSEG SEGMENT USE16'code'
9 a6 A) X# B3 ]+ ^6 u$ g4 S push ds
) I' j6 U" o) Q) G) @9 _$ @+ C4 w push es
8 x1 h8 s5 H# @( ^( [2 ]! E push fs
( h4 |5 p1 ?: s2 T7 ~$ {4 n. Z1 J push gs
3 b2 J3 ?0 x) }, O G call big_real_mode 6 f: K9 C' j! C/ F# `& s( i$ u
call Get_Commandtail% s6 O6 q) s8 F q* o7 V# G
xor ebx,ebx
7 A; K1 m3 K4 {$ \' Z" |/ C mov si,82h% W' f' B r( E0 V
mov al,es:[si]
7 ^2 [# c* T6 t: s, O8 R cmp al,'r'
- A7 E6 _' b; p2 ]' w je R# X" t! I: Q! A q
cmp al,'R'0 z' r W3 u& C, l
je R
9 P4 w; Y h* A& H) { cmp al,'w'
' T1 _( W- I. N% K+ d3 B je W
7 W, D" w/ E2 A; I# ~8 u cmp al,'W'$ _) o: v: G/ b$ L
je W " [/ |7 v4 N+ T$ b! o1 I9 ~/ H
R:) M: q# `0 v; f7 k1 z+ @$ O a
mov si,84h
- [& h, i5 {/ j% [ mov al,es:[si]
5 i- C: f( t7 \, @) Y& u# _ cmp al,'b'
( L3 [5 {3 r) p9 F* L0 m- b je RBT5 O# n( N" K A/ h
cmp al,'B'+ {) _ { u @) p$ k6 q8 a
je RBT
9 K+ u7 j9 G* P/ a. J" W* V. @ cmp al,'w'
# \3 `: L- X" W( j je RWR
& F: k' z: a3 q8 w+ O$ H cmp al,'W'
+ N7 @% s, I! P& Q$ F je RWR3 w ~; a3 R: e( u+ J
cmp al,'d': i/ s" W6 A5 `% e w. p
je RDR
/ C( W, c# E% W$ S/ f% ?( @ cmp al,'D'# f( F' q4 }5 c9 _! D. f
je RDR 1 U& M4 [1 ]- T3 J$ @- O p7 _
W: 1 | f+ v* E- g4 r
mov si,84h
# S" i& \) P4 N9 i4 ?" V1 ? mov al,es:[si]
+ X" i5 j! E: ~5 E9 L1 [& c cmp al,'b'! R- S( z5 c4 i7 b
je WBT
4 R+ E( _( M2 Q7 ~0 U$ @ cmp al,'B'& G J2 e; `$ Z" F; X% j
je WBT
4 w1 h8 u B" ?, F0 N% k$ ? cmp al,'w'* e( l5 s1 a0 X' F
je WWR' ]4 F6 y0 @' |6 \
cmp al,'W'
1 H1 k5 ?! C# k. b3 V je WWR
, w$ j8 R/ D; w7 V! @ cmp al,'d'+ [* E/ ]6 Z" I# ^
je WDR
6 p; F$ z1 e0 `6 b# d2 V cmp al,'D' o9 P* R4 ?- `& i( ^3 w" O
je WDR
, s: T7 m, t3 u& L2 |' `. lRBT:. ]2 ^6 _3 O; e! T) O' }
call PSP 3 R. _6 w, _7 |; U, z$ z4 m
call crlf * Z! c* g3 z( g0 x+ z3 r
mov esi,ebx
7 b3 _, a+ B* A mov eax,fs:[esi]
/ b$ L/ h; n# e f1 D% h2 H) \ out 80h,eax/ D( Q5 J: K2 i
mov ebx,eax
: L6 j% }$ k4 R. r: C call _8bits
, b5 [& j/ T* L [; z+ N7 r0 z jmp Exit
# \; H4 `0 `1 p' aRWR:$ G4 F0 Q0 Z w
call PSP ( g6 \/ _, f4 W# a5 Z" A
call crlf 6 ^# R; q; C7 V. ~" L6 _: ~2 V
mov esi,ebx' z% z T3 y k7 @; e
mov eax,fs:[esi]
1 P* R! F/ D g/ c7 s out 80h,eax
, `+ i1 m0 _: s5 P/ D: N/ B W' K mov ebx,eax
' |% u% J1 ^- Y( a7 h3 j call _16bits
+ \% t- }$ C/ T jmp Exit
# D' Y7 r. X4 q+ P. @! w' c: gRDR:
; g1 ]: b( u1 ?( e9 S call DPSP
3 M% ~- W7 B* \ call crlf
0 U+ Z. c( F7 X/ @ mov esi,ebx
+ s$ h! ~7 G7 Q mov eax,fs:[esi]
3 J; y* N3 y, v& Y. f0 G0 } out 80h,eax
# w3 {$ ~& I- f% j+ F( [ mov ebx,eax8 ^; D t0 K6 F
call _32bits P2 ~- {- z' h1 @3 ^# _7 |
jmp Exit! p0 Q- Y/ r2 I
;------------------------------------------------------------------------------------------------! D( Z3 j, S( P2 ]# r
WBT:- V A- a2 O4 A1 P, }( W
jmp Exit
2 _* V# ^. a: b6 E/ u: U, DWWR:( d' `+ k$ j j# I2 w
jmp Exit
0 ?, r& H0 s) S/ \- A* Z- A/ d: mWDR:
/ j! T7 U2 S8 v; { call DPSP) P2 {9 r8 i" \9 R
mov Maddress,ebx " S# g) Z$ D6 p' A# W
call crlf" f6 s" w" _ ~3 q" |
call WDPSP
( N3 a4 Y: l6 K- S$ l g+ F mov eax,ebx4 k: L! y3 y4 @/ k
mov esi,Maddress 6 }( w% H+ `" r; G! O
mov fs:[esi],eax
$ V/ C# C6 h+ ? out 80h,eax; x- O3 _/ d: }" W- {" l. B4 g
jmp Exit
1 b- U1 _7 \0 m/ h3 @/ U( s/ e0 w;------------------------------------------------------------------------------------------------
d6 ~9 W" x. R2 A! Z" }Exit:2 D7 i( ~# x5 ]; Z) O
call real_mode + a5 M+ {/ L9 t w8 N
pop gs) }6 h& H3 I. d$ A s
pop fs9 g; d. d/ i, N+ T1 I/ \) x
pop es
5 P3 @0 u0 z* n2 `, M1 U( u0 O3 x* e3 x pop ds
$ |/ r) ~, O1 d) T- y5 w .exit" V* T9 ]* ?- }0 r( D2 S! ?! \ O
;------------------------------------------------------------------------------------------------
* g9 |4 L" ^1 n xbig_real_mode proc near
6 j: M0 ~! h! {1 K in al, 92h6 Q" [$ _" y5 q/ ]2 U, |: x ?
or al, 0025 p6 g2 q1 y1 J4 j7 R; Z
out 092h, al
/ ?; b7 ^5 T0 b8 l5 i out 0edh, al
; H) a3 Q$ m- \8 H8 ~8 h4 O& y cli3 P3 Y. ?( r% d5 F L$ ^: G
mov eax,DSEG& T8 I% m3 N! y; c+ q0 ?( I
shl eax, 4; v }; n- d. B( g
xor ebx, ebx
! v- r" F* U- L" @' f mov ebx, offset GDT_def
( e( d2 a7 g6 A3 Z6 g# j add eax, ebx
8 D. z1 U' m7 A+ j mov dword ptr GDT_Addr.Base, eax
5 M5 A; N6 I; d+ P6 |& y+ k6 F lgdt fword ptr GDT_Addr* I( U: q" `- d0 N3 d
mov bx, 8
6 M/ A0 x9 V3 p2 h0 B9 M, k mov eax, cr0
+ |% M' a. b/ K) Y or al, 1
: B+ x+ b( V5 L" t8 }% ]6 @- ^ mov cr0, eax
" v* |! ?, e$ s# U jmp PMod
# v/ ^" s- t& {! f7 u/ m) l$ }: h4 nPMod:* a/ x8 V6 ^4 w- y5 p7 z
mov fs, bx2 r8 ~6 C% ~5 B6 P7 R4 o
mov gs, bx2 a# l9 c' H) E% O; n3 k! t1 P
mov eax,cr08 b- H4 X/ l" R. {
and al, 0FEh. }/ M# o1 |/ n, T
mov cr0, eax - u5 V5 e) j7 ~0 _9 p, p6 U7 Y
jmp RMod
8 r9 I1 |& R7 N6 tRMod: D, C8 `/ B3 O/ Z! Y! x7 D
xor ax, ax
) `; L; ~9 g- k2 w) O mov fs, ax7 M- R, O r& m
mov gs, ax 9 j8 Q' A8 a P9 z( P
sti , b; q) G3 F0 J y$ i6 R
ret
' n) J: B" L+ fbig_real_mode ENDP1 {( {6 U# v5 q
;------------------------------------------------------------------------------------------------1 a$ a' ?/ P) ?/ K. q" J
real_mode proc near6 V( u: ]! c# f" A9 p( R
in al, 92h9 ~/ D4 i" Z/ g
and al, 02: P6 \' q8 Q) _$ f7 \0 r8 l/ d
out 92h, al
# I/ M9 E- A; k% T ret
; @1 r7 w$ T: g2 p( Y; S3 \" P/ [real_mode ENDP
. q6 e9 R; s6 C( S% C- Q) n+ v. g;------------------------------------------------------------------------------------------------
7 `$ k3 l; m4 v9 J0 JGet_Commandtail PROC near5 g* A3 }2 ?: Z1 n1 n$ Z6 o
mov ah,62h
9 Y* t( j1 Y, T" I* X4 K int 21h; G* t* q1 z4 c" x/ N% c! f
mov es,bx
m m, q5 ~8 }! T) } ret
" B; {- o `) d. ~" f( jGet_Commandtail ENDP ! m: @* u) m' J& G# \
;------------------------------------------------------------------------------------------------
$ l7 F% @5 W9 ~! HPSP proc near6 v% g! d# B8 D4 J9 W& a$ u$ u
xor ebx,ebx
8 r+ S! p( @: l" c mov si,89h
9 A- z$ L! B+ u% w- B7 P7 A K! J mov al,es:[si]% e/ C- o( n7 {. o4 B4 p
call Change
+ J5 M: F! I# k2 m w mov cl,4
- c0 R: o$ E4 \ B3 [ shl ebx,cl: o/ z3 i. B+ {9 L( ]% M* V
add ebx,eax, V) n- W1 f( F; U: T
mov al,es:[si+1]6 O9 r9 Q: P! E' q
call Change
4 L; D0 ^0 q. I1 ]' R) s, ?/ t mov cl,4
. l0 Q1 o2 P, I# I6 z shl ebx,cl6 y: n" {* Z$ u" j3 E4 S% W# k$ `9 G3 L
add ebx,eax
9 ^2 |) c' Z; \; L6 O- Y: j/ C( d mov al,es:[si+2]
. b- C6 I7 I+ | call Change4 b- o$ b' x( S1 V4 T: O$ o
mov cl,4
( n% R. ~+ O! ~% g7 Q shl ebx,cl: o& ]' b7 s: G1 x
add ebx,eax
) K* i& _2 q a7 i' q- T5 q0 y' a mov al,es:[si+3]
& K7 Y9 a/ _$ [: R1 x call Change
, |/ E$ ]: X: `% u. E% p! ? mov cl,4' V, ?% b+ b6 @. F6 a
shl ebx,cl
% t e" L$ U3 V8 o0 C0 j add ebx,eax; {; H0 U( u0 T; _3 i
mov al,es:[si+4]9 @2 m. K3 q5 d6 a4 H' s
call Change" i: ?' Q Q' P0 G
mov cl,4
) x) {# g$ `4 V" u" u+ U. d# ? shl ebx,cl
* x2 A- H+ k: F! S$ m. E0 Z add ebx,eax* N, V7 f7 e, q# N
mov al,es:[si+5]2 I4 e, z, T% _' g% N( t- R
call Change
9 O+ Y# N+ Z; D* ?1 b6 J mov cl,46 [% U6 c. }, [* p2 H
shl ebx,cl, Q5 T5 h$ [/ I: y1 _
add ebx,eax
) M" G6 N; I& Y/ _ mov al,es:[si+6]
$ D3 F ^; _8 |. b5 M! l7 | call Change- q" O; C/ h6 }" [% o% j& x- k. P! |2 G
mov cl,4
4 \* q' [# E- S- D: D shl ebx,cl0 ?7 H* O1 r6 t/ z5 ]
add ebx,eax
' ]+ G L' B0 v mov al,es:[si+7]
F x" |* J0 v X6 u call Change
! J, i9 `! } i mov cl,4
8 W' @2 n+ n+ R n# A shl ebx,cl) s: D m4 R4 Z9 X" R* p
add ebx,eax# e9 ~/ F( A9 d* z k) J
ret
0 v7 X* m3 P6 L3 nPSP endp
9 k$ I2 p# J; Q/ I5 E;================================================================================================- t! w9 C4 d5 c" H! D; v0 P- `
DPSP proc near" S3 r" A* k8 g5 W0 b& Q- v
xor ebx,ebx
7 |9 O+ P, W7 j mov si,8ah+ D3 D O7 F' Y/ d, M# Q# B# r
mov al,es:[si]8 v: u) D" B4 f% w
call Change* c! L" P9 G' `4 h: ?# G6 S. d) s; E
mov cl,4
6 @3 P8 x* u* @% c& ~& K2 y shl ebx,cl
. `( j+ A9 ^* Y4 ]. c add ebx,eax
, U0 h( u6 e' d1 F3 L5 @ mov al,es:[si+1]
8 S) r2 X9 C) [4 c+ W( g call Change, N( G6 O6 V* f5 z* u3 c1 |9 d
mov cl,4
- P4 j) t4 W, ` {4 @* \ shl ebx,cl6 K: f# x2 i" c. {
add ebx,eax$ K6 k0 v: z( s+ H7 n% [
mov al,es:[si+2]1 H( v, w" U7 F0 y1 B" K2 l
call Change
2 A: L, p' S( Y9 D! K3 ~7 o$ p mov cl,4+ b& g. |! R5 D+ L) X2 W
shl ebx,cl4 |8 X; ]# b1 ]
add ebx,eax2 [6 r G# M( ]2 x& x% V. L% v
mov al,es:[si+3]4 m# Y d& D' v& F% U! r
call Change0 n& R: Q/ S5 X' x
mov cl,4
$ N! p8 A, u2 G/ f: t* R0 z2 d shl ebx,cl
1 `8 p! E0 ?+ a! g& z add ebx,eax
; i- ^! s& T6 R% V+ p mov al,es:[si+4]& @2 o3 s' P) |6 D3 L
call Change, w* `8 d$ D: J' R
mov cl,4
' c( X; m' i5 ? shl ebx,cl
% u* @# F1 u' X; d2 b add ebx,eax
" l3 u7 P3 u! s B7 Q5 t+ Y mov al,es:[si+5]
; f; @$ m' j( C& q call Change
5 K2 h$ i: i- r+ e. @/ @/ a mov cl,4
- }- c1 Z& j& e+ D" @ shl ebx,cl3 Z# T. s0 ^- n! R
add ebx,eax
% h/ s. ^' m: f, V# \ mov al,es:[si+6]9 d( p8 W1 Z; ^, e1 W/ t4 p
call Change
0 a, Z" Y3 D2 k* \" V8 g mov cl,47 v; B, w' ~* n' ^
shl ebx,cl
& G0 R. ?- T9 X7 V6 w! n add ebx,eax
* a" _! J8 {1 Z2 J, a mov al,es:[si+7]
. [2 c$ a& S W( S9 W' y call Change. R4 d. b Y2 L
mov cl,4
: p# `3 U8 n7 e: i1 V# N5 R- ^ shl ebx,cl) N1 q( e$ |2 G( t7 \# a2 \( ]
add ebx,eax6 K& {8 ]7 M& a" p1 d& [
ret+ ^: p1 F! |% W% n7 m
DPSP endp6 g+ R) @7 w+ x0 d! [
;================================================================================================7 I ^% P9 @' P' V; _! Y
WDPSP proc near9 p+ u8 T4 h% C0 d! Q7 r5 f
xor eax,eax$ s) [- {- q5 Y5 P+ S. r! d- ~. O7 l8 ^
xor ebx,ebx* N3 L; K2 r# Y3 O$ Y: v
mov si,93h. I3 Y; f" s! x0 z3 K
mov al,es:[si]
+ D( V0 W' `2 J( n, l call Change, V, c% Y5 q- w
mov cl,4 l5 E! a5 O; w
shl ebx,cl
c3 V( w! a/ B% T. p add ebx,eax
7 [' B) n, p. v6 V1 K1 p6 \ mov al,es:[si+1]
2 m6 o% L3 i) x! ]% N3 I call Change
8 L' v4 \$ p! o9 [0 h0 O mov cl,4$ q2 _/ V, O; M6 G1 a6 p1 m
shl ebx,cl [6 {7 T, }7 M9 [1 U2 p2 Q4 [0 q
add ebx,eax o$ y1 C) s( }# [) g$ x
mov al,es:[si+2]) G- D4 m6 R3 N8 V
call Change
1 O9 [0 y1 b# i# p" w; S mov cl,4
% G5 T; ]1 f/ g3 t, b shl ebx,cl
) s( V8 |* M3 X9 R" X add ebx,eax
+ A" w9 M4 H, y mov al,es:[si+3]
. \# `" w8 j6 @, r$ B0 e& y call Change
1 R" `" z" }( N! G mov cl,4; w/ \+ G* \& ^
shl ebx,cl) Y% G9 u b0 T! E$ ]/ t
add ebx,eax
6 f& W+ a3 x: o- p# Z; l- g9 y: O mov al,es:[si+4]! F% T/ u( O3 F* x$ `# k
call Change2 @: t2 P- F$ h1 u% T1 H U
mov cl,4- u. f$ A8 J) x- s
shl ebx,cl
# c% E' |: [ q2 a- J add ebx,eax
' q1 K( r; X5 p9 k8 | mov al,es:[si+5]
6 d9 n, d: \3 R call Change
; @7 P% P, y9 n mov cl,43 O# Z- V+ Q ?1 y1 B3 Z
shl ebx,cl3 U4 j/ K" ]! v
add ebx,eax6 Y% r6 `! e, y' Y1 z
mov al,es:[si+6]0 C) B1 V' g3 r' ^ L5 ~
call Change8 t' F+ y1 M9 J- E6 |/ U8 _% m& ^
mov cl,4
0 d! t' X2 Z) J3 S; S" p7 A shl ebx,cl D' u& ]: X! k, c0 P$ `
add ebx,eax
" s! N5 I/ p) y1 T6 d1 D mov al,es:[si+7]( I4 Q" L, p( |" x$ D* e& h
call Change8 S% N& Y* @6 U5 o/ ?0 R
mov cl,4
0 a( J- ]+ R* u B( ]% A) u shl ebx,cl
" \* t8 O* ^" U add ebx,eax, T- |: O# ^0 w! |- A4 e4 \& j& T
ret
7 w' I" |2 q1 J0 {+ @, b5 q9 t3 tWDPSP endp6 M! C/ @& B( e
;================================================================================================
, r6 P2 G" ?- iChange proc near: ^7 \! ?+ p* I( X
A:
" `3 G# G# m& h! I- k- ] movzx eax,al
1 s" ^) u" _+ I- w. L mov edx,eax/ `0 X: Y3 A7 v7 u$ g' H
cmp eax,'0' & R) S! D6 a2 ~8 v4 _" S
jb A
`6 x: }* s0 h; G9 N cmp eax,'9' 7 G0 b' @+ J9 A; M8 K' {7 n
ja B
% F. m* O7 j2 h1 U; {3 W, v; a3 N sub eax,'0'
* j5 t- Y( `. \/ n: F- N3 `/ ~3 ^ jmp short E
" R8 t9 w" c5 [2 K3 O$ P1 {B:/ H3 D9 D( A0 m0 Y
and eax,0dfh
* ]* U3 i1 T! s& ` mov edx,eax
' t \+ M; C1 I sub eax,37h
/ l8 K g. h0 Z1 S' k* d+ H2 P0 R; C# X cmp eax,0ah% r. X, x$ r: n9 }
jb A
8 j* w) f$ b$ y& ^ cmp eax,0fh
3 m0 G8 L z1 L( m4 ~; { ja A & G1 Y$ x5 ?1 H* p0 @
E:; C+ |/ K5 Q9 C. s( S& s+ M
push eax 7 J* [9 t5 X1 d3 p5 y
call PRT
1 T( M: N* c$ { T, \ pop eax
H4 s1 q( J2 `# i- d- i( T( E7 iCExit:
2 d. ~2 b% ?) v% s' w ret/ R# D' q4 `4 R1 }3 g3 X, B
Change endp8 \; ` c; R9 Y/ k$ t
;------------------------------------------------------------------------------------------------
# I4 P* F9 b9 \0 ?7 ZPRT proc near
2 L! {8 H! [+ B+ P mov ah,02h% _& o5 o9 J. P# ^5 k
int 21h
8 W: K Z# q" H0 W ret
" o) ?7 _! i3 W2 s. x9 k1 xPRT endp& v1 l) z1 D- [1 ^$ s: Z+ W
;------------------------------------------------------------------------------------------------
4 G3 y9 J! d* T5 d$ ccrlf proc near
1 s$ T$ L2 l% `& P4 ^ mov ah,02h/ W0 c! v& m& h; O9 Q6 q5 |
mov dl,0dh$ o$ M& Z" e/ r( H' U
int 21h5 z- |. V7 F+ z+ p) z% J
mov ah,02h
7 l/ D- G5 k: B+ o. p) T( n mov dl,0ah
B# M# T' _6 z n7 S- V int 21h
) R; V# l" h! e ret) x! n9 H$ _6 ]( h6 C G$ z6 e
crlf endp8 V s8 e) S, L( ^4 [; u
;------------------------------------------------------------------------------------------------. E9 o) f) z3 I6 P
_32bits proc near
0 C! o6 d' n( _& e pushad
- P4 g3 r- }/ R7 I: e4 }' C/ A mov cl,4
7 C8 h1 C1 O4 \0 ?; E( W) {% G rol ebx,cl6 F' ^; T, o u! @- G! C$ f. L
call print_4_bits
W# }9 v4 n' S$ @ rol ebx,cl
3 ~9 Y3 ~9 D5 x( L call print_4_bits8 `9 g3 O0 u0 l8 e
rol ebx,cl
]2 r3 x6 r3 h3 T3 L }$ P) Y call print_4_bits0 O$ a+ O# j& ]" i
rol ebx,cl y1 D, @- H8 Q u) Y
call print_4_bits9 O8 e7 l) I! g2 v
rol ebx,cl
% B9 j1 @/ g3 m/ [% ^# E call print_4_bits
$ q8 |* O/ f/ `$ h rol ebx,cl7 V$ P* k6 m6 w5 J. z! Q+ r
call print_4_bits9 E& C- b% r. r
rol ebx,cl, R/ P3 F" Z. |3 ?! A* b
call print_4_bits8 s( ]+ M& v( o
rol ebx,cl! N; g" y, J2 c) |3 z' w. W/ z
call print_4_bits) h7 k0 y& {" E* o2 X4 w
rol ebx,cl# r8 n5 V% Z* t6 A$ {
popad) I9 U' h3 r# h) d) Y0 a. O/ S
ret
2 N; a$ b# u4 H. b, ~_32bits endp
/ f- o$ R5 m& X! G6 s;------------------------------------------------------------------------------------------------
+ Y( x) m+ ?6 ?7 r7 ^+ ?_16bits proc near
* h" P. q' r$ ` pusha , x% K3 N8 I" H) y+ t' C, c
rol bx,cl
+ V7 v# p: V) f8 {9 ] call print_4_bits
" J4 S' e! _$ A6 E G% [& R rol bx,cl
+ K9 p5 g/ C* A+ _% u call print_4_bits6 _! o& t- e3 V4 H" V
rol bx,cl
; \+ |- H1 J+ t* Y call print_4_bits# C; {4 X# }. ?9 X$ u
rol bx,cl
7 L8 L+ D* B! j8 z call print_4_bits* |4 |+ v/ y- E( c
popa
2 r! E, [2 D7 u ret3 i7 K8 M- c$ V. t- R
_16bits endp' `0 l4 X9 ^7 J& F+ N" ?1 @) f
;------------------------------------------------------------------------------------------------
3 c/ K. g. T2 d1 {' X! s8 C_8bits proc near
. d$ n* Y$ |8 O' o! Q7 u4 N7 Z: P pusha
, w) C" v) o+ F! h/ h rol bx,cl
" {2 D' p- [% Z2 J4 [" Z call print_4_bits5 w8 u; O& ^. P+ x7 T5 [# z) F
rol bx,cl
6 i0 w* j. x( j8 |3 c& v call print_4_bits6 c3 p$ U4 J7 r, s/ v& m, W
popa
8 [+ O m; O" W5 \3 s ret
$ }$ o. r5 Z+ f+ T+ |( ~_8bits endp
. q5 D" m# N( P8 Q- C1 lprint_4_bits proc near7 y7 ~' |3 n! h7 P
mov dx,bx3 K* g" j+ O. O4 o( t, H
and dl,0fh7 N# e( S/ i" a- O
add dl,30h
N% P B0 @1 D8 J { ]. w4 R cmp dl,3ah+ M; `5 |; Q+ X, s8 ^. N
jb print) H4 l- k' {. m, g9 z( |
add dl,7) [. ^6 b. O! H
print: " `. O. S/ [! U2 T( I' f8 }
mov ah,25 _! J& D6 a' I. f, o+ \3 A
int 21h% b, C* V+ M) g' l, r
ret
8 D; o0 u0 ~) qprint_4_bits endp & N g3 Q; m! w) D
CSEG ends
4 W) f J0 o9 p2 t1 @9 TEND |
|