View Single Post
Old 04-30-2005, 01:37   #12 (permalink)
lalo.lerry
No Life Poster
 
lalo.lerry's Avatar
 
Join Date: Jan 2004
Location: Italy
Age: 49
Posts: 1,018
Member: 50673
Status: Offline
Thanks Meter: 2
hello Student,
here are your answers:


mov r13, #Off
mov r14, #Seg ;where r14:r13= Seg:Off is call to be executed after delay
mov [-r0], r14
mov [-r0], r13 <- why make r13 and r14 0 again?

to store Seg:Offset in sistem stack.
I think is due on how fw-hw machine interaction work.
Anyway, this routine is used plenty of time in this exactly way.


mov r12, #Off
mov r13, #Page ;where r13:r12= Page:Off of RAM timer location (just choose a free RAM area) <- ill use debugger and find RAM loc with FFFFFFFF... ?

free RAM areas can be find searching FFFFF (usually related to EEPROM RAM areas9 or 00000 (normal RAM areas)
be carefully, because some RAM areas may seems to be free, but only because not used when you are looking at them in that specific moment.
I suggest you to use a RAM location close to one used by other patchmasters, should be already well tested and bug-free.
BTW, usually a patchmaster tend to use always the same RAM area for his patches, as well as a patchmaster has his "own" area in fw to store patches routines.


mov r14, #n ,where n is time in ms/0,25
mov r15, #0 <- where did r15 come from and why move #0 into it?

r15 is just set so before the delay call, search in call to understand why.
Anyway, very often r15 is setted to 0.
Sometime r15 is used to store time if time value is greater than FFFF and cannot be saved in only one register, but haven't check if this is the right case.


calls C1CA86 ;delay1 ()
add r0, #4 <- what is r0 and why add #4?

r0 is used for system stack, you have to add 4 (=2 words) because you have stored r13 and r14 without resuming it.
many "function" subroutines add something to system stack as last command of them, just explore original fw routines.

bye

Lalo
  Reply With Quote
 
Page generated in 0.09199 seconds with 7 queries