8085 microprocessor ASM language question

Reply

Join Date: Feb 2005
Posts: 21
Reputation: jfountain02 is an unknown quantity at this point 
Solved Threads: 1
jfountain02 jfountain02 is offline Offline
Newbie Poster

8085 microprocessor ASM language question

 
0
  #1
Feb 5th, 2005
The problem is I need to check A set of sign numbers and add the positive numbers, and reject the negative numbers. But the problem is I don't have an assembler to check my program, so I am just doing this program in my head, and I was seeing if somebody could tell me if this program would work properly.

First data Set: 20, 87,F2,37,79,17
Second data set: A2, 15, 3F, B7, 47, 9A

MVI B, 00H ; Clear(B) to save results
MVI C, 06H ; Set up register C to count six numbers
LXI H, 2060H ; SET up HL PAIR as a memory pointer
Next: MOV A,M ; Get a Byte
RAL ; Place D7 in CY flag
JC REJECT ; IF D7=1, reject thebyte
RAR ; Restore the byte
ADD B ; Add the previos sum
MOV B,A ;Save the sum
REJECT:INX H ;Next location
DCR C ; Update the byte counter
JNZ NEXT ; Go back to get the next byte
STA 2070H ;Save the result
HLT

Will this program work to add all positive numbers for each data set.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC