5.2. 5.2 Procedures

Most procedural programming languages implement procedures using the call/return mechanism. That is, some code calls a procedure, the procedure does its thing, and then the procedure returns to the caller. The call and return instructions provide the 80×86's procedure invocation mechanism. The calling code calls a procedure with the call instruction; the procedure returns to the caller with the ret instruction. For example, the following 80×86 instruction calls the HLA Standard Library stdout.newln routine:[88]

[88] Normally you would call newln using the high level "newln();" syntax, but the call instruction works as well.

call stdout.newln;

The stdout.newln procedure prints a newline sequence to the console device and returns ...

Get Art of Assembly Language, 1st Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.