September 2017
Beginner to intermediate
290 pages
6h 58m
English
A few words need to be said on how individual members of a structure may be addressed. When statically allocated, we may refer to a structure by its label/name, which is translated into its address. For example, if we have a strtabentry structure named se defined in our data section, and we need to read the nth byte from the string, all we have to do would be this:
mov al, [se.string + n] ; 0 <= n < 30
If, on the other hand, we cannot use a label (for example, we are in a procedure, and a pointer to a structure is its parameter), then we can use the mighty virtual directive. As a quick demonstration, here's a procedure that returns the length of the string, not including the terminating zero:
get_string_length: ...
Read now
Unlock full access