Coming up ...
That's it for this chapter. In the next exciting episode we'll take a look at the
SUB mnemonic and some more EasyCode and Win32 function calls, together with new data types needed by them, like
HWND. Specifically, I intend to walk through a useful little handler which will allow us to "peg" a button (or any other control, like a label or listbox) at a particular position, relative to the edge of the window, irrespective of how the user resizes that window. But, even better, we will look at how we can make this into a resusable piece of code called a "module" which can be used by any of your programs and be called just like a Win32 or EasyCode function. Finally, I will introduce a simple method of multiplying and dividing values by 2 - the SHIFT instructions.
Once again, we have covered a lot in this chapter and you should play around with what you've learned to make it "stick" in your mind. We saw how humans are rather tied to the number system based on units of ten but that it was no more difficult to use units of 16 or 8 or even 2. We learned to convert values from one number base to another, how to express them as positive, negative or unsigned numbers and the "chunks" in which the assembler normally handles them, such as bytes or words. Later on, we also saw that, since goAsm is particularly good at talking to Windows, there were other types of data than just bytes and we learned about the structure called
RECT. Registers were introduced and used in our worked example. Fast and furious (though limited in what they can do), they were presented as the primary way in which we should handle our data.
Then, we tried out our first Win32 and EasyCode calls using the
Invoke command. Access to this level of functionality is what gives real power to what we can do in assembler. We created our own event handler for the
WM_SIZE event and were able to gain access to information normally only seen inside the main event loop. Using that, together with our first mnemonics -
ADD - we are able to use EasyCode methods to manipulate strings and build them by slipping in fragments using pointers.
All in all, a lot of ground to cover. If you understood it all first time ... well done, indeed! If not, don't worry. This sort of stuff, especially if you are new to programming, is not easy. The secret, as I keep saying, is to play with what you have learned. Push the envelope a little.
See you next time,