Problems
Problems
Program: Program to move a string consist of 200 bytes long from the offset address 1000H to
the offset address of 3000H in the segment address 5000H.
start:
; Program ends (for real mode we would use a termination interrupt here)
mov ah, 4Ch ; DOS interrupt to terminate program
int 21H
end start
2.Write a Programmable timer using 8253 and 8086. Interface 8253 at an address of 0040H for counter 0
and write the following ALPs. The 8086 and 8253 run at 6 MHz and 1.5 MHz respectively.
3.Design a programmable timer using 8253 and 8086. Interface 8253 at an address of 0040H for
counter 0 and write the following ALPs. The 8086 and 8253 run at 6 MHz and 1.5 MHz
respectively.
To generate a square wave with a period of 1ms, the output frequency should be 1 kHz (since period = 1/
frequency). This corresponds to a frequency of 1000 Hz.
Given that the 8253 timer operates at 1.5 MHz, we need to configure the 8253 in mode 2 (rate generator
mode). The frequency is generated based on the 16-bit counter value.
The 8253 timer frequency is 1.5 MHz, which means each clock cycle is 1 / 1.5 MHz = 0.6667
microseconds. For a 1 kHz frequency (1 ms period), we need a counter value that produces this
frequency.
So, the 16-bit counter value should be 1500 (which is 0x05DC in hexadecimal).
To generate an interrupt after 10ms, we need to calculate the counter value that corresponds to this delay.
To achieve a 10ms delay, we want the counter to count down for 10ms. The frequency of the
8253 is 1.5 MHz, and the time between each tick is 0.6667 microseconds. For a 10ms delay, the
number of counts required is:
In monoshot mode (mode 1), the 8253 timer generates a single pulse with a specified width, and it returns
to a stable state after the pulse duration.
Using the same principle, the count value for a 5ms pulse is:
To generate a monoshot pulse with a 5ms duration, we need to set the 8253 timer in mode 1
(monoshot mode) and load the counter with the value 0x1D4C.
4.Microprocessor system for the 8085 microprocessor such that it should contain 8 Kbyte of
EPROM and 8 Kbyte of RAM. Use linear addressing technique and give the detailed address map
start:
Initialize 8255 with control word to configure ports
mov al, 90H ; Control word for 8255: 1001 0000 (Input-Input-Output-Output)
out 83H, al ; Send the control word to control register of 8255 (address 83H)
jmp
end start
6.Interface one 8Kx8 EPROM and two 8Kx8 RAM with 8085 such that the starting address
assigned to each memory chip is 0000H, 4000H and 6000 H respectively using a 3x8 decoder IC.
Decoder Role
The 3-to-8 decoder (74LS138) decodes A13–A15 to select one of 8 memory blocks of 8 KB each.
7.Interfacing 8251 with 8086 microprocessor. Set the 8251A in asynchronous mode as a transmitter and
receiver with even parity enabled, 2 stop bits, 8 bit character length, frequency 160KHz and baud rate 10K.
Write an ALP to transmit 100 bytes of data string at location 2000:5000H.
start:
; Initialize segments
mov ax, 2000h
mov ds, ax
mov si, 5000h
; Initialize 8251
mov dx, 41h ; Control port
mov al, 0FBh ; Mode word: async, 8-bit, even parity, 2 stop bits, x16
out dx, al
8.Write a program to initialize counter 2 in mode 0 with a count of C030H. Assume address for
control register = 0BH, counter 0 = 08H, counter 1 = 09H and counter 2 = 0AH.
start:
; Send control word to control register (port 0Bh)
mov dx, 0Bh ; Control register address
mov al, 0B0h ; Control word: Counter 2, LSB+MSB, Mode 0, Binary
out dx, al