Test06_ans - Microprocessor & Assembly Language Programming...

This preview shows page 1 - 2 out of 4 pages.

The preview shows page 1 - 2 out of 4 pages.
Microprocessor & Assembly Language Programming (EE3120)Test 2006 - AnswerAnswer1(a)(i)ForMOVCthe source address is the internal ROM location and is code memory readonly.Examples.For the MOVC A, @A + PC, the source address is the internal ROM locationwhose address iscalculated by adding the contents of the Accumulator to the contents of thePC.[4 marks]The MOVC A, @A + DPTR uses the contents of DPTR to calculate the source address.The external memory can be as large as 64k bytes for both RAM and ROM memory areas. The datatransfer instructions MOVX that move data to/from external memory use Indirect addressing tospecify external address. MOVX instruction is used in this case, for exampleMOVXA,@R0MOVX @DPTR,A[4 marks](ii)ORG 0HMOV DPTR,#30hMOV A,#0MOVCA,@A+DPTR; access ROM location at 30HMOV A,#0MOV A,@A,DPTR; access RAM location at 30HEND[10 marks](b)org0000hmovdptr,#cityu ; load rom pointermovr1,#30h; load ram pointernext:clra;a =0movca,@a+dptr ;move data from code spacejznull;exit if null charmov@r1,a;save it in ramincdptr;increment rom pointerincr1;increment ram pointersjmpnext;loop

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 4 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
cheung
Tags
Assembly Language, Microprocessor, Byte, PIC Microcontroller, mov

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture