hold data in ram

This commit is contained in:
2024-02-27 15:32:35 +01:00
parent cbf8a3cf86
commit b390b8ec8f

26
main.S
View File

@ -8,14 +8,22 @@
#define SR r2 #define SR r2
.section ".rodata","a" .section ".data"
screendata: screendata:
.byte _violet .rept 3
.byte _orange .byte 0
.byte _springgreen .endr
screendataend: screendataend:
.byte 0xff .byte 0xff
.section ".rodata","a"
screendata_tmpl:
.byte _blue
.byte _red
.byte _blue
screendataend_tmpl:
.byte 0xff
;; color definitions according to https://learn.sparkfun.com/tutorials/lilypad-protosnap-plus-activity-guide/3-custom-color-mixing ;; color definitions according to https://learn.sparkfun.com/tutorials/lilypad-protosnap-plus-activity-guide/3-custom-color-mixing
red: red:
colors1: colors1:
@ -100,6 +108,16 @@ _start:
;; initialize stack pointer with value from linker ;; initialize stack pointer with value from linker
mov.w #__stack, SP mov.w #__stack, SP
mov.w #screendata, r7
mov.w #screendataend, r8
mov.w #screendata_tmpl, r9
_start_load_next:
mov.b @r9, @r7
inc.w r7
inc.w r9
cmp.w r7, r8
jnz _start_load_next
init: init:
;; configuration of GPIO Ports ;; configuration of GPIO Ports
mov.b #BIT0|BIT1|BIT2,&P1DIR mov.b #BIT0|BIT1|BIT2,&P1DIR