News for hackers. Stuff that matters.
Re:Misconceptions about loops in C by murderfs on Thursday June 27, 2024 @04:05PM (#40814495)
Depends on the assembly and depends on the loop. x86 has multiple instructions that hint at knowing about loops: e.g. the `loop` instruction that does a decrement and jump, and the rep prefixes that let you implement memcpyish functions in a single instruction.
Re:Misconceptions about loops in C by WJW on Thursday June 27, 2024 @04:14PM (#40814588)
Fair point. The higher level languages have been leaking back down into assembly.
Re:Misconceptions about loops in C by orhmeh09 on Thursday June 27, 2024 @04:32PM (#40814768)
For a very long time, even PDP7, on which C was created, with ISZ – Increment the memory operand and Skip next instruction if result is Zero.