What does it mean by "MOV AH, 4CH" in assembly language?

Shams Nahid picture Shams Nahid · Mar 3, 2017 · Viewed 24.9k times · Source

Most of the assembly code is terminate by the following instructions

MOV AH, 4CH
INT 21H

What does it mean by "MOV AH, 4CH" ?

Answer

fuz picture fuz · Mar 3, 2017

DOS interrupt int 21/4Ch is EXIT - TERMINATE WITH RETURN CODE, the content of al is used as the return code and the process is terminated. The documentation comes with the following note:

Unless the process is its own parent (see #01378 [offset 16h] at AH=26h), all open files are closed and all memory belonging to the process is freed. All network file locks should be removed before calling this function