Question about REP (instruction repeating)

Can you have instructions that are skipped within a REP block?
Try as I might I cannot get this to work
It only goes through the block one time whether I let the assembler decide what D is or if I count instructions myself.
If I use a counter and djnz, it works.
AdThanksVance
Edit: Answered my own question. "Any branch within....block will cancel REP activity." Naturally, I have a CALL #TxByte in the block.
Try as I might I cannot get this to work
REP @.Hex8End, #8
something, something
IF_LE add Ascii, #$31 '0..9
if_GT add Ascii, #$46 'A..F
something, something
.Hex8End
It only goes through the block one time whether I let the assembler decide what D is or if I count instructions myself.
If I use a counter and djnz, it works.
AdThanksVance
Edit: Answered my own question. "Any branch within....block will cancel REP activity." Naturally, I have a CALL #TxByte in the block.
Comments
rep @LR__0002, #8 LR__0001 sar local01, #1 wc if_c add local02, #1 if_nc add local03, #1 LR__0002
and the final values of local02 (count of ones) and local03 (count of zeros) are correct.BTW, the routine seems a bit odd, normally I'd convert a nibble to ASCII by always adding $30 and then adding 7 if result >$39, although I'm not sure quite what you are doing.
The docs say that REP does work in hubexec, but doesn't really save you any time because it executes an internal jump. I guess that's what you meant?
Ahem, ahem...... yes
I just don't use it in hubexec but I must have forgotten the reason. I think at one time it actually didn't but then Chip made it so that it would just for compatibility's sake, although there was no advantage in speed. That's it.
I find that as soon as hubexec involves looping, it slows it right down, but for non-branching and cordic, it is hardly much slower than cog.
Two precisely equivalent ways, assuming the nibble is in Ascii, all nice and isolated.
add Ascii, #$30 cmp Ascii, #$39 wcz if_GT add Ascii, #7 correct A..F
cmp Ascii, #9 wcz if_LE add Ascii, #$30 if_GT add Ascii, #$37
Three instructions each, same time to excute, same amount of cog space. But I think the second is more "Prop-ish".
rdlut Ascii, Ascii
If you've got space in the LUT ram...cmp char, #10 wc 'test if below 10, C = borrow of (D - S) if_c add char, #"0" 'ASCII encode 0-9 if_nc add char, #"a"-10 'ASCII encode a-f
Ah, GETBYTE would be more compact:
ALTGB char, #asc16tab GETBYTE char