mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 04:19:52 +00:00
The four rel8 forms E0 to E3 are declared in the instruction registry and run through the shared semantics in both engines (Intel SDM Vol. 2A, LOOP/LOOPcc and Jcc). The count is RCX: LOOP decrements it without changing a flag and branches while the result is not zero, LOOPE also needs ZF set and LOOPNE ZF clear, and JRCXZ branches on a zero RCX and changes nothing. Each ends a translated block. The address-size prefix stays rejected, so JECXZ and the ECX-counted forms are still refused. The three known answers recorded as refused by #155 are verified, with eleven more cases. tests/cpu_loop.rs checks a loop that spans translated blocks against a step-by-step model for every count, ZF match point and step budget, and JRCXZ against every single-bit RCX value. Signed-off-by: Bartosz Szczepański <bartosz.szczepanski@hotmail.com>