SS UNIT 2 notes.pdf | Assembly Language

Please download to get full document.

View again

of 22
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Documents

Published:

Views: 4 | Pages: 22

Extension: PDF | Download: 0

Share
Related documents
Description
CS 2304 SYSTEM SOFTWARE G.PRABHAKARAN – AP/CSE S.SELVARANI – AP/CSE UNIT II ASSEMBLERS  Basic assembler functions  A simple SIC assembler  Assembler algorithm and data structures  Machine dependent assembler features  Instruction form
Transcript
  CS 2304 SYSTEM SOFTWAREG.PRABHAKARAN – AP/CSES.SELVARANI – AP/CSE  UNIT II ASSEMBLERS    Basi ass! #$!% &'()i*(s  A si +$! SIC ass! #$!%  Ass! #$!% a$,*%i)- a( a)a s)%')'%!s  Ma-i(! !+!(!() ass! #$!% &!a)'%!s    I(s)%')i*( &*% a)s a( a%!ssi(, *!s  P%*,%a %!$*a)i*(  Ma-i(! i(!+!(!() ass! #$!% &!a)'%!s  Li)!%a$s  S #*$!&i(i(, s)a)! !()s  E1+%!ssi*(s  P%*,%a #$*s  O(! +ass ass! #$!%s a( M'$)i +ass ass! #$!%s  I +$! !()a)i*( !1a +$!s  MASM ass! #$!%. Assemblers 1 :  iT%a(s$a)i*( (! *(i *+!%a)i*( *!s )* )-!i% a-i(! $a(,'a,! !5'i6a$!()s a( assi,(i(, a-i(! a%!ss )* s #*$i $a#!$s 's! # )-! +%*,%a !%. iiT-!%! a%! s* ! &!a)'%!s *& a( ass! #$!% $a(,'a,! )-a) -a6! (* i%!) %!$a)i*( )* a-i(! a%-i)!)'%!. 1. Basic Assembler Functions 2 : STARTS+!i&i (a ! a( s)a%)i(, a%!ss &*% )-! +%*,%a .EN7I(ia)! )-! !( *& )-! s*'%! +%*,%a a( s+!i& )-! &i%s) !1!')a#$! i(s)%')i*( i( )-! +%*,%a .BYTEG!(!%a)! -a%a)!% *% -!1a!i a$ *(s)a()8*'+i(, a( a( #)!s as (!!! )* %!+%!s!() )-! *(s)a().WOR7G!(!%a)! *(!9*% i()!,!% *(s)a().RESBR!s!%6! )-! i(ia)! (' #!% *& #)!s &*% a a)a a%!a.RESWR!s!%6! )-! i(ia)! (' #!% *& 9*%s &*% a a)a a%!a.  2 MARKS1.e!ine assembler.2. #at are t#e basic !unctions in assembler. E$%lain. III CSE:NIT II http://csetube.weebly.com/  h t t p:// c s e t u  b e. t k/  CS 2304 SYSTEM SOFTWAREG.PRABHAKARAN – AP/CSES.SELVARANI – AP/CSE E$am%le:  SIC assa #$!% $a(,'a,! +%*,%a .  T-! +%*,%a *()ai(s a ai( %*')i(! )-a) %!as %!*%s &%* a( i(+') !6i! a( *+i!s )-! )* a( *')+') !6i!.  T-is ai( %*')i(! a$$s s'#%*')i(! R7REC )* %!a a %!*% i()* a #'&&!% a( s'#%*')i(! WRREC )* 9%i)! )-! %!*% &%* )-! #'&&!% )* )-! *')+') !6i!.  Ea- s'#%*')i(! 's) )%a(s&!% )-! %!*% *(! -a%a)!% a) a )i !.  B!a's! )-! *($ i(s)%')i*(s a6ai$a#$! a%! R7 a( W7.  T-! #'&&!% is (!!ssa% #!a's! )-! I/O %a)!s &*% )-! )9* !6i!s8s'- as a is a( a s$*9 +%i()i(, )!% i(a$ a #! 6!% i&&!%!().  T-! !( *& !a- %!*% is a%! 9i)- a ('$$ -a%a)!%.I& a %!*% is $*(,!% )-a( )-! $!(,)- *& )-! #'&&!% 40;< #)!s8*($ )-! &i%s) 40;< #)!s a%! *+i!.  T-! +%*,%a *!s (*) !a$ 9i)- !%%*% %!*6!%.  T-! !( *& )-! &i$! )* #! *+i! is i(ia)! # =!%*$!(,)- %!*%.  W-!( )-! !( *& &i$! is !)!)!8)-! +%*,%a 9%i)!s EOF *( )-! *')+') !6i! a( )!% i(a)!s # !1!')i(, RS:B i(s)%')i*(.  T-is +%*,%a 9as a$$! # )-! *+!%a)i(, ss)! 'si(, a >S:B i(s)%')i*(8T-'s )-! RS:B 9i$$ %!)'%( *()%*$ )* )-! *+!%a)i(, ss)! . PROGRAM E?PLANATIONLINELOCCTRLABELSO:RCE STATEMENTOPCO7EOPERAN7@COPYSTART000COPY FILE FROM I/P TO O/P0FIRSTSTLRETA7RSAVE RET:RN A77RESS@CLOOP>S:BR7RECREA7 I/P RECOR720L7ALENGTHTEST FOR EOFLENGTH02@COMPERO30>EDEN7FILE?IT IF EOF FO:N73@>S:BWRRECWRITE O/P RECOR740>CLOOPLOOP4@EN7FILL7AEOFINSERT EN7 OF FILE MARKER@0STAB:FFER@@L7ATHREESET LENGTH3<0STALENGTHIII CSE:NIT II http://csetube.weebly.com/  h t t p:// c s e t u  b e. t k/  CS 2304 SYSTEM SOFTWAREG.PRABHAKARAN – AP/CSES.SELVARANI – AP/CSE<@>S:BWRRECWRITE EOF0L7LRETA7RGET RET:RN A77RESS@RS:BRET:RN TO CALLER0EOFBYTECEOF@THREEWOR73;0EROWOR7000RETA7RRESW0@LENGTHRESW0B:FFERRESB40;< S:B RO:TINE TO REA7 RECOR7 INTO B:FFER PROGRAM E?PLANATIONLINELOCCTRLABELSO:RCE STATEMENTOPCO7EOPRAN72@R7RECL7?EROCLEAR LOOP CO:NTER30L7AEROCLEAR A TO ERO3@RLOOPT7INP:TTEST I/P 7EVICE40>EDRLOOPLOOP :NTIL REA7Y4@R7INP:TREA7 CHARACTER INTO REGISTER A@0COMPEROTEST FOR EN7 OF RECOR7@@>EDE?ITE?IT LOOP IF EOR<0STCHB:FFER8?STORE CHARACTER IN B:FFER<@TI?MA?LENLOOP :NLESS MA? LENGTH HAS BEEN REACHE70>LTRLOOP@E?ITST?LENGTHSAVE RECOR7 LENGTH0RS:BRET:RN TO CALLER@INP:TBYTE?FCO7E FOR I/P 7EVICE;0MA?LENWOR740;< S:BRO:TINE TO WRITE RECOR7 FROM B:FFERIII CSE:NIT II http://csetube.weebly.com/  h t t p:// c s e t u  b e. t k/  CS 2304 SYSTEM SOFTWAREG.PRABHAKARAN – AP/CSES.SELVARANI – AP/CSE PROGRAM E?PLANATIONLINELOCCTRLABELSO:RCE STATEMENTOPCO7EOPERAN7200WRRECL7?EROCLEAR LOOP CO:NTER20WLOOPT7O:TP:TTEST O:TP:T 7EVICE2@>EDWLOOPLOOP :NTIL REA7Y220L7CHB:FFER8?GET CHARACTER FROM B:FFER22@W7O:TP:TWRITE CHARACTER230TI?LENGTHLOOP :NTIL ALL CHARACTERS HAVE BEEN WRITTEN23@RS:BRET:RN TO CALLER240O:TP:TBYTE?0@CO7E FOR O/P 7EVICE24@EN7FIRST 2. A Sim%le SI& Assembler:    C*(6!%)  (! *(i *+!%a)i*( *!s )* )-!i% a-i(! $a(,'a,! !5'i6a$!()s.!1a $+!)%a(s$a)! STL )* 4  C*(6!%) s #*$i *+!%a(s )* )-!i% !5'i6a$!() a-i(! a%!ss!s.!1a +$!)%a(s$a)! RETA7R )* 033  B'i$ )-! a-i(! i(s)%')i*(s i( )-! +%*+!% &*% a).  C*(6!%) )-! a)a *(s)a()s s+!i&i! i( )-! s*'%! +%*,%a i()* )-!i% i()!%(a$ a-i(! %!+%!s!()a)i*(s!1a +$!EOF )* 4@4&4<  W%i)! )-! *#!) +%*,%a a( )-! ass! #$!%. C*(si!% )-! s)a)! !()8 0 000 FIRST STL RETA7R  T* )%a(s$a)! )-! +%*,%a $i(! # $i(!89! 9i$$ #! '(a#$! )* +%*!ss )-is s)a)! !() #!a's! 9! * (*) (*9 )-! a%!ss )-a) 9i$$ #! assi,(! )* RETA7R.  B!a's! *& )-is8 *s) *& ass! #$!%s a! )9* +ass!s *6!% )-! s*'%! +%*,%a .  T-! &i%s) +ass *!s $i))$! *%! )-a( sa( )-! s*'%! +%*,%a &*% $a#!$ !&i(i)i*(s a( assi,( a%!ss!s.  T-! s!*( +ass +!%&*% s *s) *& )-! a)'a$ )%a(s$a)i*( +%!6i*'s$ !s%i#!.  I( ai)i*(8)* )%a(s$a)i(, )-! i(s)%')i*(s *& )-! s*'%! +%*,%a 8 )-! ass! #$!% 's) +%*!ss s)a)! !()s a$$! ass! #$!% i%!)i6!s *% +s!'*i(s)%')i*(s.  T-!s! s)a)! !()s a%! (*) )%a(s$a)! i()* a-i(! i(s)%')i*(s.I(s)!a8)-! +%*6i! i(s)%')i*(s )* )-! ass! #$!% i)s!$&.!1a +$!BYTE8WOR7  I( *'% !1a +$! +%*,%a  STARTS+!i&i!s )-! s)a%)i(, ! *% a%!ss &*% )-! *#!) +%*,%a . EN7S+!i&i !( *& )-! +%*,%a .  Fi(a$$8)-! ass! #$!% 's) 9%i)! ,!(!%a)! *#!) *! *()* s* ! *')+') !6i!.III CSE:NIT II http://csetube.weebly.com/  h t t p:// c s e t u  b e. t k/
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks