FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Single chip introduction tutorial 11th lesson - MCU directive (4)

     

    Single chip introduction tutorial 11th lesson - MCU directive (4) 1, without carry bit add instruction ADD A, # DATA; Example: ADD A, # 10H ADD A, direct; Example: ADD A, 10H ADD A, Rn; Example: ADD A, R7 ADD A, @ Ri ; Example: ADD a, @ R0 purpose: a value in the latter values ​​are added thereto, the end result is NO in a back. Example: MOV A, # 30H ADD A, # 10H After the command section, A is the execution 40H. The following topics themselves practice MOV 34H, # 10H MOV R0, # 13H MOV A, 34H ADD A, R0 MOV R1, # 34H ADD A, @ R1 2, carry bit addition instruction ADDC A, Rn ADDC A, direct ADDC A , @ Ri ADDC a, # data uses: the values ​​of a and the following are added, and adding the value of the carry bit C. Note: Because 51 is a single-chip 8-bit machine, we can only do the math 8, but the range of 8-bit operations only 0-255, this is not enough, so we should be extended in practical work, usually the two 8-bit math together, into a 16-bit operations, so that the range that can be expressed can be achieved in a number 0-65535. How to merge? Is actually very simple, let's look at an example of a decimal number: 66 + 78. These two numbers together, we do not care about this process, but in fact we are doing this: first 6 + 8 (low), then do 6 + 7, which is high. I did two additions, but I didn't deliberately divide the addition to two additions, or we didn't realize that we did two additions. The reason why it is divided into two times is because these two numbers exceeded a number of dispensers (0-9). In doing generated a low carry, when we do what is the point in place, and then do a bit high these additions are added to the list. The same is true when you do 16 additions in your computer, first do 8 digits, if the two numbers are added, but also "click" to make a tag, this tag is the carry bits c, in the PSW. This C is added to the high addition. Example: 1067H + 10A0H, first do 67h + A0H = 107h, and 107h obviously exceeds 0FFH, so it is finally saved in A, and 1 to the CY bit in PSW, in other words, CY is equivalent to 100h. Then do 10 h + 10h + cyming, the result is 21h, so the final result is 2107h. 3, the subtraction with carry instruction SUBB A, Rn SUBB A, direct SUBB A, @ Ri SUBB A, # data set (each H, (R2) = 55H, CY = 1, instruction execution SUBB A, then R2, . a value of 73H Description: no with borrow subtract instruction (first in doing subtraction) subtract instructions if needed with no bit can be cleared as long as the CY 4, a multiply instruction. MUL AB function of this instruction is two 8-bit unsigned numbers a and B are multiplied, the multiplication result of two numbers generally larger, so the final result with a 16 digit is expressed, in which the upper 8 bits B, A in the lower 8 bits at the time product is greater than FFFFFH (65535), 0V is set (overflow), otherwise OV is 0, CY always 0. Example:. (A) = 4EH, (B) = 5DH, after executing the instruction MUL AB, the product is 1C56H, it is put in B is 1CH, and a is put is 56H. 5, functional division instruction DIV AB this instruction is the number of a 8-bit unsigned 8 unsigned addition of B (a / B). Usually there will be fractional division, but the computer can not be directly expressed in decimal, it is the concept of using the quotient and remainder when we use the decimal pupils not in contact with , such as 13/5, the quotient is 2, since the remainder is 3. in addition, in List a, B, remainder in .CY and OV is 0. If the value is done before division B is 00H, also is the divisor is 0, then 0V = 1 6, 1 add instruction INC a INC Rn INC direct INC @Ri INC DPTR use is very simple, the latter value is added to the target in Example 1:. (a) = 12H, (R0 ) = 33H, (21H) = 32H, (34H) = 22H, DPTR = 1234H following instruction:. INC a (a) = 13H INC R2 (R0) = 34H INC 21H (21H) = 33H INC @ R0 ( 34H) = 23H INC DPTR (DPTR) = 1235H results shown in the above description: from the results point of view and INC A ADD A, # 1 is almost, but INC A is a single byte, single-cycle instruction, and then the ADD # 1 double-byte, two-cycle instruction, and does not affect the PSW INC A, such as (A) = 0FFH, after INC A (A) = 00H, whereas CY remains unchanged. If ADD A, # 1, then (a) = 00H, and CY plus 1 must be 1. Thus the addition instruction is not suitable, in fact it is mainly used for counting purposes address increases. Further, the addition of a class of instructions are the core wherein a number a must be placed in the operation result must be placed in a, and add Class 1 is much broader target instruction may be a register, a memory address, the address, etc. indirect addressing. 7, a Save instruction DEC A DEC RN DEC direct DEC @Ri similar command plus 1, not to say. Exercises: MOV A, # 12H MOV R0, # 24H MOV 21H, # 56H ADD A, # 12H MOV DPTR, # 4316H ADD A, DPH ADD A, R0 CLR C SUBB A, DPL SUBB A, # 25H INC A SETB C ADDC A, 21H INC R0 SUBB A, R0 MOV 24H, # 16H CLR C ADD A, @ R0 to write the operation result of each step, and then built into the above subject, and the simulation software running was observed and the relevant register unit changes in the content is the same as their own desired results. , Reading the full text, the technology area About μClinux transplantation on ARM7 S3C4510B Multi-looped into charge and discharge controller design Interrupt service routines for ARM embedded systems LED dimming engine design based on 8-bit MCU How to display Chinese characters, ASCII characters and color graphics on the LCD monitor

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us