The PutChar function
The PutChar function outputs the character whose code is passed in the AL register to the screen. This makes it possible to display characters in text mode.
Parameters: AL: character code.
Return value: The function does not return a value.
Flag state: The function does not modify the flags.
Program source code
An example program for the Intel 8086 assembler demonstrating the use of the PutChar function to display a character on the screen.
title .model small .stack 100h code segment public ; Start of the code segment assume cs:code include Handyfar.inc ; Include the file with functions main proc ; Start of the main procedure call SetDataSegment ; Call the SetDataSegment procedure mov al, 'A' ; Copy the character 'A' into the al register call PutChar ; Call the PutChar procedure (al:'A') xor al, al ; Clear the al register call ExitProcess ; Call the ExitProcess procedure main endp ; End of the main procedure code ends ; End of the code segment end main ; End of file. The main procedure is the entry point
A
Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".