Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/25/04 02:05
Read: times


 
#65462 - homework problem-
Hi Guys, I promise this code is not as horribly written as the last I posted. The problem:add the first 32 code locations,write high sum to XRAM 2000h and low sum to 2001h.
I am new to programming and I assure you I don't want anything more than a little guidance. This is what I have written and if any of you are willing your help is appreciated.

.ORG 2010H
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)
MOV @R0,A ;STORE DATA
INC DPTR
DJNZ R7,DONE
MOV R7,#32 ;COUNT=32
MOV R0,#50H
MOV A,@R0
NEXT:INC R0
ADD A,@R0
JNC MORE ;JUMP TO MORE IF DONE
INC R6 ;INCREMENT HISUM
MORE:DJNZ R7,NEXT ;COUNT-1
MOV DPTR,#2001
MOVX @DPTR,A
MOV DPTR,#2000
MOV A,R6
MOVX @DPTR,A
LJMP 0000
;END


;CODE MEMORY
;0000: 02 08 5F 02 20 03 8E 82 8F 83 22 02 20 0B AE
82
;0010: AF 83 22 02 20 13 74 2D 01 76 00 02 20 1B 11 76



List of 8 messages in thread
TopicAuthorDate
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      

Back to Subject List