FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Lesson 10: microcontroller Load Instructions

     

    Data transfer class instruction between the accumulator A of the microcontroller and the outer RAM Movx a, @ ri Movx @ ri, a Movx a, @ DPTR Movx @ DPTR, A instruction: 1) In the 51-series microcontroller, only a A accumulator derived with the external memory RAM. All data that need to be transmitted to the external RAM must be sent by A, and the data in the external RAM to be read must be read in. Here we can see the difference between the internal and external RAMs, and the internal RAM can be delivered directly, and the outside is not, for example, to send a single unit (set to 0100H unit data) in the external RAM to another. The unit (set to 0200H unit) must first read the contents of the 0100H unit into A and then transferred to the 0200H unit. To read or write an external RAM, it must also be aware of the address of the RAM. In the latter single-chip command, the address is placed directly in DPTR. The first two instructions, since ri (ie, R0 or R1) is just an 8-bit register, so only the low 8-bit address is supplied. Because sometimes the number of external RAMs is small, less than or equal to 256, it is enough to supply 8 digits. The address to be read or written will be sent to the DPTR or RI when using the address to be read or written, and then read and write commands. Example: Feeds the contents of the single-chip external RAM in the 100H unit into the 200h unit in the external RAM. Mov dptr, # 0100h Movx a, @ DPTR Mov dptr, # 0200h Movx @ DPTR, A Program memory to the accumulator A transmitting instructions MOVC A, @ A + DPTR This command is sent to A in the ROM. This directive is also known as a single chipview instruction, often uses this command to check a table description in the ROM: This instruction leads to a new addressing method: address address. This directive is to find data in an address unit of the ROM, clearly must know the address of this unit, this unit's address is determined: in the execution of this instruction, there is a number in DPTR, one number, execution When the instruction, the number in the A and DPTR is added to the address of the unit to be found. The results found were placed in A, so the values ​​in the A command were not necessarily the same before and after execution. Example: There is a number in R0, requiring a watch method to determine its square value (this number is 0-5) Mov dptr, # TABLE Mov A, R0 MOVC A, @ a + dptr Table: DB 0, 1, 4, 9, 16, 25 The value in R0 is 2, and the value is sent to A, and the value in the DPTR is Table, and the address of the final determined ROM unit is Table + 2, that is, to take the number in this unit, it is 4 Obviously it is the square of 2. Other data can also be pushed. Be The true meaning of the label: Another problem can be seen from this place, we use the label to replace the specific unit address. In fact, the true meaning of the label is the address value. Here it represents, 0, 1, 4, 9, 16, and 25 These data stored in the starting point in the ROM. In the case where we have learned, DELAY represents the starting address stored in the ROM in the ROM of the program that is labeled in the ROM. In fact, the CPU is only found by this address. You can take a look at the meaning of the label by the following routines: Mov dptr, # 100h Mov A, R0 MOVC A, @ a + dptr ORG 0100H. DB 0, 1, 4, 9, 16, 25 If the value in R0 is 2, the final address is 100 h + 2 is 102 h, and it is found in the 102H unit. Can this understand? Then why not write the program, do you want to use the label? Doesn't add doubts? If you write the program, when you write a program, we must determine the specific location of this form in the ROM. If you have completed the program, you want to insert a program before this program, then the location of this form is It has to change, to change the words of ORG 100H, we often need to modify the program, that trouble, so use the label to replace, as long as a compilation program, the location will automatically change, we will put this trouble Give your computer to the computer we used. Stack operation Push Direct POP Direct The first instruction is called the push, which is to send the content in the Direct into the stack. The second instruction is called pop-up, which is to send the content in the stack back to Direct. The execution process of pushing the instruction is to first add the value in the SP, and then the value in the SP is used as an address, and the value in the Direct is sent into the RAM unit of the address in the SP. example: Mov sp, # 5fh Mov A, # 100 Mov b, # 20 PUSH ACC Push B Then execute the first PUSH ACC instruction: adding the value in the SP to 60 h, then send the value of A to 60H unit, so after the end of the article is performed, the value of the memory 60H unit is 100. Similarly, when PUSH B is performed, SP + 1 becomes 61 h, and then the value in B is sent into the 61H unit, i.e., the value of the 61H unit becomes 20 after the article is performed. The POP instruction is performed in the microcontroller. First, the value in the SP is used as an address, and the number in this address is sent to the Direct behind the POP instruction, and then SP is reduced by 1. Loading: POP B POP ACC The execution process is: use the value (now 61H) as an address, take the value in the 61H unit (now 20), sent to B, so the value of the Bill B is 20, then SP minus 1, so this article is performed, the value of the SP be 60 h, then executes the POP ACC, and the value (60h) in the SP is used as an address, from the address (now 100), and sent to the ACC In the case, the value in the ACC is 100 after the end of the article is performed. Read more

     

     

     

     

    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