Contents

MASM And Games Programming

Very few games nowadays are written entirely in assembly (the main exception being older consoles such as the Sega Genesis, NES and SNES). However, it is still used where optimisation is required in a higher-level language such as C or C++. One can program either a small section of assembly 'embedded' into the high level language, or a whole routine seperately linked into the final program.

Inline Assembly

When assembly is written inside another, higher level language, it is said to be inline, mainly because any variables in scope at the time are also in the scope of the assembly.

External Routines

Where larger blocks of assembly are needed, it is common to write them in a seperate assembly file which is assembled externally, and the resulting object file linked into the final executable or library.

These routines need to be declared as 'extern' in C/C++, and 'global' (Intel syntax) or '.globl' ( AT&T syntax) in the corresponding assembly file.