Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
19 views2 pages

MPMC ALP Revision Sheet

This document provides assembly language programming (ALP) examples for various microprocessors including 8085, 8086, and 8051. It covers tasks such as block transfer with delay, finding the largest number in an array, implementing a 1ms delay using Timer 0, copying a string, and blinking an LED using the 8255. Each example includes the necessary assembly code and comments for clarity.

Uploaded by

dark030bro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

MPMC ALP Revision Sheet

This document provides assembly language programming (ALP) examples for various microprocessors including 8085, 8086, and 8051. It covers tasks such as block transfer with delay, finding the largest number in an array, implementing a 1ms delay using Timer 0, copying a string, and blinking an LED using the 8255. Each example includes the necessary assembly code and comments for clarity.

Uploaded by

dark030bro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Last-Minute ALP Revision Sheet - MPMC 2025

1. 8085 ALP - Block Transfer with Delay

; Transfer 5 bytes from 3000H to 4000H using a subroutine with delay


LXI H, 3000H ; HL = source address
LXI D, 4000H ; DE = destination address
MVI C, 05H ; Counter = 5 bytes
LOOP: MOV A, M ; Load from source
STAX D ; Store to destination
CALL DELAY ; Delay routine
INX H ; Next source
INX D ; Next destination
DCR C
JNZ LOOP
HLT

DELAY: MVI B, FFH


D1: MVI E, FFH
D2: DCR E
JNZ D2
DCR B
JNZ D1
RET

2. 8086 ALP - Find Largest Number in an Array

; Array starts at 5000H, 10 bytes


MOV SI, 5000H
MOV CL, 0AH ; Counter = 10
MOV AL, [SI]
INC SI
DEC CL

NEXT: CMP AL, [SI]


JAE SKIP
MOV AL, [SI]
SKIP: INC SI
DEC CL
JNZ NEXT
HLT

3. 8051 ALP - 1ms Delay Using Timer 0 Mode 1

; Timer 0 in Mode 1 (16-bit), Crystal = 12MHz, TH0 + TL0 = 0xFC66


MOV TMOD, #01H ; Timer 0, Mode 1
MOV TH0, #0FCH
MOV TL0, #066H
SETB TR0 ; Start Timer 0
Last-Minute ALP Revision Sheet - MPMC 2025

WAIT: JNB TF0, WAIT ; Wait for overflow


CLR TR0 ; Stop Timer
CLR TF0 ; Clear overflow flag
RET

4. 8086 ALP - Copy 10-Byte String using MOVSB

; Copy string from DS:SI to ES:DI


MOV CX, 000AH
MOV SI, 1200H
MOV DI, 1300H
CLD
REP MOVSB
HLT

5. 8086 ALP - Blink LED on Port A using 8255

; Port A output, Port B input, Port C output


MOV AL, 80H ; Control Word: Port A = out (Mode 0), C = out, B = in
OUT 43H, AL ; Send to control register

START: MVI AL, 0FFH


OUT 40H, AL ; LED ON
CALL DELAY

MVI AL, 00H


OUT 40H, AL ; LED OFF
CALL DELAY
JMP START

DELAY: MVI CX, FFFFH


D1: LOOP D1
RET

You might also like