Using scanf for Entry of Numeric Values

In a peculiar sort of way, the C library function scanf() is printf() running backwards Instead of outputting formatted data in a character stream, scanf() takes a stream of character data from the keyboard and converts it to numeric data stored in a numeric variable. scanf() works very well, and it understands a great many formats that I won't be explaining in this book, especially for the entry of floating-point numbers. (Floating-point values are a special problem in assembly work, and I...

Do Not Pass Go

''There's a reason bored and board are homonyms,'' said my best friend, Art, one evening as we sat (two super-sophisticated twelve-year-olds) playing some game in his basement. (He may have been unhappy because he was losing.) Was it Mille Bornes Or Stratego Or Monopoly Or something else entirely I confess, I don't remember. I simply recall hopping some little piece of plastic shaped like a pregnant bowling pin up and down a series of colored squares that told me to do dumb things like go back...

The Game of Big

I've invented my own board game to continue down the road with this particular metaphor. In the sense that art mirrors life, the Game of Big Bux mirrors life in Silicon Valley, where money seems to be spontaneously created (generally in somebody else's pocket) and the three big Money Black Holes are fast cars, California real estate, and messy divorces. There is luck, there is work, and assets often change hands very quickly. A portion of the Big Bux game board is shown in Figure 1-1. The line...

Code and Data

Like most board games (including the Game of Big Bux), the assembly language board game consists of two broad categories of elements game steps and places to store things. The ''game steps'' are the steps and tests I've been speaking of all along. The places to store things are just that cubbyholes into which you can place numbers, with the confidence that those numbers will remain where you put them until you take them out or change them somehow. In programming terms, the game steps are called...

Looking at File Internals with the Bless Editor

Very fortunately, there are utilities that can open, display, and enable you to change characters or binary bytes inside any kind of file. These are called binary editors or hexadecimal editors, and the best of them in my experience at least for the Linux world is the Bless Hex Editor. It was designed to operate under graphical user interfaces such as Gnome, and it is very easy to figure out by exploring the menus. Bless is not installed by default under Ubuntu. You can download it free of...

Kates File Management

Kate makes it easy to load existing files into the editor window, browse your session working directory, create new files, rename files, and move unneeded files to the Trash. The primary mechanism for file management is the sidebar on the left side of the Kate window. Absent other plugins that use it, the management sidebar serves two functions When in the Document view, the sidebar displays the documents associated with the current session. You can click on one of the document listing lines to...