3 ms·
I think rep is expected to be combined with a condition. repne lodsb will read while not fetching 0, so a search for end of C string. Using the remaining cx o
by 1000100_1000101 4y ago
I think rep is expected to be combined with a condition. repne lodsb will read while not fetching 0, so a search for end of C string. Using the remaining cx or si value you can determine the length fetched until the condition failed.
- rep_lodsb 4y agoLODS, STOS, MOVS, INS and OUTS are all unconditional (doesn't matter which version of the prefix you use, but officially REP should be the same opcode as REPE). SCAS is the one that scans for e.g. a nul byte.