|
|
各位前輩好,以下的程式為在 big_real_mode 讀取記憶體的值,例如: C:\memory.exe(程式檔名) 01000100(Address)
& }9 Q/ l7 R' Q% d+ P
0 f; Z) i" s- K& X4 q( f! Q則會顯示01000100位置的值,但是我另外在DSEG SEGMENT USE16'data'
5 X2 O# H2 S* t: d1 l7 J, a8 m0 q h, C" o$ h2 B) D% d
宣告了Maddress Dword 0,但是程式執行時,會hand住,麻煩前輩給我一些指導,謝謝
; \; F: @ k0 M O
8 O: s3 M3 d2 k' `7 n/ n.model small% ^/ E2 G2 u, m0 `4 M
.386p
) U' g; j/ i1 u6 ~9 T4 ]. p1 [DSEG SEGMENT USE16'data'
* u5 b4 f9 D" q: J
% w) X0 j ?2 pDESC STRUC. Q8 h6 F+ Z# x
LimitL DW 0 3 x% t- O! ~) Q0 H
BaseL DW 0 1 l" `; d$ N& a: k3 x- O
BaseM DB 0 7 |& `# a4 g# e) a
Attributes DB 0
% K8 k @' h: H' R* [ w7 S# ~ LimitH DB 0 / r( J. h$ u5 a
BaseH DB 0
) _0 y" N' G- v* UDESC ENDS$ q. E. s* g+ k7 [! o
" r. R- k$ f" x d$ y: @' sPDesc STRUC) `8 Z- b$ g" p% R1 b
Limit DW 0 / p8 C% X; F7 W2 i! e
Base DD 0
: G5 ], Q* a2 i$ s8 JPDesc ENDS
* N' @( J9 _- R3 Z1 D P i2 }$ W" v# N6 R* X1 D2 P7 f
GDT_def Label Fword! p# f8 b$ s' A1 y
Null_Desc DESC < 0h, 0h, 00h, 00h, 000h, 0>1 h2 M$ s$ F4 G' H: f
Data_Desc DESC < 0FFFFh, 0h, 00h, 92h, 0CFh, 0>
8 L) Z7 j- @: w7 |1 o4 IGDT_Addr PDesc <$-GDT_def-1, >. v& _! ~7 M4 c! s3 R% i* E* {( L" c
! B) b- C/ a& C- U
Maddress Dword 09 x. O; W" S& d- H$ C5 i) t
$ n: h) H3 j y( V8 h: G6 dDSEG ENDS
0 w; H* r! x: P" a. H" \/ zASSUME CS:CSEG,DS:DSEG: p4 I' s) n% F& l8 I7 ~, O
1 \; E2 z: I4 _" M- M8 k* wCSEG SEGMENT USE16'code'
0 @' s9 E+ q. B6 l | push ds
: ?# k, [" H5 c' i) |* V push es: H; q' ] P \1 }3 B
push fs `; ?2 {+ ]1 @4 \
push gs
- r- }! \- z! t# g; j8 G8 N) Z. A call big_real_mode # _5 A2 k. Q C- b% h
call Get_Commandtail' a! X3 w9 Q- H0 S/ j5 Z
xor ebx,ebx; M% |+ u& Y' `$ \' P) ^5 J3 v- L' D
mov si,82h
+ K# _% Q9 [6 C# w/ b1 W mov al,es:[si]
' t- `- t' Y8 K+ D# u5 C) _4 Q9 a cmp al,'r'
; e+ [" X) M" z+ k je R
4 v: G1 E& R p' g% r h$ l cmp al,'R'
( @- {% h; s3 b7 z5 u3 D je R5 \/ @7 W2 v4 W1 ]5 n
cmp al,'w'. ~! e) K$ L2 z* P
je W
9 O& y: |$ X2 T: W& i% W) a cmp al,'W'
8 l1 [5 j$ e* \! Y: \. y1 R je W
( q) \3 G9 f4 i8 [8 aR:% z$ _( D0 S; y6 Y; [ J* s
mov si,84h8 k4 p N/ c: u" \9 b
mov al,es:[si]& S& K! V, ]! X7 h, z5 ^
cmp al,'b'
9 k3 y4 v/ Q2 [5 j$ z je RBT
1 P# d1 X6 a# C( | cmp al,'B'
+ B+ _6 C! m( U' u/ x/ Q je RBT/ \! k3 V; k: Z1 |2 U
cmp al,'w'
- \4 _3 w- D9 ?$ n2 Q0 n2 U je RWR0 T' S, U* E& a5 R" a9 R
cmp al,'W'
# C& ~3 j+ t {' M je RWR
7 z6 p" X; w& W' L cmp al,'d'
* @+ K. w* e+ A; N0 E je RDR
% k2 Y" |# W( b8 U- _$ i' ` cmp al,'D'
8 U2 M- T. @2 l" C6 T je RDR
0 g2 m2 `7 s3 I; _/ AW:
0 t; \- M* H- {$ F7 S1 s3 a. L mov si,84h
: d9 y( K* x1 _% Y1 B7 X/ P mov al,es:[si], `% m4 ?$ ]$ w2 O
cmp al,'b'6 w. u% B! N" A( V8 x
je WBT
- T& N) T; _/ O2 p cmp al,'B'
& C# h( M& G) ?6 w/ z' _. n je WBT
; p& M, _6 H! ^! p5 a cmp al,'w'# E; x4 W! l7 H- C
je WWR
B: X0 Z3 C2 ~ cmp al,'W'8 s. W& s' n. q1 M$ c! `8 N+ k
je WWR4 I" C- x' G* ]4 B) Z' |
cmp al,'d'8 x' d7 H) I7 v( U! n9 L
je WDR
/ R/ P) n8 E& ~2 T+ Y8 x cmp al,'D'
5 G; w7 Y) \( F6 [! _0 c je WDR
0 z! u- Q! `1 M" U! {. p5 wRBT:
! Q1 q: G6 F7 o call PSP
. m! a, g# a: e, S8 N3 G; S call crlf ) \* X2 @+ m# T+ V4 h( ~
mov esi,ebx
" g) O6 I& R, e7 o6 D mov eax,fs:[esi]4 {$ j4 t( I/ K8 K7 F
out 80h,eax( A" U$ B4 G$ W) R# ^( _# F: r
mov ebx,eax% Y9 u( e( {& |0 N: Q6 i
call _8bits
! v, ]9 I# t/ I1 z! M jmp Exit
g" D# s. e5 ]. y7 D) kRWR:
7 ~' ~- O, {% r1 ? call PSP
9 d U, b4 I9 L$ D call crlf
& Y' K0 V6 I) z3 L( B( ]7 | mov esi,ebx
. j$ s2 @+ H& }9 Z) k$ F mov eax,fs:[esi]1 ~' r/ \. |. a5 i P
out 80h,eax
' R3 a2 ?1 O9 n7 E2 M. \- t mov ebx,eax" o9 F5 N( T/ B8 U
call _16bits% Z U$ B G" r7 v. g$ b$ K$ @
jmp Exit
( u3 L8 f! I! [( P6 ]9 aRDR:
" G$ W- N( a8 C6 c7 x& q5 y I call DPSP
7 _; c3 z7 G& \3 e' A, S call crlf % [5 O# _4 b) J! H ^* g" a
mov esi,ebx
% `' p' J6 a. j, o% M$ K mov eax,fs:[esi]4 ~* m* W6 b% V, f
out 80h,eax* g" o! n7 `1 V A3 G
mov ebx,eax
5 i- I' _ K4 {/ V3 y& r call _32bits
, x! K d+ s0 h' }7 ^ jmp Exit( c* ]5 x, F: K% c# l& G* B
;------------------------------------------------------------------------------------------------0 [' r! _( Z1 c
WBT:
6 R9 T/ f4 D* x$ I5 |' h jmp Exit7 P) ]! y C( A$ [! [4 W
WWR:
# ?; w; V8 c& H. N* N& A jmp Exit
4 @" U, ]' Y8 Q1 t& F# z% VWDR:+ g! a/ W! F0 B) P% [8 A
call DPSP2 S9 [- ?6 E5 w) V- N( H
mov Maddress,ebx
& Y' {: `: r \" l call crlf) _/ \7 r( K1 i- ]! h
call WDPSP
2 N' Y) t# l7 b mov eax,ebx G; a. p6 t7 Y; A6 o
mov esi,Maddress
7 R T+ x/ V- @ mov fs:[esi],eax+ r. O3 @8 a" T( a& }
out 80h,eax
- E7 T% b9 E$ z4 d! |$ \# q/ z jmp Exit/ C! S4 I& [/ G$ D
;------------------------------------------------------------------------------------------------ ) b0 z4 h9 m- N
Exit: Z- Z! V2 [5 _+ y/ }$ H% r
call real_mode ( w% P5 U- a, y; O7 g$ E- `! E4 O8 I
pop gs
$ G7 \) `2 z5 w# V5 Q' \# ^% | pop fs; g% {8 @ N4 F# h
pop es1 t0 s5 j W1 e0 c" O$ q) {
pop ds " a5 v, M- W$ l) Y3 E2 ~
.exit Y/ X+ J% n6 x* { f
;------------------------------------------------------------------------------------------------
4 [8 f0 B3 Q2 [: v3 ^, ubig_real_mode proc near
( {/ t2 B8 g% j/ k+ l8 w in al, 92h
: {5 ~: o" M7 S9 A or al, 002
. v U8 t& _% p; b/ W out 092h, al V) N; O" }6 o, {2 _) f
out 0edh, al
! n2 C+ G& F* ~) C9 B5 n cli- H, H* F; W! B& o1 I( |( E
mov eax,DSEG; n4 K: K N+ A, e
shl eax, 40 |9 J% p2 l7 f1 V/ C7 }5 G
xor ebx, ebx6 W& M0 V# c+ k$ h# r) v# K
mov ebx, offset GDT_def" l P4 q0 u- J; V4 r g
add eax, ebx
& S$ x2 J: }8 G% R/ K5 Z3 j }% P mov dword ptr GDT_Addr.Base, eax
2 [$ c8 l9 U" k4 h/ C } lgdt fword ptr GDT_Addr
4 T; a' \. Z7 S2 P& v) d- n mov bx, 8
) }% r5 R4 u; X9 c$ w' `$ W6 v) X! { mov eax, cr0
) c. Z9 Y5 }2 i2 B: [! P or al, 1
2 ]. m" c- Z8 d6 i1 R5 t mov cr0, eax
/ M6 M- q& n$ _& F# Y# n" f$ b- S jmp PMod
; i) M! @8 b+ C* G. `9 a, j, E8 cPMod:
3 n1 d b7 e/ W4 Y mov fs, bx7 @$ s+ {: L+ V h
mov gs, bx
* o) }* T/ n' r' V mov eax,cr0
0 i1 K- j; s7 ?2 R0 M. M Y and al, 0FEh
" j$ Q3 _) ?, S; O; r* L5 J mov cr0, eax 5 H: C4 H" H) q
jmp RMod$ @. o- C+ N: {( |
RMod:& C& V, ]6 T4 e/ Z- Y X
xor ax, ax
# R- M( u* N" E$ _& T mov fs, ax, l- Q- t; L t$ f t
mov gs, ax
3 m* s- L g! i5 \% R/ v! S sti
( N2 h- d3 J, I b+ v( h ret) \* ]& V/ `" e: I: z* f
big_real_mode ENDP2 `7 x2 t) R9 b {
;------------------------------------------------------------------------------------------------( N# V7 s' ]' ]
real_mode proc near% Q3 \ p3 O2 g3 X8 V; t
in al, 92h
: J. o p6 ~ F' @* O* F. \% b% B and al, 02/ _! d5 ~7 X0 B
out 92h, al
# l4 v/ s0 O9 `1 G& @) @/ F ret
+ G# e6 k# j- @( U" E' sreal_mode ENDP
9 o$ o$ U" _/ H( O7 j/ |3 s2 f( v;------------------------------------------------------------------------------------------------4 _2 n( {! E# e! {' I1 e
Get_Commandtail PROC near
b' o- S5 c5 }7 v; d mov ah,62h 6 @ l7 Y8 \* |& F& ?
int 21h3 u, X$ r- ?0 E3 {0 k- ~6 }. z
mov es,bx1 Z5 ]3 {0 K) l0 C5 L- s6 n$ D
ret
) w: p& O6 M$ D! D1 Y+ J1 h. E4 u2 HGet_Commandtail ENDP 8 r! y G: q# l5 H8 A! C
;------------------------------------------------------------------------------------------------
" {8 l* y! m7 U" gPSP proc near
: k9 F9 f7 ]) P; W6 J7 s0 M xor ebx,ebx
! a3 z- z% W) \+ \2 R mov si,89h
; @9 j! a. N. A: { mov al,es:[si]( _2 \9 n; L& L/ ~
call Change
l( `0 W) ?' I$ D mov cl,4) j( k' K: s+ T) E
shl ebx,cl
' g4 L9 L. D, P" ^ add ebx,eax+ ^0 a2 n. o6 y7 S6 g, a, o
mov al,es:[si+1]
: C! [8 X9 O5 {& I8 \ call Change
j0 l# u) t7 e" _$ Z" [6 w mov cl,45 a+ k) D. [2 L( p1 C P1 E
shl ebx,cl: p8 t+ s5 m G3 t
add ebx,eax
" I$ L9 c l( c! M mov al,es:[si+2]! d% ]' _* G- x- R0 D+ ?+ A2 w1 r6 [
call Change8 q3 g B7 H* C
mov cl,4
$ |5 F0 r4 b* v- Q shl ebx,cl
; V$ o- X2 b0 r/ m2 s add ebx,eax P6 |5 J+ R9 p% x' B
mov al,es:[si+3]
! g2 Q, n9 U8 o, D8 c call Change8 j: H: A( X4 Z# l" ^. @( Y
mov cl,4% ?$ E Y0 M6 Q8 C S6 e ~, D
shl ebx,cl
; ^3 M6 b) H( x add ebx,eax3 o" F8 @9 i3 v9 p. A
mov al,es:[si+4]% W5 H+ |9 n, A- a8 n
call Change$ m9 Q5 I) M! J
mov cl,4
; | Y8 T- D2 R2 d4 _) X; p- e shl ebx,cl
% X' a8 O4 T- Q+ | add ebx,eax1 U' u7 B7 \' x
mov al,es:[si+5]
, L: Q7 m6 k! ?% J call Change8 q/ Y# R# P+ W5 s0 H
mov cl,4
H4 P# z* F% w0 L @& Y* {8 x shl ebx,cl
% d7 r7 [8 S0 L$ x o add ebx,eax
j) `- }4 @% R; V: Q# _ mov al,es:[si+6] T' R% P* s. X3 r b. M
call Change4 C* s( H- K o' O1 y
mov cl,4" M& g" f/ `% c [
shl ebx,cl
q+ U+ a( P8 } l add ebx,eax
" J' j1 p& x! g* p8 a c7 L mov al,es:[si+7]
7 Y( Y3 F& z$ k, h, [! g; G/ t+ h call Change
3 ]6 B+ n& E% Y0 O mov cl,4 j+ j8 `8 o* r, Y" V, p
shl ebx,cl x5 I7 z: p# c
add ebx,eax
( I6 e q5 X/ h" C1 _" @ ret
4 {! C N* d0 N6 o9 G$ V/ o; xPSP endp) b) I& a/ l4 m7 ?
;================================================================================================
2 ~+ p7 E. _4 ZDPSP proc near5 x6 m z) K1 o" T( r
xor ebx,ebx
: T% K& N/ _0 x$ M: ^. b5 O mov si,8ah
1 r' a" d8 p5 I5 d mov al,es:[si], _, M5 E: [" l6 _0 ]; V& s4 D
call Change6 ]; d6 K' u2 ~' k8 r! h* D
mov cl,47 U1 q; V: X% p9 \
shl ebx,cl |3 }# a7 f) i( w7 _9 E) E1 y ]' m
add ebx,eax
4 f3 m) q% o* {) g3 J% C+ c6 T mov al,es:[si+1]
& l8 @, B' l2 r9 W9 G i call Change+ Z3 y! Y# Y1 M( ~
mov cl,4" T! R6 k* I. A7 s! H' G
shl ebx,cl9 ^) B' H6 k& g w' `- i- C
add ebx,eax
5 _9 x8 [" F! h4 k' [ mov al,es:[si+2]0 m& X1 M7 V: Q$ v
call Change
8 I8 r0 P' c: M8 ^$ Z7 J3 w mov cl,4. f5 ~! s" d$ f# U' w3 P
shl ebx,cl' q- G$ Q. G- [" t( N* V; g
add ebx,eax" H: ]$ R z! }( b1 f+ r
mov al,es:[si+3]. _3 J, r B2 Z/ y- c: g
call Change! V. S! W+ W3 l
mov cl,4; U7 i+ Z- d( r5 Y3 @9 ]0 e
shl ebx,cl
! s+ ~% Q: N9 I* ~/ Z( I0 g- ~' C add ebx,eax
$ m4 u) j, M% y mov al,es:[si+4]
: \& I' @7 \ U! f call Change
: L4 Y9 r2 |# h mov cl,49 d: c. Z" t2 k8 A) x
shl ebx,cl
3 f1 u& w+ M5 M; O! N% C/ S add ebx,eax
8 z2 v* t/ Y& ? {% {- T mov al,es:[si+5]
" A, g* }. Q: n+ R+ C- m call Change/ W$ G' K" L1 L
mov cl,4
& k0 P5 L3 J6 J8 ` shl ebx,cl
$ s6 F3 H% y# T$ ?4 {+ ~" E add ebx,eax
; U- G$ p/ _. c( f% Y mov al,es:[si+6]
, ~, s( d9 Y4 k: p call Change3 O/ U9 D$ T6 @- T7 ?
mov cl,4. q! F M( V( f* o/ l
shl ebx,cl
" ?8 L1 ~4 y3 v) P- Y/ [4 A z3 K# v add ebx,eax
0 q' j, W6 r7 b$ ]6 L, K6 s8 J mov al,es:[si+7]3 Q+ Z3 f. b2 }
call Change
, Z9 h6 n5 c+ ?) J/ Q- k; I mov cl,43 u' W/ m8 R) t
shl ebx,cl7 _+ i7 @0 l3 c: V7 R
add ebx,eax- |- r: I/ j4 y" v0 u7 K/ C
ret9 a' [; n8 @# U
DPSP endp
% O3 u& @: T0 ~* Q;================================================================================================
+ A6 C& f C+ S. W9 WWDPSP proc near
: ^( h x5 a- n5 _8 [ xor eax,eax; G! p8 {2 h# |$ K9 N+ @9 T8 b
xor ebx,ebx9 ]8 A5 @6 N" f3 k
mov si,93h
" t) A# U" G. Y* s mov al,es:[si]1 B9 B1 t6 x9 R, }% ?3 \5 ?
call Change0 M9 G4 s) z6 d5 d1 r w
mov cl,4
4 i6 i% U$ T: D: S9 _! T7 @2 c shl ebx,cl6 S$ {; I: V: C3 J0 m# M" F
add ebx,eax
2 |$ f7 T9 i: w0 A mov al,es:[si+1]1 _0 r7 Q; ]7 [
call Change
/ ]. w0 I8 [; J5 j& E" j mov cl,4
4 x+ c; f$ }( t, ^/ g$ p" ~, F shl ebx,cl
" G* Y6 [( o4 T: H add ebx,eax
$ B& q2 y7 c( S. Z% X- ` mov al,es:[si+2]$ p2 ]$ d3 F6 b1 y
call Change' W0 g2 j$ U Y1 K
mov cl,4
0 S& U- g2 I% h$ t& @3 l) M shl ebx,cl
2 m' ^2 g o: c add ebx,eax
: Z+ V9 w+ J. C8 F q mov al,es:[si+3]0 z' o+ @: }2 m" s
call Change0 p, m* r* c3 r: j1 r- n
mov cl,4
' N) q# Q) Y4 t" d0 ~" A; h. R shl ebx,cl
7 u: U: T# m# i/ d add ebx,eax
' I# k1 w' S" {) Q: p* \' P+ b mov al,es:[si+4]6 f. Q" p1 g: F
call Change
' Q# {* u1 i* P! X mov cl,4
5 Q- v. M) i4 u8 }% ]. S/ T; v& R shl ebx,cl F: K! f+ {( V! S; Z
add ebx,eax4 ]4 h, ^5 i' _, L- }0 U- K) p
mov al,es:[si+5]
+ \6 B& B ^( G5 E, r6 k; i call Change1 f6 c6 i& d& E8 K2 r
mov cl,4
2 D; o6 M- l) w# o3 ` shl ebx,cl
& u' c" j, N% X5 `: n add ebx,eax6 u8 l2 T9 E$ Z, `
mov al,es:[si+6]
7 N3 {$ ^, s9 |" i) S* p4 U call Change
! r% l; x4 i& i" D$ P+ `" I! y mov cl,4- Q8 p( A$ w/ l" Q& T$ G
shl ebx,cl
$ z6 z2 m) l( Q* v% h add ebx,eax
* q! {" j5 u+ }/ o7 n1 Z mov al,es:[si+7] _( O1 n6 r R
call Change
7 `1 T- r7 t4 X0 S" `) g mov cl,4# X0 }* I8 |; i/ M) z1 I
shl ebx,cl
! s4 W4 F1 L/ w. a1 N! r add ebx,eax
: R0 c2 N; X7 b8 N e6 H' [ ret
: Z q( \; r! ^4 A3 RWDPSP endp& ^! r$ s4 {2 [9 e5 z1 |
;================================================================================================, z/ @! ?1 N7 [
Change proc near m) k( _2 u' \1 u" M, h4 U3 L
A: 2 `0 Z' A1 d4 }( I- ~$ M) ^7 b
movzx eax,al# h1 L9 V; a) Y- N
mov edx,eax
8 Z# [1 ]4 j8 M9 V cmp eax,'0'
; ?' O! E# ^" i4 A) y$ B jb A
& V/ C% M' h# k$ u1 {# w. P cmp eax,'9' V! Y) |- z1 u3 P, ^5 t* p5 E
ja B
7 e. ?5 j+ e6 } R/ G5 ]) G sub eax,'0'0 ^ Q0 |5 s {9 z2 c' z
jmp short E
. \1 `" W0 N' n& Q1 A4 fB:! S% n# A l6 N9 M$ w" f' C# D( M
and eax,0dfh 5 T) g; L: q9 J" |" i ]9 @( f
mov edx,eax
7 w( e* t) Q8 n0 D sub eax,37h * G: V1 e1 X# |! |( N% A7 x
cmp eax,0ah
. L$ w8 l( F1 ^: ~8 R2 w- e, h jb A
# Z3 a; o1 @/ b& M, Z; u cmp eax,0fh
, d- l9 h" E' X5 e3 N# o* I ja A / o# l# @- g; l) O& O
E:* z; k6 a+ G3 |6 C1 B
push eax
+ V' n6 T' ], `* E call PRT
( ]" c4 o* C: e) W+ \. j$ h7 f pop eax
8 z6 P8 K8 E" u/ z3 N/ B, x% {CExit:
! f6 E- Q& y# W7 H/ f* s! p ret& I/ }6 W: ?; p( E
Change endp
( T; _. \+ |1 @: B9 i9 U2 P;------------------------------------------------------------------------------------------------" f6 O: e9 }% T; E* c8 a! r: ]
PRT proc near+ `. E/ E: m$ S; i9 f+ C
mov ah,02h
0 C6 n, ?6 R2 H; e2 J* ?$ g int 21h
* m- E: |5 K% u ret! y) M/ J9 O3 G
PRT endp+ T1 z3 Q8 r7 a$ \& L2 P* a9 T
;------------------------------------------------------------------------------------------------
; Z2 W# G9 F3 m, K! X! Ucrlf proc near
) l' T# p& z) p! P3 V8 o9 H( q* F4 Z mov ah,02h
, d2 N2 @3 |& g$ g( i mov dl,0dh
2 J- J1 A- {# q int 21h
: Z7 p& s) X7 ^. C9 W mov ah,02h+ p. |5 a) H) }* z0 E' p4 x# U. H- z
mov dl,0ah4 [/ u# i2 ~$ {2 a o! |& G8 ?
int 21h; E9 _- f! P2 M( {
ret
+ z! l+ a& i& ~$ ucrlf endp4 p$ u' X( F' U5 R. r
;------------------------------------------------------------------------------------------------. {6 S& d3 O$ m+ z& D, N3 ^! L
_32bits proc near
9 \# H) l g5 [2 p, H6 Y pushad" X: Y7 P2 m- R
mov cl,4, }; \ U' k1 Y- x, ]
rol ebx,cl
( I& E; p @$ z/ Q. ~ call print_4_bits
4 Q& q8 ?, M3 g: { rol ebx,cl
3 @( q- b, _; U3 p$ y* e* B8 w call print_4_bits, g, _* N' T; a1 A/ i# z. G6 U
rol ebx,cl
. G2 Q9 G# i" R( U& x) U/ h1 H. { call print_4_bits- J" ?. u3 d1 y/ _4 y+ }- z
rol ebx,cl
4 B" o1 a8 i! Q3 s call print_4_bits
0 D& s9 U# p+ h. p" Z! P$ L rol ebx,cl2 N9 k; _2 Q! ^$ G, X" D. t
call print_4_bits/ R# l: D" \# w/ a% x T& E
rol ebx,cl
8 X r6 N p0 M- o/ J' x0 [ call print_4_bits" e9 l6 f1 C0 k+ R5 d
rol ebx,cl
$ z/ `) G# C+ S: T4 a' E# e call print_4_bits& |+ I4 j k! A( f' c9 N: I9 r, j
rol ebx,cl
$ l" h. I% l# T( a1 b call print_4_bits, C3 U4 ]5 s a- O: [0 M
rol ebx,cl5 t( {, x9 l% J4 n ^1 `, t# D
popad
" G' j3 Y7 c) a3 p ret
+ ]# }0 @1 E& S, y_32bits endp: h) ~- y8 g8 M3 i) i8 i) f+ v
;------------------------------------------------------------------------------------------------
7 C7 [5 M. U; M9 A_16bits proc near9 [0 E/ u6 C) ?8 p
pusha 7 ]& j" e5 X2 F2 c6 ]
rol bx,cl
% D6 ?: N7 j# y+ H7 q: K call print_4_bits; j1 m( b% G% P/ B& e* g+ t
rol bx,cl
, m B( P' l$ H call print_4_bits* }# x$ m- a# C- L
rol bx,cl
' g- f% P: ~1 L* {3 b, o: ^( r call print_4_bits6 Z' q; k( q. ~" `- W' o4 q
rol bx,cl
& n$ y# o$ K4 g+ D9 X4 s4 ?" Y call print_4_bits
7 h" \) W* D# N4 @3 H% J popa
: D1 U& V; I6 [" e- r ret$ o$ G5 [2 M! ]# r
_16bits endp
3 E& t! q9 p% H4 U% T: {;------------------------------------------------------------------------------------------------
. }; R9 r8 A3 ~4 Q; q7 |3 y_8bits proc near
/ p" ^4 F4 z: @! W$ B pusha , M c" `1 y- h2 q2 F
rol bx,cl
% K1 M- e' h3 y# {; n+ W call print_4_bits
0 C( L9 z& X8 K( b: B0 e rol bx,cl
7 w! @( ~0 I+ T# H) u: K5 U- {( k call print_4_bits' H/ N- D B; U* _, }8 o
popa
# T* j6 ?' I+ Q5 V" Y ret' Y# y! g, J7 J" H
_8bits endp8 k( b0 T; i8 R
print_4_bits proc near
" g- h8 m# A% v: y+ W mov dx,bx( g+ A+ Y1 O1 G; }
and dl,0fh
1 \# R* }4 r$ o. Y" n8 D, F add dl,30h
- z9 m( U+ ^# r. U cmp dl,3ah' [( E$ F' ~7 n! O. l
jb print/ o7 \2 A: o+ j+ o/ {9 e% C. \% P C3 A
add dl,78 l0 M+ w6 ?9 p& T& O% u- d4 _
print: 0 ~+ K9 u8 ^0 J2 |2 P. n
mov ah,24 ~9 R- b7 r0 h C
int 21h7 q6 Y# }6 l) U, I e }0 @
ret
" B* v- @5 A9 Y3 ? Lprint_4_bits endp
+ Z8 D- N# P& {# j1 [7 y" WCSEG ends
% @0 X/ ?. n' N: ^1 N9 X/ y% ^END |
|