What are the functions of the subb command and precautions for use?

Updated on healthy 2024-04-06
28 answers
  1. Anonymous users2024-02-07

    If you are asking MCU.

    Programming. subb is subtraction with debit.

    directives, e.g. subb a, rn; That is, (a) cy (rn) a In the multi-byte subtraction operation, the low byte will sometimes borrow the high byte (cy set 1), and the subtraction instruction with the debit will be used. If necessary, use the XLR C command to set cy to 0 before the subb command

  2. Anonymous users2024-02-06

    What are the functions specified by SUB and precautions for use? There are three points to note: the worker can only output a signal with one state at a time with sub, and use the working method specified by the worker.

  3. Anonymous users2024-02-05

    The function of the subb instruction and the precautions for use may be one in the manual of the person when buying. Very obvious Ben appeared.

  4. Anonymous users2024-02-04

    Regarding the questions you asked about the specified functions and precautions, you can learn through the corresponding problem solving methods, and better understand the functions and methods of relevant instructions, the introduction of keywords, and so on.

  5. Anonymous users2024-02-03

    , steering control program ctrl1;

    steering control program ctrl2;

    Steering control program ctrl3Set RAM 20H=1100101 0 B,24

  6. Anonymous users2024-02-02

    There are many functions and precautions for use, and they are particularly important and very meaningful.

  7. Anonymous users2024-02-01

    Really, this feature points between that Monday.

  8. Anonymous users2024-01-31

    The function of the super command and the precautions for its use are to tell us that we need to use it safely.

  9. Anonymous users2024-01-30

    Or what is a feature phone with bb fingers? The maiden should be registered on a black name, the name of the person.

  10. Anonymous users2024-01-29

    The power of this command is very powerful.

  11. Anonymous users2024-01-28

    The function of this responsibility and the precautions for use, I feel that there should be a manual.

  12. Anonymous users2024-01-27

    If the function of the command is concerned, then different instructions will have different functions, and you have to find its correspondence.

  13. Anonymous users2024-01-26

    The subb instruction is a subtraction instruction.

    When subtracting multiple bytes, the debit of the previous byte subtraction is reduced to the next byte, and cy is the debit of the last subtraction.

    With the CY bit subtraction instruction, the OV bit is generated when two sign numbers are added and subtracted:

    Positive number + positive number = negative number;

    Positive - Negative = Negative;

    Negative - Positive = Positive;

    Negative number + negative number = positive number;

    These several scenarios can lead to OV position 1.

  14. Anonymous users2024-01-25

    The subb instruction is a subtraction instruction. cy is the borrowing position from the last subtraction.

    MCS-51 has a total of 111 instructions, and the instructions are classified.

    1. According to the bytes occupied by the instruction:

    Single-byte instructions (49 entries) such as mov A, R2, machine code 11101010 double-byte instructions (46 entries) e.g. mov a, 0bh, machine code 74h, 0bh three-byte instructions (16 entries) such as mov 0bh, 0bh, machine code 75h, 0bh, 0bh

    2. According to the execution time of the instruction, it is divided into: (1 machine cycle is 12 clock cycles) 1 machine cycle (64 pieces), such as MOV A, R2 MOV A, 0BH, 2 machine cycles (45 pieces), such as MOV 0BH, 0BH4 machine cycles (2 pieces), multiplication and division instructions.

  15. Anonymous users2024-01-24

    cy is the carry bit, it depends on whether your program needs to be retained.

    subb is a subtraction instruction.

  16. Anonymous users2024-01-23

    Don't be so troublesome Classmate The overflow affects the C flag bit In actual programming, it is often judged that the C bit is overflowing For example: clr c mov a, 01h subb a, 02h After executing the above statement, the C flag bit will change to 1.

    Thank you for the trouble to adopt!

  17. Anonymous users2024-01-22

    As shown in Fig. The result of A is EEH, because Subb is a subtraction with a carry position, and C is set to 1 at the beginning, so 12h minus 23h and subtract 1 to get EEH, which is -12h.

  18. Anonymous users2024-01-21

    Since c = 1, and a is actually a = 18 + 256 = 274

    b=23h=35

    a-b=239

    A=239 is EFH

    Carry is used with c=0.

    Why not? It turns out that the carry is to be subtracted. 12h-23h=efh efh-1=eeh

    But the carry has been reduced, why is it not clear 0

  19. Anonymous users2024-01-20

    1100 1001 b(0c9h)- 0101 0100b(54h) -1b=0111 0100b, i.e.: (a)=74h

    ov=1.The explanation is as follows:

    The data is carried at a high level, and the sign bit is not carried and overflows.

    The data bit bit bit is not carried, and the sign bit is carried and overflowed.

    The data bit is carried in the high position, and the sign bit is carried in the bit, and it does not overflow.

    The data bit bit bit is not carried, and the sign bit is not carried, and it is not overflowed.

  20. Anonymous users2024-01-19

    51The format of the subb with debit instruction in the MCU assembly is: subb a, r (operand), which means that the number in the accumulator minus the number indicated by the source operand and the carry bit cy, the difference is stored in the accumulator a. The result of the operation affects the PSW (Program Status Flag Register).

    In multi-byte subtraction, the subtraction of the low byte sometimes creates a bit of a bit to the high bit, and in this case the cy (carry flag) is set to one, so the subtraction command with the bit must be used here. It should be noted that when performing single-byte subtraction or multi-byte low-8-bit subtraction operations, the carry bits should be cleared to zero first. In the 80C51 instruction system, there are no subtraction instructions without debits.

    For example: subb 49h, 58h; 49h-58h, here is 49h is subtracted, with borrowing.

    In fact, subtraction is the addition of complements in computers.

  21. Anonymous users2024-01-18

    For example: mov a, 49hsubb a, 58h

    The function implemented is 49h-58h-cy, that is, after the subtraction of 49h and 58h, the borrowing flag cy must be subtracted

    If you want to subtract without borrowing, you can first clear the borrowing mark.

    For example: CLR C

    mov a, #49h

    subb a, #58h

  22. Anonymous users2024-01-17

    Before learning subtraction instructions, you should first learn addition instructions.

    Addition instructions, there are "Addition without carrying", and "Addition with carrying".

    It's easier to understand when you learn this when you're just starting out.

    After learning subtraction, there will be no such problem as the landlord.

    If you learn subtraction first, there is a feeling of suddenness.

  23. Anonymous users2024-01-16

    Did you clear CY before executing this order?

  24. Anonymous users2024-01-15

    Have you programmed and debugged, a result is d5h, I have calculated and programmed and debugged, your answer is wrong.

  25. Anonymous users2024-01-14

    In the MCU experiment, the assembly language programming is used to compare the size of two numbers, mainly using subb subtraction instructions, and cjne instructions can also be used. The example program is as follows:

    Start the portal. org 0000h ;Reset initiation.

    ljmp start ;

    org 0100h ;

    Master program. start: mov r0,#30h

    mov x,#

    mov y,#

    loop: mov a,@r0

    clr csubb a,#

    jnc next

    cpl cmov a,@r0

    subb a,y

    jc num

    mov y,@r0

    num: mov a,@r0

    subb a,#

    jc incr0

    inc xincr0: inc r0

    jmp loop

    next: jmp $

    x equ 20h ;

    y equ 21h ;

    end ;

  26. Anonymous users2024-01-13

    That is true. The execution period of each instruction of Subb is one cycle. It has an effect on the flag bits CY, AC, OV in PSW.

    When the subtraction has a borrowing, then cy=1; Otherwise, cy=0If there is a bit of borrowing from the lower 4 bits to the upper 4 digits, AC=1;Otherwise, ac=0;When subtracting, if the highest bit and the second highest bit are not borrowed at the same time, then 0v=1, otherwise, 0v=0. I don't know if I can help you.

  27. Anonymous users2024-01-12

    Let's put it this way.

    When the content in accumulator a is subtracted by a byte operand and the debit flag, if it is enough to subtract, then cy=0; Otherwise, cy=1;With the help of this cy flag, multi-byte subtraction operations can be realized; When bit 3 is borrowed, ac=1;Otherwise, ac=0;When bit 7 and bit 6 do not occur at the same time. ov=1;Otherwise, ov=0;

  28. Anonymous users2024-01-11

    cy -- carry marker.

    When the last math operation results in carry (addition) or borrowing (subtraction), the position is 1. Other math operations clear it to 0.

    ac -- Assist carry marker.

    When the last mathematical operation has a carry (addition) or a debit (subtraction) to the upper nibble, this position is 1. Other math operations clear it to 0.

    This is in the flag register psw.

    Then you take a look at the application in the combined subb.

Related questions
11 answers2024-04-06

Operating system definition: An operating system is a set of large-scale programs used to control and manage computer hardware and software resources, reasonably schedule various jobs, and facilitate users. >>>More

4 answers2024-04-06

Hello, dear. The main functions of the switch are 1. Switch Like a hub, the exchange hall grinder provides a large number of ports for cable connection, which can be routed in a star topology. 2. The switch is like a repeater, a hub and a bridge, when it is framed, the switch will regenerate an undistorted square electrical signal. >>>More

8 answers2024-04-06

The two-position two-way solenoid valve is a step-action direct-operated solenoid valve. >>>More

10 answers2024-04-06

A three-tier architecture in the usual sense.

It is to divide the entire business application into the following layers: presentation layer (UI), business logic layer (BLL), and data access layer (DAL). The purpose of distinguishing the hierarchy is to "high cohesion, low coupling." >>>More

6 answers2024-04-06

In C, all preprocessing commands start with a " " sign.

The concept of preprocessing in C programming: processing before compilation. There are three main aspects of preprocessing in C: macro definition and failing. >>>More