During the assembly, you may need to specify some data size, such as the size of stack. In this case, you need to use the size command (Size Directives).
There are three types of size for command (can be lowercase):
BYTE PTR [eax]
: represents 1 byte starting from the address stored in eax.WORD PTR [eax]
: represents the 2 bytes starting from the address stored in eax.DWORD PTR [eax]
: represents the 4 bytes starting from the address stored in eax.What needs to be noted here is if you use the mov
instruction to set a position, then:
mov BYTE PTR [eax],32
: means to move 32 in the format of 8-bit integer (1 byte) (00100000) to the position of 1 byte starting from the address stored in eax.mov WORD PTR [eax],32
: Indicates moving 32 in the format of a 16-bit integer (2 bytes) (00000000 00100000) to the position of 2 bytes starting from the address stored in eax.mov DWORD PTR [eax],32
: Indicates moving 32 in the format of a 32-bit integer (4 bytes) (00000000 00000000 00000000 00100000) to the 4-byte address starting from the address stored in eax Location.