Bitwise Operators

version 1 by Bart Massey

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Bit Shift Primitives (for Glulx only)

    Include (-
    [ SHL A B;
    @shiftl A B A;
    return A;
    ];
    [ SHR A B;
    @sshiftr A B A;
    return A;
    ]; -).

    [ These are really only for Z-machine version 5 or later, but since the Inform 7 IDE doesn't seem to support earlier versions, I'm not going to worry about it. ]