Skip to main content


I spent the evening analyzing opcode usage in UXN programs.

The most used opcodes are DEO2, JMP2r and ADD2. Almost half of all opcodes are never used in the 22413 LOC that were analyzed. The majority of unused opcodes are return stack variants ("r").

In the table below, the most used opcodes are marked in red, the least used in blue. Opcodes that were never used are shown in light grey.

#uxn

#uxn
in reply to Can Lehmann

The analyzed projects are: cccc, drifblim, left, noodle, oquonie, potato, uxnbal and uxn-games

I decided to exclude unit tests and examples, as e.g. in drifblim these would artificially distort the opcode counts.

in reply to Can Lehmann

As all of the analyzed projects are primarily written by a single author (@neauoire), it might be interesting to see whether not using the return variants as much comes down to personal code style or a more general reason.
This entry was edited (6 months ago)
in reply to Can Lehmann

That checks out, I think personal style might skew this a bit, but yeah, most opcodes are never used.

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.