Clean up memory_rec.s

This commit is contained in:
hugova 2025-03-25 21:59:44 +01:00
parent 41b8fec7a8
commit 20b24a299a

View file

@ -3,6 +3,8 @@
;;##### HANDLES BIG MEMORY MANAGMENTS ############ ;;##### HANDLES BIG MEMORY MANAGMENTS ############
;;recursive write to memory. ;;recursive write to memory.
.proc memory_rec .proc memory_rec
Address_start = $FBFC
Address_end = $FDFE
;;Writes data in A ;;Writes data in A
;;Adress start: $FC, $FB ;;Adress start: $FC, $FB
;;Adress end: $FE, $FD ;;Adress end: $FE, $FD
@ -17,22 +19,19 @@ loop:
;;write to byte ;;write to byte
TYA TYA
STA ($FB ,X) STA ($FB ,X)
TAY
Add_16 $FB, $FC, #$01, #$00 Add_16 >Address_start, <Address_start, #$01, #$00
LDA $FB LDA >Address_start
CMP $FD CMP >Address_end
BEQ test_1 BEQ test
jmp loop jmp loop
test:
test_1: LDA <Address_start
LDA $FC CMP <Address_end
CMP $FE BEQ end
BEQ test_2
jmp loop jmp loop
end:
test_2:
;;Dont forget to rewrite last byte ;;Dont forget to rewrite last byte
TYA TYA
STA ($FB, X) STA ($FB, X)