Just finished some assembly string writing code and some skeleton setup routines for the Nintendo DS compiler, to get a bit into the assembly groove. It turned out to be both more easy and harder than I expected.
Easier because it only took about a hundred instructions to write quite a flexible writer if i do say so myself. The font is variable width, lines break on spaces (or line break of course), it checks for end of string, does different colors, all dynamically calculated. I DID use latin-1 encoding however in stead of some more scalable scheme. Oh the shame!
Didn't think you could express yourself so tight in assembly. I wrote something similar in C which took about half the amount of lines to express.
But writing in assembly was harder because my head isn't yet fitted with the amount of l1 cache required for this kind of task. My brain needs some training to acquire the ability to keep track of all these exceptions, pre-conditions and whatnot.
Related: to me programming assembly feels like an inherently hackish endeavour. "Goto considered Evil." What do you do with that kind of advise in an environment in which it is just about the only control flow mechanism. To not even speak about the extreme urge towards Quick and Dirty (from his desktop vantage point he tries to restrain me as much as he can).
And then there's this (premature?) optimization vice and code shrinking mania. It's not really a plus to know the cost of everything. I managed to push the bin from 33 kb till under ten, almost all of which is font data of course. I'm really proud... but who cares!?
On the verge of spinning this post to thin: if anybody knows the font type in the picture the thumbnail links to, I'd be grateful to know which it is. When I did the C version of this writer, I used a font I found on some closed source Gameboy Advance homebrew. And when I say used, I mean I let the program print all chars in it's charset, loaded it in an emulator, made a screendump, loaded the gif in the Gimp and manually wrote down the x and y coordinates of EVERY point of every char in the charset; so I would have something a bit flexible if need be. I remember taking the laptop on a Friday night to wine drinking friends and just type away while they were having fun, just to not feel so bored and lonely while on the job.
Yes, but anyway, the case is that it seems I've only got chars of this font in the latin-1 set. If there exist some more I might want to incorporate them some day. Although I don't really feel like it.
I have a PalmOS-cp1252 bitmap font that seems to match the font in the picture. I can mail you if you're interested.
I recieved it, but didn't check it out yet. Thanks a lot!
Still, if anyone knows the actual name of the font, it would be appreciated
'"Goto considered Evil." What do you do with that kind of advise in an environment in which it is just about the only control flow mechanism.'
The problem with using gotos in programming is that they can lead to spaghetti code that jumps all over the place. The reason that "modern" control structures like 'if' and function calls are better is that they are stricter about how they behave. So the best way to use gotos and still write maintainable code is to use them to mimic more structured control structures.