title: Keil: Assembler program that converts ASCII number into BCD and HEX
body: <p>this Keil uVision program should load a positive whole ASCII number (e.g 1234). The Program should convert it into BCD coded number in Register R1 , and the HEX number in Register 2...
  can someone explain me what it does below?
  especially :</p>
  
  <pre><code>MOV     R4,#10
  </code></pre>
  
  <p>and</p>
  
  <pre><code>AND     R1,R3,#0xF
  MLA     R2,R4,R2,R3
  </code></pre>
  
  <p>???
  here is the program:</p>
  
  <pre><code>LDR R0, =Wert ; Pointer laden
      LDR R1,[R0]
      BL KONVERT ; Unterprogramm KONVERT aufrufen
  endlos         B        endlos
  
  
  KONVERT
      LDRB    R3,[R0],#1 ; Byte laden
      AND     R1,R3,#0xF ; ASCII-HEX-Wandlung
      MOV     R2,R1 ; HEX-Zahl
      MOV     R4,#10
  
      LDRB    R3,[R0],#1 ; nächstes laden
      AND     R3,R3,#0xF ; ASCII-Hex-Wandlung
      ORR     R1,R3,R1,LSL #4 ; BCD-Wert bilden
      MLA     R2,R4,R2,R3 ; HEX-Zahl
  
      LDRB    R3,[R0],#1 ; nächstes laden
      AND     R3,R3,#0xF ; ASCII-Hex-Wandlung
      ORR     R1,R3,R1,LSL #4 ; BCD-Wert bilden
      MLA     R2,R4,R2,R3 ; HEX-Zahl
  
      LDRB    R3,[R0],#1 ; nächstes laden
      AND     R3,R3,#0xF ; ASCII-Hex-Wandlung
      ORR     R1,R3,R1,LSL #4 ; BCD-Wert bilden
      MLA     R2,R4,R2,R3 ; HEX-Zahl
  
      BX      LR ; Rücksprung
  </code></pre>