0% found this document useful (0 votes)
11 views5 pages

Microprocessor and Assembly Language

Uploaded by

shanibhatti
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
11 views5 pages

Microprocessor and Assembly Language

Uploaded by

shanibhatti
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 5

Microprocessor and assembly language

Q. 1: What is microprocessor?

Computer's Central Processing Unit (CPU) built on a single Integrated Circuit (IC) is
called a microprocessor.
A digital computer with one microprocessor which acts as a CPU is called
microcomputer.
It is a programmable, multipurpose, clock -driven, register-based electronic device that
reads binary instructions from a storage device called memory, accepts binary data as
input and processes data according to those instructions and provides results as output.
The microprocessor contains millions of tiny components like transistors, registers, and
diodes that work together.
Q. 2: Briefly explain the different types of buses in 8085.
The 8085 microprocessor has a 16-bit address bus, an 8-bit data bus, and various control signals that are
used to manage data transfer and other operations. The address bus is used to specify the memory location
or device with which the microprocessor wants to communicate.
Q.3: Mention any two instructions which clear the contents of the accumulator.
The XRA A and SUB A both are one-byte instruction, but as XRA A is logical, it performs faster than the
other. So XRA A is best for clearing/resetting Accumulator content than other three instructions. Now let
us see how to reset accumulator in 8086 microprocessor. This instruction loads 0000H into the
accumulator.
Q.4: Name the flag of 8085.
Document Information. The document discusses the flag register in the 8085 microprocessor. It contains
five flip-flops called flags - zero (Z), carry (CY), sign (S), parity (P), and auxiliary carry (AC) - that are
set or reset according to the results of operations.
Q. 5: Compare SUB reg and CMP reg instructions.
CMP is used for comparing 2 registers by subtraction them from one another, but answer is not saved,
whereas SUB subtracts 2 registers and saves the answer.
Q. 6: Define interrupt.
An interrupt is a signal emitted by a device attached to a computer or from a program within the
computer. It requires the operating system (OS) to stop and figure out what to do next.

Long Question
Q.1: What is an assembly language program to subtract two 16-bit numbers.
section .data
; Define the two 16-bit numbers to be subtracted
num1 dw 0x1234 ; First number (stored as a word)
num2 dw 0x00AB ; Second number (stored as a word)
section .bss
; Define a space to store the result
result resw 1

section .text
global _start

_start:
; Load the first number into AX register
mov ax, [num1]

; Subtract the second number from AX register


sub ax, [num2]

; Store the result in the result variable


mov [result], ax

; Exit the program (Linux system call)


mov eax, 60 ; syscall: exit
xor edi, edi ; status: 0
syscall

Q. 2: (a): Briefly explain the 8085 vectored interrupts.


The 8085 microprocessor supports several types of interrupts, including vectored interrupts. Vectored
interrupts are those where the address of the interrupt service routine (ISR) is predefined and known to
the processor. When a vectored interrupt occurs, the 8085 automatically jumps to a specific memory
location to execute the corresponding ISR.
Here are the main features and the specific addresses for the 8085 vectored interrupts:
Types of Vectored Interrupts
1. TRAP:
 Type: Non-maskable interrupt.
 Vector Address: 0024H.
 Priority: Highest priority.
 Characteristics:
 Cannot be disabled.
 Used for critical events like power failure and emergency shutoff.
2. RST7.5:
 Type: Maskable interrupt.
 Vector Address: 003CH.
 Priority: High priority among the maskable interrupts.
 Characteristics:
 Edge-triggered.
 Can be enabled or disabled using software.
3. RST6.5:
 Type: Maskable interrupt.
 Vector Address: 0034H.
 Priority: Medium priority among the maskable interrupts.
 Characteristics:
 Level-triggered.
 Can be enabled or disabled using software.
4. RST5.5:
 Type: Maskable interrupt.
 Vector Address: 002CH.
 Priority: Lowest priority among the maskable RST interrupts.
 Characteristics:
 Level-triggered.
 Can be enabled or disabled using software.
5. INTR (Interrupt Request):
 Type: Maskable interrupt.
 Vector Address: Needs to be provided externally via the interrupting device.
 Priority: Lowest priority among the interrupts.
 Characteristics:
 Requires external hardware to vector to the correct ISR address.
 General-purpose interrupt.

(b): Write a note on RIM and SIM 8085 instructions.


The 8085 microprocessor includes special instructions for handling its interrupt system and peripheral
devices, namely RIM (Read Interrupt Mask) and SIM (Set Interrupt Mask). These instructions are used to
manage and control the maskable interrupt system and to handle serial I/O operations. Here's a detailed
note on each of these instructions:
1. RIM (Read Interrupt Mask)
The RIM instruction is used to read the status of the interrupt system and the serial input data line. It
provides information about:
1. Interrupt Enable Status:
2. Whether the interrupts are enabled or disabled.
3. Interrupt Mask Status:
4. Which specific interrupts are masked (disabled).
5. Interrupt Request Status:

 Whether an interrupt request has been received from any of the maskable
interrupt lines (RST7.5, RST6.5, RST5.5).

2. Serial Input Data Line Status:

 The status of the Serial Input Data Line (SID).

Function:
 The RIM instruction reads an 8-bit status byte into the accumulator (A-register).
 The bit-wise significance of the accumulator after executing RIM is as follows:
 Bit 7: Serial Input Data (SID).
 Bit 6: Masking of RST7.5.
 Bit 5: Masking of RST6.5.
 Bit 4: Masking of RST5.5.
 Bit 3: Interrupt Enable (IE).
 Bit 2: Interrupt Request (RST7.5).
 Bit 1: Interrupt Request (RST6.5).
 Bit 0: Interrupt Request (RST5.5).

SIM (Set Interrupt Mask)

The SIM instruction is used to set the mask bits to enable or disable specific hardware
interrupts and to control the Serial Output Data (SOD) line. It allows the programmer to
configure the interrupt system and output serial data.

Function:

 The SIM instruction uses the accumulator to set the interrupt masks and control
the SOD line.
 Before executing SIM, the programmer loads the accumulator with the
appropriate control bits.
 The bit-wise significance of the accumulator when executing SIM is as follows:
 Bit 7: Serial Output Data (SOD).
 Bit 6: SOD Enable (SOE).
 Bit 5: Mask Set Enable (MSE).
 Bit 4: Mask for RST7.5.
 Bit 3: Mask for RST6.5.
 Bit 2: Mask for RST5.5.
 Bit 1: Don't Care (Usually left as 0).
 Bit 0: Don't Care (Usually left as 0).
Usage:

 Setting Interrupt Masks:


 When the MSE (Mask Set Enable) bit (Bit 5) is set to 1, the states of bits 4,
3, and 2 are used to mask or unmask RST7.5, RST6.5, and RST5.5
interrupts, respectively.
 1 in a mask bit disables the corresponding interrupt, while 0 enables it.

 Controlling Serial Output Data (SOD):


 When the SOE (Serial Output Enable) bit (Bit 6) is set to 1, the state of Bit 7
(SOD) is output to the SOD line.
 This feature is used for simple serial communication.

You might also like