Computer Science, asked by lanation5380, 1 year ago

Rite an assembly language program to search a given number with value 25 in a group of 10 numbers stored in memory. Store 1 in al register for successful search, else store 0. Make suitable assumptions.

Answers

Answered by swastipradhan
0

Answer:

2000 LXI H 2050 H <- 20, L <- 50

2003 MOV C, M C <- M

2004 LDA 3050 A <- M[3050]

2007 MOV B, A B <- A

2008 INX H HL <- HL + 0001

2009 MOV A, M A <- M

200A CMP B A – B

200B JNZ 2014 Jump if ZF = 0

200E MVI A F0 A <- F0

2010 STA 3051 M[3051] <- A

2013 HLT END

2014 MVI A 0F A <- 0F

2016 STA 3051 M[3051] <- A

2019 DCR C C <- C – 01

201A JNZ 2008 Jump if ZF = 0

201D HLT END

Explanation:

Similar questions