Microprocessor and Assembly Language
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]
Whether an interrupt request has been received from any of the maskable
interrupt lines (RST7.5, RST6.5, RST5.5).
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).
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: