MMIX assembly language floating point number preprocessor – GNU Bison and GNU Flex version

Here’s a GNU Bison and GNU Flex version of my MMIX assembly language floating point number preprocessor. The code was developed using GNU Bison version 1.875d and GNU Flex version 2.5.

This version allows for entering more complex expressions of floating point numbers involving addition, subtraction, multiplication and division. Extending the grammar to cover trigonometric functions and square root is left as an exercise to the reader.

* Here are some constants from Don Knuth's world:
MIX			FLOAT	1009	comments are still allowed
MMIX			FLOAT	2009	after the operand field

* Here are some well known constants from the mathematical world:
Pi			FLOAT	3.14159265358979323846	TeX's ultimate version number
e			FLOAT	2.7182818284590452354	ditto for METAFONT

* Here are lists of simple numbers and some irrational numbers:
ListOfNumbers		FLOAT	1,2,3
Expressions		FLOAT	1/3,2/3

* 32-bit floating point numbers are also available.
* But do not use them if you do not need them,
* FLOATs have better properties than SINGLEs.
MIX32			SINGLE	1009
MMIX32			SINGLE	2009
NextMMIX		SINGLE	2009+1000	the next MMIX?

Continue reading MMIX assembly language floating point number preprocessor – GNU Bison and GNU Flex version

MMIX assembly language floating point number preprocessor – initial C version

Here’s the code for a C program I conceived during a rather boring night shift while performing national service some years back. The code was later refined using GNU Bison and GNU Flex for parsing the operand field, yielding the possibility of processing whole expressions involving addition, subtraction, multiplication and division.

Instead of specifying IEEE 754 floating point constants in hexadecimal using the pseudo operators OCTA or TETRA, like this:

* Here are some constants from Don Knuth's world:
MIX			OCTA	#408f880000000000	comments are still allowed
MMIX			OCTA	#409f640000000000	after the operand field

* Here are some well known constants from the mathematical world:
Pi			OCTA	#400921fb54442d18	TeX's ultimate version number
e			OCTA	#4005bf0a8b145769	ditto for METAFONT

* Here is a list of simple numbers:
ListOfNumbers		OCTA	#3ff0000000000000,#4000000000000000,#4008000000000000

* 32-bit floating point numbers are also available.
* But do not use them if you do not need them,
* FLOATs have better properties than SINGLEs.
MIX32			TETRA	#447c4000
MMIX32			TETRA	#44fb2000

you can write these numbers a lot simpler using one of the new pseudo operations FLOAT and SINGLE I made up, like this:

* Here are some constants from Don Knuth's world:
MIX			FLOAT	1009	comments are still allowed
MMIX			FLOAT	2009	after the operand field

* Here are some well known constants from the mathematical world:
Pi			FLOAT	3.14159265358979323846	TeX's ultimate version number
e			FLOAT	2.7182818284590452354	ditto for METAFONT

* Here is a list of simple numbers:
ListOfNumbers		FLOAT	1,2,3

* 32-bit floating point numbers are also available.
* But do not use them if you do not need them,
* FLOATs have better properties than SINGLEs.
MIX32			SINGLE	1009
MMIX32			SINGLE	2009

and preprocess your assembly code with mmixalfpp0 prior to running mmixal. Continue reading MMIX assembly language floating point number preprocessor – initial C version

dec2dms.mms and tri_area.mms

I was looking at some old files and found these files containing MMIX assembly code.

The first file is a program for converting angles from a single value to sexagesimal notation, and back. The second file is a program for calculating the area of a triangle.

I have more MMIX code dating back at least 9 years, and some files are maybe close to 14 years old. I’ll see if I can manage to post those files too. Continue reading dec2dms.mms and tri_area.mms

Missing the down-arrow on the right hand side of the URL address field in Opera?

Are you missing the down-arrow on the right hand side of the URL address field in Opera? That handy piece of GUI element makes it easy to remove entries from the URL history.

According to this forum post, you can enable the down-arrow by visiting opera:config#UserPrefs|ShowDropdownButtonInAddressfield.

Simply check the checkbox, hit the Save button, and ignore the message about some changes will only take place after Opera is restarted. This particular change was instantaneous in Opera 12.16, as observed by myself today.

Finally I’m able to trim my URL history without erasing the entire collection of URLs. It would be nice if we could also edit each entry in the URL history, but maybe I’m asking too much.

I wholeheartedly agree with “cellist” who stated:

… configuring Opera is becoming ridiculous … too many features hidden by too many methods of setting them.

Moving ZFS datasets around eases the transition from CVSup to Subversion

I upgraded some of my virtual machines during my summer holiday. They are all running ZFS, but were neglected for so long that they were still updating their source and ports trees using CVSup. I began pondering how to migrate to Subversion with the least fuzz possible. Luckily, I had anticipated the switch to Subversion, and all my VM’s had a fairly recent version of Subversion already installed. Continue reading Moving ZFS datasets around eases the transition from CVSup to Subversion