University of Florida EEL 3701 Dr. Eric M. Schwartz Department of Electrical & Computer EngineeringHOMEWORK 10Page 1/1 Revision 0Note: Late HW is notaccepted! HW is due at the beginningof class. Put your “last name, first name” and the HW number in the top right hand cornerof the first page of allHW assignments. Stapleyour pages together. Do notput your social security number or your UF ID number on your HW. 1.List all the addressing modes for the G-CPU and provide short examples of code for each addressing mode. 2.a) Hand-assemble the following code. Briefly explain (but in detail) the function of this code. ORG $0 ; assembler directive (origin) to tell where code will be placed in memory LDX #$1100 ; pointer to data LDAA #$10 ; counter value STAA $1200 ; counter will be saved in memory to free up a CPU register LOOP: LDAA 0,X ; get 1stdata value LDAB $10,X ; get 2nddata value SUM_AB ; data1 + data2 SHFB_R ; divide sum by 2 STAB $20,X ; store average. value INX ; increment pointer LDAB #$FF ; -1 in 2’s complement format LDAA $1200
This is the end of the preview.
access the rest of the document.
Central processing unit, Machine code, Given name, Addressing mode, counter value, Dr. Eric M. Schwartz