Inform - Support - Source

Back to List

Inventory
Complete

Backward
At End

Plain
Coloured
Gaudy

This code
in plain text

Browsing parserm.h

UnsignedCompare (lines 4522-4533)

4522  !  Useful routine: unsigned comparison (for addresses in Z-machine)
4523  !    Returns 1 if x>y, 0 if x=y, -1 if x
4524  ! ----------------------------------------------------------------------------
4525   
4526  [ UnsignedCompare x y u v;
4527    if (x==y) return 0;
4528    if (x<0 && y>=0) return 1;
4529    if (x>=0 && y<0) return -1;
4530    u = x&$7fff; v= y&$7fff;
4531    if (u>v) return 1;
4532    return -1;
4533  ];


Last updated 27 February 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.