| | |
8085 microprocessor ASM language question
![]() |
•
•
Join Date: Feb 2005
Posts: 21
Reputation:
Solved Threads: 1
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.
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.
![]() |
Similar Threads
- Digital clock source code for assembly language for 68k microprocessor (Assembly)
- assembly language progam of digital clock using 8085 (Assembly)
- Alarm digital clock assembly language for 8085 microprocessor (Assembly)
- Programming FAQ - Updated 1/March/2005 (Computer Science)
- Temperauture Conversion (Assembly)
Other Threads in the Assembly Forum
- Previous Thread: Help me plz
- Next Thread: Does anyone out there know Assembler?!!!
| Thread Tools | Search this Thread |





