My Book" Microprocessors and Microcontrollers" is doing fine by the good wishes of students and teachers. It has review questions after each chapter and these are quite a lot in number , they are also useful for exam preparation. Apart from these JNTU OU question papers were refered and the list below is the question bank. we will update it regularily. (ALS/KSA/GKR/CRS-GNITS) pagecontents

page contents

1. question bank
2.procedures stack relocation linking
3.Calculator -example of external linking
4.cupid
5.cmpxchg8b
6.rdtsc
7. 4th mid exam 99batch
8. 5th mid exam 99batch

9.return to main page


back to page contents

UNIT I

1. Explain the flag structure of 8085 mp. 2. What are the architectural differences between 8086 & 8088 mps? 3. What is meant by pipelining in 8086 mp? 4. Explain the functions of following pins of 8086 mp

a). TEST/ b). DEN/ c). BHE/ d). LOCK/

5. Explain the functions of the register of 8086. 6. Explain the architecture diagram of 8086 with diagram. 80386 7. Explain the salient features of 80386 mp. 8. Explain the function of the control register CR0, CR1, CR2 and CR3 of 80386 mp. 9. Explain the memory map of 80386 when operated in the 1). Protected mode 2). Real mode. 10. Explain briefly about the signal groups of 386 DX with the help of diagram. 11. Write a short note on 80386 virtual mode. 12. Explain the function of the following PINS of 80486 mp a). ADS/ b). D/C/ c).PCD d). FLUSH/ e). RESET. 13. Explain the difference between 80486 DX and 80486 SX mps. 14. Compare 80386,80486 and Pentium processors, bringing out clearly their commonalities and differences. 15. What is the purpose of BIST in 80486 mp? Explain its function in detail. 16. Write short notes on virtual 80386 mode. 17. Explain the instructions of 80486. a). WBIND b). CMPXCHG c). INVLPB. 18. Describe the instructions of 80386. a). HOVZX b). SGTCD c). SHRD. 19. Describe the major improvements that 80486 processor has over the 80386 processor. 20. Show and explain how 80386 compute physical address. When paying mode is enable. 21. Explain the format for 80386 segment selectors and discuss how the selectors are used to access a descriptor of descriptor table. 22. Draw flag register of 80486. 23. Explain briefly about the signal groups of 80386 DX with the help diagram. 24. List the segment registers and default offset combinations with their ssors? 25. What are program invisible registers? List them for 80386/80486 microprocessor 26. Compare the register set of the 80386 and 80486 microprocessor. What differences exist between the 80386 and 80486 flag. 27. Can 80486 caching be disabled by software? Explain. purpose in 80386/80486 microprocessors.

UNIT II (MOTOROLA 68000)

1. What are the important register in 68000 mps? Explain their functions. 2. Discuss the organization of main memory in 68000. what is its addressing structure? 3. With examples discuss the addressing modes available in 68000. 4. Describe the major features of RISC based computers which will enable them to execute faster. 5. With a neat block diagram explain DEC alpha AXP architecture and its implementation. 6. Explain different type of development and trouble shooting tools for mp based systems. 7. Explain the function of an in circuit emulator (ICE) as an interface to MDS. 8. write short notes on a). 68000-assemly directive b). power-pc. 9. List the major functions of RISC based computers and describe how each of these features helps to produce faster exeation. 10. Explain the different assembly directives of mc 68X0 and discuss about the register of mc 68X0. 11. Explain about the development of AXP systems. 12. What are the different addressing modes used in mc 68X0? Explain each mode with an eg. 13. Write a short notes on data formats of mc 68x0. 14. Discuss the differences between RISC and CISC processors. 15. Explain the architecture of SUN SPARC RISC. 16. Explain how mp based systems are developed using MDS with eg. 17. Explain the program control system control and multiprocessor communication instructrions.

UNIT III (PENTIUM)

1. Explain the functions and features of control register of Pentium processor. 2. Explain with a neat block schematic diagram the Pentium processor memory management describe how the Pentium access 4M pages. 3. Explain about the Pentium memory management 4. Explain the new Pentium processor instructions. 5. Write a note on Pentium processor mp and explain the feature of special Pentium processor mp. 6. How much memory is accessible to Pentium microprocessor? How much memory is accessible to Pentium processor microprocessor? What is the purpose of DP0 DP7 in Pentium? 7. What new flag bits and what new control register is added to the Pentium microprocessor. 8. Compare 5 different features between Pentium and Pentium pro processors and explain. 9. Mention new instructions of Pentium processor and explain each instruction operation in detail. 10. With a neat diagram explain the internal structure of the Pentium pro microprocessor. 11. How many caches are found in Pentium and what are their sizes. MICROCONTROLLER 1. Explain the operation of XCHD instruction with an suitable example? And mention all possible combinations of XCHD instruction. 2. Explain the operation of SJMP and AJMP instructions. 3. Mention all possible interrupts with 8051 give their vector address? And put them in the default priority order. 4. Interface an external memory of 8K RAM and 16K EPROM to 8051 microcontroller with neat sketch and explain. 5. Explain with a neat sketch about external memory timing. 6. Explain in detail the timer/counter operation of 8051 with description of about relative special function registers explanation 7. a). Explain why mode 0 is not suitable for 8051 communications b). Explain mod 1 operation of UART in 8051. Also read 1. Architecture of 8085,8086 & 8051. 2. Timing diagrams for 8085 & 8086.
back to page contents

MPMC LAB


ECE 1 & ECE 2 this lab note could be useful have added pentium instructions "procedures,stacks, relocation/linking" Assembly Language Programming CR Sarma

 
 This is an example program to design a menu driven ALP and also show the features of
modular program development using linking and relocation.
The student is expected to assemble the five programs separately and study the .lst file
and locate the relocation information which is incomplete with the address of the external module/variable not assigned any specific value (except 0000) and a suffix R /E indicating that this is going to be assigned at loading time by the LOADER.
The Linker links the five modules CALCU.obj ADDER.obj,DIVD.obj,MULT.obj SUBB.obj and
assigns relative addresses.
The LOADER will assign the absolute addresses at run time depending on the memory
availability to the OS.
TITLE is an assembly directive where the rest of the line is ignored by the assembler for
assembly this is used to give the name of the file/program. Usually it is a good practice to
keep the same name for the File and the Main module contained in it.
The Module which has the .startup directive or the end label(start address) will be the
main module called by its name.
Make sure that after every assembly level modification the assembler is used to generate
the .obj. Ensure that after all .objs are ready that they are LINKED together typically with
the Main module file first.
Inspect the .lst file after each assembly specially looking for relocation items. During
debugging view the CPU contents as this will give the comprehensive picture of the calling
modules and called modules showing the mnemonic assembly language. Keep the option zi/la
for source level debugging & listing all items during assembling, follow the same for
linking by using /v for source level debugging.
Debug the entire program and check whether input numbers more than 32,767 can be given for
both the input values.
DANGER only module ADDER.ASM is debugged!!!!!!!! DIVD.ASM,MULT.ASM,SUBB.ASM have not at all
been tested so understand ADDER.ASM and use it as key to implement/debug the last three
modules.


back to page contents

TITLE CALCU.ASM


EXTRN ADDER:near,MULT:near,divd:near,subb:near .model tiny printf macro string mov ah,09h mov dx, offset string int 21h endm getch macro mov ah,01 int 21h endm .stack 160 .data menu db 0ah,0dh,' A Simple Calculator' db 0ah,0dh,' 1. addition' db 0ah,0dh,' 2. subtraction' db 0ah,0dh,' 3. multiplication' db 0ah,0dh,' 4. division' db 0ah,0dh,' X. exit the program' db 0ah,0dh,' input your choice ?$' addproc db 0ah,0dh,' addition procedure?$' subproc db 0ah,0dh,' subtraction procedure?$' divproc db 0ah,0dh,' division procedure?$' mulproc db 0ah,0dh,' multiplication procedure?$' num1 dw 0 num2 dw 0 PRESSANYKEY DB 0AH,0DH,'PRESS ANY KEY $' binnum dw 0;accessed by asc2bin overflowdmsg db 0dh,0ah, 'overflow error $'; invalidmsg db 0dh,0ah, 'invalid error $'; enternum db 0dh,0ah, 'please type a number less than 32000 $';from asciinum db '00000$';getnum binout dw 0ffffh RESULT DB 0AH,0DH,0DH,0AH,0AH,0DH,0DH,0AH,0AH,0DH,0DH,0AH,'THE RESULT IS ' ascout db '00000',0AH,0DH,0DH,0AH,0AH,0DH,0DH,0AH,0AH,0DH,0DH,0AH,'$' .code .startup begin: mov ax,@data mov ds,ax menuagain: printf menu getch cmp al,'1' jne nxt1 call addition jmp menuagain nxt1: cmp al,'2' jne nxt2 call subtract jmp menuagain nxt2: cmp al,'3' jne nxt3 call divide jmp menuagain nxt3: cmp al,'4' jne nxt4 call multiply jmp menuagain nxt4: cmp al,'X' jne menuagain .exit asc2bin proc mov cx,5 ;put number of digits in cx mov di,10 ;put base 10 in di to multiply acc with mov bh,'9' ;bh to check if number greater than 9 mov bl,'0' ;bl checks lower limit of number mov si,offset asciinum xor ax,ax ; make accumulator zero A2Bagain: mul di jc overflow mov dx,ax ; save multiply accumulate reister AX mov al,[si] cmp al,bl jl invalid cmp al,bh jg invalid sub al,30h cbw add ax,dx jc overflow inc si loop A2Bagain over: mov binnum,ax ret invalid: PRINTF invalidmsg PRINTF PRESSANYKEY GETCH jmp BEGIN overflow: PRINTF overflowdmsg PRINTF PRESSANYKEY GETCH jmp BEGIN asc2bin endp bin2asc proc xor si,si mov di,offset ascout add di,4 mov ax,binOUT MOV DX,0 mov bx,10 mov cx,5 ba: div bx add dl,30h mov [di],dl dec di xor dx,dx loop ba RET bin2asc endp getnum proc mov ah,9 mov dx,offset enternum int 21h mov si,offset asciinum mov cx,5 GNagain: mov ah,01 int 21h mov [si],al inc si loop GNagain ret getnum endp multiply proc call getnum call asc2bin mov ax,binnum push ax call getnum call asc2bin mov ax,binnum push ax call mult pop ax pop bx add ax,bx mov binout,ax call bin2asc ret multiply endp subtract proc call getnum call asc2bin mov ax,binnum push ax call getnum call asc2bin mov ax,binnum push ax call subb pop ax pop bx add ax,bx mov binout,ax call bin2asc ret subtract endp divide proc call getnum call asc2bin mov ax,binnum push ax call getnum call asc2bin mov ax,binnum push ax call divd pop ax pop bx add ax,bx mov binout,ax call bin2asc PRINTF RESULT ret divide endp addition proc call getnum call asc2bin push binnum call getnum call asc2bin push BINNUM CALL ADDER pop ax pop bx ; add ax,bx mov binout,ax call bin2asc PRINTF RESULT ret addition endp END *************************************TITLE ADDER.ASM; MODULE EXTERNAL ************************************* .model tiny .code adder proc push bp mov bp,sp add bp,6 mov ax,[bp] dec bp dec bp mov bx,[bp] add ax,bx mov [bp],ax xor bx,0 inc bp inc bp mov [bp],bx ret adder endp end ************************************* TITLE DIVD.ASM MODULE EXTERNAL ************************************* public divd .model tiny .code divd proc near push bp mov bp,sp add bp,6 mov ax,[bp] dec bp dec bp mov bx,[bp] div bx mov [bp],ax inc bp inc bp mov ax,0 mov [bp],ax pop bp ret divd endp end ************************************* TITLE MULT.ASM MODULE EXTERNAL ************************************* public mult .model tiny .code mult proc near push bp mov bp,sp add bp,6 mov ax,[bp] dec bp dec bp mov bx,[bp] mul bx mov [bp],ax inc bp inc bp mov ax,0 mov [bp],ax pop bp ret mult endp end ************************************* TITLE SUBB>ASM MODULE EXTERNAL ************************************* public subb .model tiny .code subb proc near push bp mov bp,sp add bp,6 mov ax,[bp] dec bp dec bp mov bx,[bp] sub ax,bx mov [bp],ax inc bp inc bp mov ax,0 mov [bp],ax pop bp ret subb endp end
back to page contents

cpuid


TITLE CPUID.ASM .MODEL TINY .586 PRINTF MACRO DMES MOV AH,9 LEA DX,DMES INT 21H ENDM LF EQU 0AH CR EQU 0DH ; CPUID INSTRUCTION WHEN EXECUTED WITH EAX=0 ; - GETS "GENUIINE INTEL " IN ECX:EBX:EDX IF CPU IS INTEL PENTIUM ; ELSE RETURNS EAX=1 FOR OTHER CPU'S ; CPUID INSTRUCTION WHEN EXECUTED WITH EAX=1 ; EAX BITS 3-0= NUMBER OF THE STEPPING ID ; EAX BITS 7-4= MODEL NUMBER ; EDX BIT 0 ='CPU CONTAINS FPU' ; EDX BIT 1 ='ENHANCED 8086 VM SUPPORT" ; EDX BIT 3 ='PAGE SIZE EXTENSION SUPPORTED" ; EDX BIT 4 ='TIME STAMP COUNTER SUPPORTED" ; EDX BIT 8 ='CMPXCHG8B SUPPORTEDSUPPORTED" ; EDX BIT 9 ='3.3VOLT POWER SUPPLY MICROPROCESSOR" .STACK 64 .DATA cpumanuf db CR,LF,' this is the ----' pmsg db '000000000000$' stid db CR,LF,'Stepping number : ' sid db '00$' cpm db CR,LF, 'CPUMODEL : ' CPUMODEL DB '00$' CF DB CR,LF, 'CPUCONTAINSFPU$' E86VMSUP DB CR,LF, 'ENHANCED 8086 VM SUPPORT$' PSES DB CR,LF,, 'PAGE SIZE EXTENSION SUPPORTED$' TSCSUP DB CR,LF,, 'TIME STAMP COUNTER SUPPORTED$' ps33 db CR,LF,, '3.3 volts microprocessor$' cmpxch8 db CR,LF,, 'compare & exchange 8 bytes supported$' CPUCONTAINSFPU EQU 0 ENHANCED8086VMSUPPORT EQU 1 PAGESIZEEXTENSIONSUPPORTED EQU 3 TIMESTAMPCOUNTERSUPPORTED EQU 4 CMPXCHG8BSUPPORTEDSUPPORTED EQU 8 PS33VOLTMICROPROCESSOR EQU 9 .CODE .STARTUP MOV AX,@DATA MOV DS,AX MOV EAX,0 CPUID mov dword ptr [pmsg],ebx mov dword ptr [pmsg+4],edx mov dword ptr [pmsg+8],ecx printf cpumanuf MOV EAX,1 CPUID PUSH EAX push edx AND AX,0FH MOV BL,10 DIV BL MOV SI,OFFSET sid add al,30h mov [si],al inc si add ah,30h mov [si],ah pop eax and ax,0f0h mov cl,4 rol al,cl AND AX,0FH MOV BL,10 DIV BL MOV SI,OFFSET cpumodel add al,30h mov [si],al inc si add ah,30h mov [si],ah printf stid printf cpm pop edx test edx,cpucontainsfpu je nxt1 printf cf nxt1: test edx,ENHANCED8086VMSUPPORT jne nxt2 printf E86VMSUP nxt2: test edx,TIMESTAMPCOUNTERSUPPORTED je nxt3 printf TSCSUP nxt3: test edx,PAGESIZEEXTENSIONSUPPORTED je nxt4 printf PSES nxt4: test edx,CMPXCHG8BSUPPORTEDSUPPORTED je nxt5 printf cmpxch8 nxt5: test edx,PS33VOLTMICROPROCESSOR je nxt6 printf ps33 ;nxt6: test edx,TIMESTAMPCOUNTERSUPPORTED ; je nxt7 ; printf TSCSUP nxt6: .EXIT END ************************************************************************************

cmpxchg8b

back to page contents
TITLE cmpx8.ASM .MODEL TINY .586 PRINTF MACRO DMES MOV AH,9 LEA DX,DMES INT 21H ENDM LF EQU 0AH CR EQU 0DH .stack 16 .data search dq '11111111' replace db '22222222' wordlist db '33333333' db '11111111' db '55555555' .code .startup mov ax,@data mov ds,ax mov ecx,4 mov esi,offset wordlist ag: push ecx mov eax,[esi] add esi,4 mov edx,[esi] mov ebx,dword ptr [replace] mov ecx,dword ptr [replace+4] cmpxchg8b search add esi,4 pop ecx loop ag .exit end ******************************************************************


rdtsc

back to page contents

TITLE rdtsc.ASM .MODEL TINY .586 PRINTF MACRO DMES MOV AH,9 LEA DX,DMES INT 21H ENDM LF EQU 0AH CR EQU 0DH .stack 16 .data cpuspeed equ 350 firstrdtsc dq 0 ttfe db cr,lf,' microseconds $' .CODE .STARTUP MOV AX,@DATA MOV DS,AX push edx push ecx db 0fh,31h ; op code for rdtsc instruction as borland is diplomatic mov dword ptr firstrdtsc,eax mov dword ptr firstrdtsc+4,edx