Lab report For Dosbox

profileahmadqt
lab5.pdf

Scanned by CamScanner

C M ET 4 1 6 - Fa li 2 0 1 7 @ T S U

IN T 2 1H

/ M O V D X , O F F S E T C o m p l e t e d

M O V A H , 0 9 H ; D i s p l a y s t h e m e s s a g e s t o r e d i n t h e d e f i n e d b

y t e

"

C o m p

l e t e d

"/ D is p M s g ; LF B X

= 1 0 0 , y

o u J E h e r e .

/ JM p S k ip M s g ; J u m p to th e S k ip M s g ıa b e l W o u d o n

'

t s e e t h e

"

c o n g

r a t u l a t i o n s p m e s s a g e ).

/ ; JE w iıı J u m p y o u to D is p M s g (to g e t

"

. . . c o n g ra tu la tio n s ! "

m e s s a g e ).

◆ N ― ― J E D i s p M s g ; J u m p - if- E q u a ı. . . C M P B X , 1 0 0 s e t s f ıa g s , a n d i f t h e y a r e S

J- p f Ąo D / E M P B X , 1 0 0 ; C o m p a r e B X t o 1 0 0 . . .

L O O P S ta r tL o o p ; G o b a c k to S ta r tL o o p la b

é l

/ IN C B X ; T h is d o e s B X + + , w h ic h in c r e m e n ts B X b y 1

S p ; w n e n a ıo o p sta r ts , i t d o e s c X - (s u b tr a c ts 1 fr o m c X )

M O V B X , O ; C o u n t e r (fo r d o u b le -

v e r ifıc a tio n )

/ M O V C 兀 10 0 ; S e t C X to 1 0 0

/ M O V D S , A X / M O V A X , d a t a ; R e q u

i r e d a t t h e s t a r t o f e v e r y p

r o g

r a m (in s id e y o u r m a in p r o c e d tıre )

M A IN P R O C

·C O D E

C o u n te rc o n t D B 1 0 , 1 3 , '

r h e c u r r e n t v a l u e i n t h e c o u n t e r r e g

i s t e r C X i s : $ '

, I 0 , 1 3

C o m p ıe te d D B I 0 , 1 3 , L o o p × 1 0 0 c o m p ıe t e d . C o n \ tu ıa tio n s fo r j o b d o n e ! , I 0 , 1 3

/ . D A T A

/ · ST A C K 10 0 h

M O D E L S M A L L tl

'

; T ııis c o d e w iıı lo o p fro m I to 1 0 0

l). S tu d y a n d M )e th e c o d e b e lo w is a n E d ito r th e n c o m p ile a n d e x c o d e ,

L a b lmL a b lm « E« E m b llv C o d e fo r ıro o D ın ı

C M E T 4 16 1 A p p ılc a t io n o f M ıc r o c o m p u te r S o l t w a r e ıra b o r a to r y

D e p a r t m e n t o f E n g ıııe e r ıııs (E le c t r lc a ı & C o m p

u te r ) T e x a s S o u t h e r ıı U n ıv e r s ıty

Scanned by CamScanner

C M ET 4 1 6 _ Fa ll 2 0 1 7 @ T S U

>TSW1ı ć w t < tţ ì

2 ). S u b m it a c o m p r e h e n s iv e ıa b re p o r t

E N D M A IN

/ M A IN E M ) P

IN T 2 ıH

M O V A H , 4 C H

M O V A L , O h ; O p e r a t i o n a ı c o d e t o e x it t o D O S f r o m t h e a s s e m b ıe r .

( S k ip M s g ;

IF B X ! = 1 0 0 , y o u J M P h e r e .

ıN T 2 IH

M O V A H , 0 2 H ; D i s p ıa y s t h e c u r r e n t v a l u e i n r e g

i s t e r C X

A D D D X , ' 0

'

M o v D x , c x

; c o n v e r t c u m n t v a l u e i n c x t o

c h a r a c t e r b y a d d in

吕 A s c ıI c h a r a c t e r o

f n T 2 I H

M O V D X , O F F S E T C o u n t e r c o n t

M O V A h 09H ; D is p la y s t h e m e s s a g e s to

n d in th e d e fin e d b y ıe "

C o u n t e r c o n t

"