Last active
June 14, 2020 19:18
-
-
Save electronicayciencia/ccc50248c3fcbcb20526e8922dc718dd to your computer and use it in GitHub Desktop.
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
#BANKX | |
int buffer[BUFFER_LEN]; | |
// Modulo addressing inicialization | |
XMODSRT = buffer; | |
XMODEND = buffer + BUFFER_LEN - 1; | |
MODCONbits.XWM = MODCON_WREG1; | |
MODCONbits.XMODEN = MODCON_ENABLED; | |
#ASM | |
mov #0,w0 // w0 is the counter: start at 0 | |
mov buffer,w1 // w1 is the pointer: start at buffer[0] | |
do #100,end // repeat 100 times until "end", included | |
mov w0,[w1++] // store w0 at w1, post-increment pointer | |
end: | |
inc w0,w0 // increment counter | |
#ENDASM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment