Write to file with handle (INT 21h, 40h)

Entry:
AH = 40h
BX = file handle
CX = number of bytes to write
DS:DX = pointer to buffer
Return:
CF = 1 if error
AX = Error Code
CF = 0 successful
AX = number of bytes written

Note: If CX is zero, no data is written, and the file is
truncated or extended to the current position