FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    8 lesson: single-chip addressing method and instruction system

     

    Through the previous learning, we have already understood the structure inside the microcontroller, and it has also been known that to control the microcontroller, let it learn for us, to use the instructions, we have learned a few instructions, but very zero, start from now, We will systematically learn the command part of the 8051 single-chip microcomputer. I. Overview 1, the format of the instruction We are known, to make the computer do things, you have to give your computer to instructions, and we are known, the computer is very "stupid", you can only know how to mention numbers, as before we write into machines 75h, 90h, 00H, etc., The first format is the machine code format, but also the form of a number. But this form is really difficult for us, it's too difficult to remember, so there is another format, a museum format, such as MOV P1, # 0ffh, so it is much. The relationship between these two formats, we don't understand, essentially equivalent, but the form is not the same. 2, compilation We write instructions to use assembly formats, while computers and microcontrollers only understand the machine code format, so the instructions we write to the compilation format are used to machine code format, which has two ways: manual assembly and machine compilation. Handmade compilation is actually a check list, because these two formats are purely format, so they have one or one, check a form. However, the manual check table is always troubles, so there is computer software, with computer software to replace manual investigations, this is the machine assembly. Second, the addressing of single-chip microcomputer Let's review some of our instructions we have learned: MOV P1, # 0ffh, MOV R7, # 0ffh These instructions are sent to the corresponding location, why do you want to send data? The first because the number sent, the second is to achieve the delay, from here we can see, when programming the programming language with the microcontroller, often use data delivery, fact The data transfer is an important job in the mode of programming, with a total of 28 instructions (a total of 111 instructions). Let's start with the data transfer class instruction. Analysis of the MOV P1, # 0ffh, we don't have to conclusions, the first word MOV is a command verb, which is what is decided to do, Mov is a number of mods, so it is "transfer", this Is the directive, what is going on, there are some parameters, analyze, data delivery must have a "source" is what you want to send, you must have a "purpose", that is, you have to send it. Where to go, it is obvious that the number (source) to be sent is 0ffh, and the place to be delivered is the P1 register. In the data transfer class instruction, the destination is written behind the instruction, and the source is written at the end. In this instruction, the P1 is given this number itself, in other words, after doing this instruction, we can clearly know that the value in P1 is 0ffh, but it is not to give it directly to it. For example, the single-chip recession case given before we wrote this: Main: setb p1.0; (1) LCALL DELAY; (2) CLR P1.0; (3) LCALL DELAY; (4) Ajmp main; (5) Undraction DELAY: MOV R7, # 250; (6) D1: MOV R6, # 250; (7) D2: DJNZ R6, D2; (8) Djnz R7, D1; (9) Ret; (10) END; (11) Table 1 -------------------------------------------------- ---- Main: setb p1.0; (1) Mov 30h, # 255 LCALL DELAY; CLR P1.0; (3) Mov 30h, # 200 LCALL DELAY; (4) Ajmp main; (5) Undraction DELAY: MOV R7, 30H; (6) D1: MOV R6, # 250; (7) D2: DJNZ R6, D2; (8) Djnz R7, D1; (9) Ret; (10) END; (11) Table 2 In this way, I have the same time for each call delay program (roughly 0.13s). If I make such a request: the latency after the light is on the dead time, the light is off, the light is delayed 0.1 second light is on, so the program can still meet the requirements? No, what should I do? We can change the delay program (see Table 2): The call is shown in Table 2, which is to send a number to 30h, and the value in the subroutine is not fixed, but according to the basis The number of records passed in the 30H unit. This will meet the requirements. From here we can conclude, you have to find the number of passed in the data transfer. Many times, this number can't give it directly, it needs to change, this will lead to a concept: how to find an operand, we will find an operand The address of the unit is called addressed. Here we use the address of the number where the number where the unit is located is used, so this method is called direct addressing. In addition to this approach, there is another kind, if we put the number in the working register, look for data from the working register, called register addressing. Example: MOV A, R0 is to send data in the R0 working register to the accumulator A. One question: We know that the work register is part of the memory cell. If we choose the work register group 0, R0 is the 00H unit of RAM, then this, MOV A, 00H, and MOV A, R0 is not Nothing difference? Why do you want to distinguish? Indeed, the result of the two instructions is identical, all sent content in the 00h cell to a, but the execution process is different, and the first command requires 2 cycles, and the second It takes only one cycle, and the first instruction becomes the final target code to be two bytes (E5H 00H), and the second will be one byte (E8H). This is more than a thousand! Isn't it a period of a cycle, if it is a 12m crystal oscillator, there is a microsecond time, how much can one byte? 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