SYSCALL
Usage: SYSCALL Modifies flags: None
Fast call to privilege level 0 system procedures.
Call Operating System
SYSCALL ; 0F 05 [P6,AMD]
SYSCALL provides a fast method of transferring control to a fixed entry point in an operating system.
The EIP register is copied into the ECX register.
Bits [31-0] of the 64-bit SYSCALL/SYSRET Target Address Register(STAR) are copied into the EIP register.
Bits [47-32] of the STAR register specify the selector that is copied into the CS register.
Bits [47-32]+1000b of the STAR register specify the selector that is copied into the SS register.
The CS and SS registers should not be modified by the operating system between the execution of the SYSCALL instruction and its corresponding SYSRET instruction.
For more information, see the SYSCALL and SYSRET Instruction Specification (AMD document number 21086.pdf).
EXAMPLE:
syscall
SUBSS
Usage: SUBSS dest,src Modifies flags: None
Subtracts the low single-precision floating-point value in the 'src' operand from the low single-precision floating-point value in the 'dest' operand, and stores the single-precision floating-point result in the 'dest' operand.
Scalar Single-FP Subtract
SUBSS xmm1,xmm2/m128 ; F3 0F 5C /r [KATMAI,SSE]
SUBSS subtracts the low-order single-precision FP value of the source operand from that of the destination operand, and stores the result in the destination operation.
The 'src' operand can be an XMM register or a 32-bit memory location. The 'dest' operand is an XMM register. The three high-order doublewords of the 'dest' operand remain unchanged.
EXAMPLE:
subss xmm1 xmm2
SUBSD
Usage: SUBSD dest,src Modifies flags: None
Subtracts the low double-precision floating-point value in the 'src' (second operand) from the low double-precision floating-point value in the 'dest' (first operand), and stores the double-precision floating-point result in the 'dest' operand.
Scalar Single-FP Subtract
SUBSD xmm1,xmm2/m128 ; F2 0F 5C /r [WILLAMETTE,SSE2]
SUBSD subtracts the low-order double-precision FP value of the source operand from that of the destination operand, and stores the result in the destination operation. The high quadword is unchanged.
The 'src' operand can be an XMM register or a 64-bit memory location. The 'dest' is an XMM register.
EXAMPLE:
subsd xmm1 xmm2
SUBPS
Usage: SUBPS dest,src Modifies flags: None
Performs an SIMD subtract of the four packed single-precision floating-point values in the 'src' operand from the four packed single-precision floating-point values in the 'dest' operand, and stores the packed single-precision floating-point results in the 'dest' operand.
Packed Single-Precision FP Subtract
SUBPS xmm1,xmm2/m128 ; 0F 5C /r [KATMAI,SSE]
SUBPS subtracts the packed single-precision FP values of the source operand from those of the destination operand, and stores the result in the destination operation.
The 'src' operand can be an XMM register or a 128-bit memory location. The 'dest' operand is an XMM register.
EXAMPLE:
subps xmm1 xmm2
SUBPD
Usage: SUBPD dest,src Modifies flags: None
Performs an SIMD subtract of the two packed double-precision floating-point values in the 'src' operand from the two packed double-precision floating-point values in the 'dest' operand, and stores the packed double-precision floating-point results in the 'dest' operand.
Packed Double-Precision FP Subtract
SUBPD xmm1,xmm2/m128 ; 66 0F 5C /r [WILLAMETTE,SSE2]
SUBPD subtracts the packed double-precision FP values of the source operand from those of the destination operand, and stores the result in the destination operation.
The 'src' operand can be an XMM register or a 128-bit memory location. The 'dest' operand is an XMM register.
EXAMPLE:
subpd xmm1 xmm2
SUB
Usage: SUB dest,src Modifies flags: AF CF OF PF SF ZF
The 'src' is subtracted from the 'dest' and the result is stored in the destination.
Subtract Integers
SUB r/m8,reg8 ; 28 /r [8086]
SUB r/m16,reg16 ; o16 29 /r [8086]
SUB r/m32,reg32 ; o32 29 /r [386]
SUB reg8,r/m8 ; 2A /r [8086]
SUB reg16,r/m16 ; o16 2B /r [8086]
SUB reg32,r/m32 ; o32 2B /r [386]
SUB r/m8,imm8 ; 80 /5 ib [8086]
SUB r/m16,imm16 ; o16 81 /5 iw [8086]
SUB r/m32,imm32 ; o32 81 /5 id [386]
SUB r/m16,imm8 ; o16 83 /5 ib [8086]
SUB r/m32,imm8 ; o32 83 /5 ib [386]
SUB AL,imm8 ; 2C ib [8086]
SUB AX,imm16 ; o16 2D iw [8086]
SUB EAX,imm32 ; o32 2D id [386]
SUB performs integer subtraction: it subtracts its second operand from its first, and leaves the result in its destination (first) operand. The flags are set according to the result of the operation: in particular, the carry flag is affected and can be used by a subsequent SBB instruction.
EXAMPLE:
call 'USER32.GetWindowRect' D$hwnd, WindowX
mov eax D$WindowX | sub D$WindowW eax
mov eax D$WindowY | sub D$WindowH eax
STR
Usage: STR dest Modifies flags: None
Stores the current Task Register to the specified operand.
Store Task Register
STR r/m16 ; 0F 00 /1 [286,PRIV]
STR stores the segment selector corresponding to the contents of the Task Register into its operand. When the operand size is a 16-bit register, the upper 16-bits are cleared to 0s. When the destination operand is a memory location, 16 bits are written regardless of the operand size.
EXAMPLE:
str Label
STOSW
Usage: STOSW dest Modifies flags: None
Stores value in accumulator to location at ES:(E)DI (even if operand is given). (E)DI is incremented / decremented based on the size of the operand (or instruction format) and the state of the Direction Flag. Use with REP prefixes.
Store Byte to String
STOSB ; AA [8086]
STOSW ; o16 AB [8086]
STOSD ; o32 AB [386]
STOSB stores the byte in AL at EDI, and sets the flags accordingly. It then increments or decrements (depending on the direction flag: increments if the flag is clear, decrements if it is set) EDI.
STOSW and STOSD work in the same way, but they store the word in AX or the doubleword in EAX instead of the byte in AL, and increment or decrement the addressing registers by 2 or 4 instead of 1.
The REP prefix may be used to repeat the instruction ECX times.
EXAMPLE:
mov edi D$CodeSource
mov ax 0A0D, ecx 5
rep stosw
mov eax edi
STOSD
Usage: STOSD Modifies flags: None
Stores value in accumulator to location at ES:(E)DI (even if operand is given). (E)DI is incremented or decremented based on the size of the operand (or instruction format) and the state of the Direction Flag.
Store Byte to String
STOSB ; AA [8086]
STOSW ; o16 AB [8086]
STOSD ; o32 AB [386]
STOSB stores the byte in AL at EDI, and sets the flags accordingly. It then increments or decrements (depending on the direction flag: increments if the flag is clear, decrements if it is set) EDI.
STOSW and STOSD work in the same way, but they store the word in AX or the doubleword in EAX instead of the byte in AL, and increment or decrement the addressing registers by 2 or 4 instead of 1.
The REP prefix may be used to repeat the instruction ECX times.
EXAMPLE:
push eax, edi
mov eax 0 | rep stosd
pop edi, eax
STOSB
Usage: STOSB Modifies flags: None
Stores value in accumulator to location at ES:(E)DI (even if operand is given). Use with REP prefixes.
Store Byte to String
STOSB ; AA [8086]
STOSW ; o16 AB [8086]
STOSD ; o32 AB [386]
STOSB stores the byte in AL at EDI, . It then increments or decrements EDI (depending on the direction flag: increments if the flag is clear, decrements if it is set) .
STOSW and STOSD work in the same way, but they store the word in AX or the doubleword in EAX instead of the byte in AL, and increment or decrement the addressing registers by 2 or 4 instead of 1.
The REP prefix may be used to repeat the instruction ECX times.
Example:
L1: inc edi
std
rep movsb | stosb
cld
mov ebx 1 | jmp L3>