Google

Feb 19, 2008

Assembly Language Program to be executed when NMI is generated

Assembly Language Program to be executed when NMI is generated

AIM:To write Assembly Language Program to be executed when NMI is generated

APPARATUS:-
Microprocessor trainer kit & power supply.

NON MASKABLE INTERRUPT (NMI)

NMI is an edge triggered input pin which causes Type-2 interrupt. The NMI is not mask able internally by software. A transition from low to high initiates the interrupt response at the end of the current instruction. This input is internally synchronized.
When an external device interrupts the CPU at the interrupt pin NMI and the CPU is executing an instruction of a program. The CPU first completes the execution of current instruction. The IP is then incremented by one to point next instruction. The CPU then acknowledges the requesting device on its INTA pin immediately for NMI. After an interrupt is acknowledged, the CPU computes the vector address from the type of the interrupt that may be passed to interrupt structure of the CPU internally or externally (for NMI vector address is 00008 H). The contents of PSW, CS & IP are next pushed on stack. The contents of IP & CS now points to the address of the next instruction in main program from which the execution is to be continued after executing the ISR. The control is then transferred to Interrupt Service Routine for serving the interrupting device. The new address is found out from the interrupt vector table (for NMI [00009:00008] = ISR IP & [0000B:0000A] = ISR CS. The execution of ISR starts. At the end of ISR the last instruction should be IRET. When CPU executes IRET instruction the IP, CS & PSW is popped back from the stack and the execution continued from address received by IP & CS.

WRITE THIS PROGRAM AT 0000:4000 H MEMORY LOCATION AND EXECUTE IT
0000:4000 MOV AX,0FFFFH 
0000:4003 MOV BX,0FFFFH 
0000:4006 ADD AX,BX 
0000:4008 HLT 
0000:4009 
WRITE THIS PROGRAM AT 0000:4100 H MEMORY LOCATION AND EXECUTE IT

0000:4100 MOV AX,0000H 
0000:4103 MOV DS,AX 
0000:4105 MOV AL,00H 
0000:4107 MOV [0008],AL 
0000:410A MOV AL,40H 
0000:410C MOV [0009],AL 
0000:410F MOV AL,00H 
0000:4111 MOV [000A],AL 
0000:4114 MOV AL,00H 
0000:4116 MOV [000B],AL 
0000:4119 HLT 
0000:411A  

NOW PRESS NMI BUTTON ON 8086 MICROPROCESSOR KIT

You might be also interested in:

:: MASM 611 SOFTWARE
:: bit reversal and sorting programs
:: Find Square Root of a hexadecimal number in assembly language
:: common intreview questions on 8086

1 comment:

Unknown said...

i want program for traffic light control using 8085 interfacing.can anybody help me please