Assembly Language Programs

  • Uploaded by: babasaheb creation
  • 0
  • 0
  • August 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Assembly Language Programs as PDF for free.

More details

  • Words: 320
  • Pages: 4
1)Write an assembly language program to subtract two double precision numbers.

2)Write an assembly language program to multiply two positive numbers



Write an ALP for swapping two numbers. ORG 100 LDA A STA TMP LDA B STA A LDA TMP STA B HLT A, DEC 3 B, DEC 4 TMP, DEC 0 END 4) Write the program to logically OR the two numbers without using “OR” instruction. 1

ORG 100

/Origin of program is HEX 100

2

LDA A

/Load first operand

3

CMA

/Complement A

4

STA AD

/Store at AD

5

LDA B

/Load second operand

6

CMA

/Complement B

7

AND AD

/And A and B

8

CMA

/Complement the result

9

STA RES

/Store the result

10

HLT

/Halt

DEC 5

/First operand

11

A,

12

AD,

HEX 0

/This location reserved A complement

13

B,

DEC 4

/Second operand

14

RES, HEX 0

15

END

/This location reserved for Result /End of symbolic program

5) Write the program to multiply two positive numbers by a repeated addition method. For ex., to multiply 5 x 4, the program evaluates the product by adding 5 four times, or 5+5+5+5 1

ORG 100

/Origin of program is HEX 100

2

LDA X

/Load first address of operands

3

STA PTR

/Store in pointer

4

LDA NBR

/Load minus second operand

5

STA Y

/Store in counter

6

CLA

/Clear accumulator

7

LOP, ADD PTR I /Add an operand to AC

8

ISZ Y

/Increment counter

9

BUN LOP

/Repeat loop again

10

STA MUL

/Store sum

11

HLT

/Halt

DEC 5

/First operand

12

X,

13

PTR, HEX 0

/This location reserved for a pointer

14

NBR, DEC -4

/Second operand

16

CTR, HEX 0

/This location reserved for a counter

17

MUL , HEX 0

/Sum is stored here

18

END

/End of symbolic program

6) Write a program which uses the service of an interrupt

Related Documents


More Documents from ""Rufus""