## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### Operation

    IF AddressSize = 16
    THEN use CX for CountReg;
    ELSE (* AddressSize = 32 *) use ECX for CountReg;
    FI;
    WHILE CountReg <> 0
    DO
       service pending interrupts (if any);
       perform primitive string instruction;
       CountReg  CountReg -1;
       IF primitive operation is CMPSB, CMPSW, CMPSD, SCASB,
       SCASW, or SCASD
       THEN
          IF (instruction is REP/REPE/REPZ) AND (ZF=0)
          THEN exit WHILE loop
          ELSE
             IF (instruction if REPNZ or REPNE) AND (ZF=1)
             THEN exit WHILE loop;
             FI;
          FI;
      FO;
    OD;