: The processor may access one or more bytes of memory at a time. Let us consider a hexadecimal number 0725H. This number will require two bytes of memory. The high-order byte or most significant byte is 07 and the low-order byte is 25.
The processor stores data in reverse-byte sequence, i.e., a low-order byte is stored in a low memory address and a high-order byte in high memory address. So, if the processor brings the value 0725H from register to memory, it will transfer 25 first to the lower memory address and 07 to the next memory address.
- AX - the accumulator register (divided into AH / AL).
- BX - the base address register (divided into BH / BL).
- CX - the count register (divided into CH / CL).
- DX - the data register (divided into DH / DL).
- SI - source index register.
- DI - destination index register.
- BP - base pointer.
- SP - stack pointer.
INT 21h is a DOS interrupt that provides access to various system services such as file operations, device handling, and more. This cheat sheet includes some commonly used INT 21h functions.
- Purpose : Outputs a character to the standard output.
- Input :
DL= ASCII character to display.
- Purpose : Displays a string terminated by a
$character. - Input :
DS:DX= Address of the string.
- Purpose : Reads a character from the keyboard and echoes it to the display.
- Output :
AL= ASCII character read.
- Purpose : Reads a character from the keyboard without echoing it.
- Output :
AL= ASCII character read.
- Purpose : Reads a string of characters into a buffer.
- Input :
DS:DX= Address of the input buffer.
- Purpose : Creates a new file.
- Input :
DS:DX= Address of the filename (ASCIIZ string),CX= File attribute. - Output :
AX= File handle.
- Purpose : Opens an existing file.
- Input :
DS:DX= Address of the filename (ASCIIZ string),AL= Access mode. - Output :
AX= File handle.
- Purpose : Closes an open file.
- Input :
BX= File handle.
- Purpose : Writes data to a file or device.
- Input :
BX= File handle,CX= Number of bytes to write,DS:DX= Address of the data. - Output :
AX= Number of bytes written.
- Purpose : Deletes a file.
- Input :
DS:DX= Address of the filename (ASCIIZ string).
- Purpose : Sets the address of an interrupt handler.
- Input :
AL= Interrupt number,DS:DX= Address of the interrupt handler.
- Purpose : Gets the address of an interrupt handler.
- Input :
AL= Interrupt number. - Output :
ES:BX= Address of the interrupt handler.
- Purpose : Terminates a process and returns control to the operating system.
- Input :
AL= Return code.
