Created
January 30, 2011 18:51
-
-
Save wingyplus/803116 to your computer and use it in GitHub Desktop.
Question 3.6 - 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; lab3-q5.asm | |
Result_H EQU 20H | |
Result_L EQU 21H | |
ORG 0000H | |
MOV R6, B | |
MOV A, #00H | |
MOV Result_H, #00 ; Clear Result | |
MOV Result_L, #00 | |
LOOP: MOV A, R6 | |
CLR C | |
ADDC A, Result_L | |
MOV Result_L, A | |
MOV A, #00 | |
ADDC A, Result_H | |
MOV Result_H, A | |
INC R6 | |
CJNE R6, #89H, LOOP | |
MOV DPTR, #0000H | |
MOV A, Result_H | |
MOVX @DPTR, A | |
INC DPTR | |
MOV A, Result_L | |
MOVX @DPTR, A | |
SJMP $ | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment