Jump to content
Excelsior Forums
Sign in to follow this  
desteven

bitwise operator (convert code from Stony Brook Modula-2)

Recommended Posts

AND on bitsets is denoted by "*" in ISO Modula-2. You probably need bitwise AND on cardinals.

Turn on the option M2EXTENSIONS, and the operators AND, OR, and NOT should start working on cardinals.

Share this post


Link to post
Share on other sites

Thanks for the help.

But now I discovered a new issue: "rk SHR 2".

XDS doesn't know what SHR means I suppose, me neither.

*edit: It was '<<'

Now the latest and only remaining error message is:

Severe Error: external command fault 255:

xlink @obj\tmp.lnk

Share this post


Link to post
Share on other sites

(Most of the time, these Link errors fix themselves, by deleting that tmp.lnk file).

I do have another question which is similar: is there any option to have a XOR-operation in Modula (working on booleans is fine)? I currently have to use NOT(x=y) to get x XOR y (where I find the latter not that obvious to understand). It does work, but just from an aesthetic point of view; and of course: how would one implements a cypher using XOR (not that I need such implementation, but I was just wondering).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×