This fails to loop properly. There is a +$400 byte offset ($100 longwords) to the branch distance, or it might be +$3fc bytes ($ff longwords). If you comment the JMP #loop1 it'll work correctly using the JMP #$400.
This fails to loop properly. There is a +$400 byte offset ($100 longwords) to the branch distance, or it might be +$3fc bytes ($ff longwords). If you comment the JMP #loop1 it'll work correctly using the JMP #$400.
It crashes because the +$400 offset makes the branch end up beyond the end of the program ... That said, if you have the remnant of a functioning version in hubRAM that isn't getting overwritten by the new download then, when run, it'll hit that old code and loop back just fine.
Comments
dat org jmp #loop1 orgh $400 loop1 drvnot #56 waitx ##25_000_000/20 long 0[5000] drvnot #57 waitx ##25_000_000/20 jmp #loop1 jmp #$400
long 0[5000]
?Like previous test results this code also works fine if I go back to V34L.
dat org 'backup first part setq2 #9 rdlong 0, ##@loop1 'backup second part setq2 #9 rdlong 10, ##@hubcode2 'erase entire 512 kB hubRAM wrfast #0, #0 rep @.rend, ##512*1024/4 wflong #0 .rend rdfast #0, #0 'restore first part setq2 #9 wrlong 0, ##@loop1 'restore second part setq2 #9 wrlong 10, ##@hubcode2 'and away we go ... wrpin #0, #56|1<<6 jmp #loop1 orgh $400 loop1 drvnot #56 waitx ##25_000_000/20 long 0[1000] hubcode2 drvnot #57 waitx ##25_000_000/20 jmp #loop1 jmp #$400