| ??? 02/25/04 03:29 Read: times |
#65469 - RE: homework problem- Responding to: ???'s previous message |
Hello Lisa,
When you move the data to start of memory 50h you have two mistakes. See the corrected code example. I ran the program thru a simulator and it does add the 32 numbers correctly. Raghu is correct in that it is not necessary to move the data to memory to do a sum of it. Regards, Charles Bannister
your code:
MOV R6,#00 ;CLEAR HIGH SUM REGISTER
MOV R7,#32 ;COUNT=32
CLR A
MOV DPTR,#0000H
DONE: MOVC A,@A+DPTR
MOV R0,#50H ;INIT. MEMORY POINTER (50H)
corrected code:
MOV R6,#00 ;CLEAR HIGH SUM REGISTER
MOV R7,#32 ;COUNT=32
MOV R0,#50H ;INIT. MEMORY POINTER (50H) ;;<======
MOV DPTR,#0000H
DONE: CLR A ;;<========
MOVC A,@A+DPTR
|
| Topic | Author | Date |
| homework problem- | 01/01/70 00:00 | |
| RE: homework problem- | 01/01/70 00:00 | |
| RE: homework problem- | 01/01/70 00:00 | |
| RE: homework problem- | 01/01/70 00:00 | |
| RE: homework problem- | 01/01/70 00:00 | |
| RE: homework problem- | 01/01/70 00:00 | |
| RE: homework problem- | 01/01/70 00:00 | |
RE: homework problem- | 01/01/70 00:00 |



