wickensonline.co.uk Retrochallenge 2009 Summer Challenge Entry Conclusions |
Retrochallenge 2009
Summer Challenge
Mark Wickens
31-Jul-2009
Conclusions
Well, I haven't had time to make any final modifications, so my program is as it
stands now. You can view it in text mode[1] or as a colourized pdf[2] (courtesy
of the assembly-macro32 mode I wrote for jEdit[3]. I knew it would come in handy
at some point!)
I thought I'd like programming in Macro-32 and this challenge has proven me
right. It reminds me of when I made the transition from C to Java. Java
surprised me because for the most part when I wrote a program and compiled it
the program worked first time. The highly-orthogonal nature of Macro-32 means
that most of the time my code assembled first time. Sometimes I got the wrong
addressing mode, but I never got an 'addressing mode not supported' problem. The
operation names seemed to be fairly intuitive after a while aswell.
The hardest problem I had to overcome was the comparitive lack of example
programs written in Macro-32. One google search I made brought up my website in
the first page of matches - I guess that's when you know you're going to be
largely on your own. The two examples I did use were the one on the '99 bottles
of beer' website[4] (highly recommended viewing) and Jim Duff's excellent
website[5] which contains numerous code examples for OpenVMS, a couple of which
are in Macro-32. I struggled to find any code examples for definining a
multi-parameter procedure. I got there in the end by figuring it out. Thanks
should also go to the Hoff[6] who is the fount of all OpenVMS-related knowledge
and provided intelligent answers via IRC to my arcane VAX macro questions.
The following code is worth a mention:
;---------------------------------------------------
; Convert long to string
; R2 contains long value to convert
; R3 contains number of digits in output
; R4 contains address to store leading separate numeric value
CVTLS: CVTLP R2,LONG_SIZE,PKD
CVTPS LONG_SIZE,PKD,LONG_SIZE,(R4)
RSB
The two instructions highlighted in bold convert a binary long value to a string
representation. This is a good example of the power of VAX Macro-32. The first
instruction, CVTLP converts a binary long into a packed decimal representation.
The second instruction CVTPS takes that packed decimal value and converts it to
a 'leading separate numeric' format which is a signed integer value in ASCII,
such as +1234 or -9876. This is pretty high level stuff for assembly language!
The VAX has once again performed flawlessly. Big thanks to the other competitors
for providing entertaining blogs.
OUTSTANDING PROBLEMS
1. One of my original ideas was to include terminal-based output to provide a
fast zooming display of the fractal (obviously at fairly low resolution) and
this is something I'd like to get working at some point. I'd probably need to
use a different generating function however given the sparseness of the
images generated using the 'chaotic swirls' algorithm.
2. I've yet to add command line parameters which would make the program much
more user friendly and also provide the possiblity of running the program in
batch mode.
3. The ASCII based PGM file format uses a lot of space, so ideally I'd like to
modify the program to generate the binary version of PGM.
NEXT STEPS
I'm now going to rewrite the whole program in multi-threaded Scala[7]. This is
sort of an anti-retrochallenge.
Thoughts for the 2010 winter retrochallenge are turning towards a hardware
oriented challenge. Probably incorporating a large number of seven-segment
displays and a Motorola 68000 Single Board Computer.
ENDNOTES
1. mbrt1.mar
2. mbrt1.pdf
3. jEdit Text Editor
4. 99 Bottles of Beer
5. eight-cubed
6. Hoffman Labs
7. The SCALA Programming Language