Compilation--Logic instructions

Source: Internet
Author: User

Logical operation instruction and, or, not, XOR, TEST

Shift Commands SHL, SHR, SAL, SAR, ROL, ROR, RCL, RCR

* OPR cannot be an immediate number

* Does not affect the flag bit

SF ZF PF based on operation results

Logical AND arithmetic left SHL sal logic right shift shr arithmetic right shift SAR

Loop left ROL loop right Shift ROR

with carry loop left shift RCL with carry loop right shift RCR

The loop is the start of R, and the loop is self-rotating.

The logic adds 0, and the arithmetic right shift complements the one on the side.

CNT = 1, SHL OPR, 1

CNT > 1, MOV CL, CNT

SHL OPR, CL; a case study of SHL

Cyclic shift instruction: does not affect SF, ZF, PF, AF

String processing instructions:

MOVSB MOVSW direction Sign df = 0 o'clock with +, DF = 1 o'clock with-

Movs/stos/lods to work with REP

REP Movs/stos/lods Perform the operation:

(1) if (CX) = 0 Exit REP, otherwise turn (2)

(2) (CX)? (CX)-1

(3) Execution movs/stos/lods

(4) Repeat (1) ~ (3)

REP MOVS: Transferring the entire string of data in a data segment to an additional segment source string (data segment) → Destination string (additional segment)

(1) Source string header address (end address) →si

(2) Destination string header address (end address) →di

(3) String length →cx

(4) Establish the direction flag (CLD = 0,std df = 1)

Other processor control instructions

BOUND limit directive

ENTER to create a stack frame

LEAVE Releasing Stack frames

Privileged Directives

Compilation--Logic instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.