Skip to content

Instantly share code, notes, and snippets.

@wingyplus
Created January 30, 2011 18:51
Show Gist options
  • Save wingyplus/803116 to your computer and use it in GitHub Desktop.
Save wingyplus/803116 to your computer and use it in GitHub Desktop.
Question 3.6 - 5
; 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