improve memset with code unrolling
This commit is contained in:
parent
fea2a85b54
commit
6ee280abec
2 changed files with 25 additions and 19 deletions
|
@ -8,28 +8,34 @@
|
|||
;; big_set sets the memory in $ff chunks.
|
||||
;; skipp if length >= $ff
|
||||
LDX length +1
|
||||
BEQ small_set
|
||||
BNE big_set
|
||||
JMP small_set
|
||||
|
||||
big_set:
|
||||
|
||||
big_set: ;sets $ff of memory
|
||||
LDY #$ff
|
||||
big_set_loop:
|
||||
.repeat $ff
|
||||
STA (A_start), Y
|
||||
DEY
|
||||
BNE big_set_loop
|
||||
STA (A_start), Y ; don't forget Y=0
|
||||
;;maybe move to next chunk
|
||||
.endrepeat
|
||||
STA (A_start), Y ; dont forget Y =0
|
||||
big_set_end:
|
||||
;;set all hole $ff memory chunks!
|
||||
INC A_start + 1
|
||||
DEC length + 1
|
||||
BNE big_set
|
||||
BEQ small_set
|
||||
JMP big_set
|
||||
|
||||
|
||||
|
||||
;;sets the rest of the memory
|
||||
;; note that this can use code above (smc) or the same method. may implement later.
|
||||
small_set:
|
||||
LDY length
|
||||
LDY length
|
||||
small_set_loop:
|
||||
STA (A_start), Y
|
||||
DEY
|
||||
BNE small_set_loop
|
||||
STA (A_start), Y
|
||||
RTS
|
||||
|
||||
.endproc
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
.include "STARTUP.s"
|
||||
;.include "dubbel_buffer/raster_irqs.s"
|
||||
|
||||
;.include "routines/arithmatic/mult_test.s"
|
||||
;.include "routines/arithmatic/div_test.s"
|
||||
;.include "routines/circle/circle_test.s"
|
||||
;.include "routines/circle/circle_test_size.s"
|
||||
;.include "routines/circle/circle_test_position.s"
|
||||
;.include "routines/line/line_test.s"
|
||||
;.include "routines/text/char_draw_test.s"
|
||||
;.include "routines/pixel/pixel_test.s"
|
||||
;.include "routines/memory/memcpy_test.s"
|
||||
.include "routines/arithmatic/mult_test.s"
|
||||
.include "routines/arithmatic/div_test.s"
|
||||
.include "routines/circle/circle_test.s"
|
||||
.include "routines/circle/circle_test_size.s"
|
||||
.include "routines/circle/circle_test_position.s"
|
||||
.include "routines/line/line_test.s"
|
||||
.include "routines/text/char_draw_test.s"
|
||||
.include "routines/pixel/pixel_test.s"
|
||||
.include "routines/memory/memcpy_test.s"
|
||||
.include "routines/memory/memset_test.s"
|
||||
;.include "routines/triangle/triangle_test.s"
|
||||
.include "routines/triangle/triangle_test.s"
|
||||
exit:
|
||||
JMP exit
|
||||
.include "../wip-duuqnd/public.inc"
|
||||
|
|
Loading…
Add table
Reference in a new issue