Perform the addition of two 16-bit numbers using ALP.

v ;   AF 88 H

 ;+  89 7F H

 ;= 139 07 H

 ;R4=01H(MSB),R1=39H(LSB),R0=07H(LSB)



ORG 0000H

CLR C

MOV A,#88H

ADD A,#7FH

JNC L1

INC R3

L1:MOV R0,A

MOV A,#0AFH

ADDC A,#89H

JNC L2

INC R4

L2:MOV R1,A

END 

Comments

Popular posts from this blog

Wire wound strain gauge

SemiConductor type strain gauge

Do an ALP to compare two eight bit numbers NUM1 and NUM2 stored in external memory locations 8000h and 8001h respectively. Reflect your result as: If NUM1NUM2, SET MSB of location 2FH (bit address 7FH). If NUM1 = NUM2, then Clear both LSB & MSB of bit addressable memory location 2FH.