FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    12 lesson: single-chip logic operation class instruction

     

    The logic operation of the accumulator A for the microcontroller: CLR A; 0. The value of the value is 0, the single-cycle single-byte instruction is the same as the MOV A, and the effect. CPL A; reflect the value in A RL A; logic to the value of A RLC A; Logic left by plusing the value in A RR A; logically right of the value in A RRC A; Logic movement to the value of the value plus the value Swap A; high value, low value, low 4 digits. Example: (a) = 73h, execute CPL A, this: 73H is chemical as 01110011, It is a 10001100 in opposing position, which is 8CH. RL A is sent to the value of the value in (a) to 0th, and the 0th is 1 bit, and push it according to the class. Example: The value in A is 68h, executes RL A. 68H is chemically binary 01101000, moving by the above figure. 01101000 is 11010000, that is, D0H. RLC A is shifted by the inlet bits (c) on (a). Example: The value of the value is 68h, and the value is 1, then execute RLC A After 1 01101000, the result is 0 11010001, that is, the value of the C-entertel bit becomes 0, and (a) becomes D1H. RR A and RRC A don't talk more, please refer to the two routines above. SWAP A is exchanged for high, low 4 digits in A. Example: (a) = 39h, after SWAP A, the value in A is 93h. How is it just right? Because this is a 16-based number, each 16-in number represents 4 bits. Note that if this is: (a) = 39, there is no H, after SWAP A, may not be (a) = 93. To make it a binary and then calculated: 39 is a binary 10111, that is, 0001, 0111 high 4 bits are 0001, low 4 bits are 0111, and the exchange is 0110001 after exchange, that is, 71h, ie 113. Exercise, known (a) = 39h, perform the results of each step after performing the following single-chip command CPL a RL A CLR C RRC A Setb C RLC A SWAP A Through the previous study, we have mastered a considerable single-chip degree, everyone may be a little tired of these boring microcontroller instructions, let us easily make an experiment. Experiment 5: ORG 0000H LJMP START ORG 30H Start: Mov sp, # 5fh Mov A, # 80h LOOP: MOV P1, A RL A LCALL DELAY Ljmp loop DELAY: Mov r7, # 255 D1: MOV R6, # 255 D2: NOP NOP NOP NOP Djnz R6, D2 Djnz R7, D1 RET End Let us write the program into the film, put it into the experiment board, look at the phenomenon. I saw a phenomenon of dark point flow, let's analyze it. Instead ORG 0000h, LJMP Start, ORG 30H, etc. We will later analyze. Starting from START, Mov SP, # 5FH, this is the initialization stack, there is no tight in this program, but we slowly start contacting regular programming, I will slowly give you habits. Mov A, # 80h, send 80h this number to a. What do you do? I don't know, look down. MOV P1, A. Send the value in A to the P1 port. At this time, the value of A is 80h, so it is 80h, so the value of the P1 port is 80h, that is, 10000000B, through the previous analysis, we should know that the LED connected in P1.7 is not bright. And other LEDs are bright, so a "dark point" is formed. Continue to see, RL A, RL A is left to move the value in A, count, what is the result of the shift? Yes, it is 01h, that is, 00000001B, which should be connected in the LED on P1.0, and other bright, from the phenomenon, "dark point" flows back. Then call the delay program, this is very familiar, let this "dark point" "dark" for a while. Then be turned to the LOOP (LJMP loop). Please calculate it, which light should be not lit. . . . . By the way, it should be connected to the light on P1.1. In this way, it is cycled to form a "dark point flow". problem: How to achieve highlights? How to change the direction of the flow? Answer: 1. Change the initial value in A to 7FH. 2, change RL A to RR a. 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