Storage of words in memory
A memory unit that stores a hex data (16 bits). It consists of two consecutive memory units with two addresses. The high address memory unit stores the high byte of the font data, and the low address memory unit stores the low byte of the font data. The starting address is N.
DS and [address]
"[...]" Indicates a memory unit, and "0" in "[...]" indicates the offset address of the memory unit. The 8086cpu automatically retrieves the data in DS as the segment address of the memory unit. The 8086cpu does not support sending data directly to the segment register. It can only use one register for transfer. That is, it first sends H data to a general register, such as BX, then, the content in BX is sent to DS.
MoV, add, sub commands
MoV commands can take the following forms:
MoV register, Data
MoV register, register
MoV register, memory unit
MoV register, segment register
MoV memory unit, register
MoV memory unit, segment register
MoV segment register, register
MoV segment register, memory unit
The add command can take the following forms:
Add register, Data
Add register, register
Add register, memory unit
Add memory unit, register
Sub commands can take the following forms:
Sub register, Data
Sub register, register
Sub register, memory unit
Sub memory unit, register
Stack mechanism provided by CPU
Operation Rules of the later, first, and foremost
Push ax means to send data in the register ax to the stack, and pop ax means to pull data from the top of the stack and send it to ax. The inbound and outbound operations of the 8086cpu are performed in units of words.
8086cpu has two registers: segment register SS and register sp. The segment address at the top of the stack is stored in SS, And the offset address is stored in SP. At any time, SS: SP points to the top element of the stack.
Push and pop commands
When pushing, the two steps of CPU operation are: First Change sp, and then transfer to SS: sp. When you execute pop, the two-step CPU operation is to read the data at SS: SP first, and then change the SP.
Chapter 2 register (Memory Access) Summary