This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Shaminda,
You call the funciton inside the outer loop and the inner loop is in the function call. I don't think this is going to work. I have an idea to solve this problem but let me run a test first before getting back to you. I will give you answer within this week.
Best Regards,
Peter Chung
Shaminda,
If you really want to use a block repeat inside the subroutine, you should consider that loop as a outer loop, not inner loop. I made an example and verified it (see below). However, my question is why do you want to do this? You can add the subroutine insdie the blockrepeat without using "call". You may have a size problem?
Anyway, here is example that I have verified.
;function subroutine
_foo
PSH mmap(BRC0)
PSH mmap(RSA0L)
PSH mmap(RSA0H)
PSH mmap(REA0L)
PSH mmap(REA0H)
MOV #6, mmap(BRC0)
RPTBLOCAL _end_loop_1-1
nop
nop
MOV #1, AC0
MOV #1, AC1
_end_loop_1
POP mmap(REA0H)
POP mmap(REA0L)
POP mmap(RSA0H)
POP mmap(RSA0L)
POP mmap(BRC0)
RET
;main loop
MOV #8, BRC0
nop
nop
RPTB _end_loop_0-1
MOV #0, AC0
MOV #0, AC1
CALL _foo
nop
nop
MOV #1, AC0
MOV #1, AC1
_end_loop_0
Best Regards,
Peter Chung
Thanks for the solution Peter.
In our code, the subroutine is used in two Viterbi decoders (1/2 and 1/3) for path and metric updates. Subroutine itself is quite large, so we do not want to repeat it inside both 1/2 and 1/3 decoders as we are dealing with tight memory requirements.
Best regards,
Shaminda