Skip to main content

Add two 16-bits number with ADD and ADC instruction

Add two 16-bits number with ADD and ADC instruction

  1. LHLD 2501H   : "Get 1st 16-bit number in H-L pair"  
  2. XCHG         : "Save 1st 16-bit number in DE"  
  3. LHLD 2503H   : "Get 2nd 16-bit number in H-L pair"  
  4. MOV A, E     : "Get lower byte of the 1st number"  
  5. ADD L        : "Add lower byte of the 2nd number"  
  6. MOV L, A     : "Store result in L-register"  
  7. MOV A, D     : "Get higher byte of the 1st number"  
  8. ADC H        : "Add higher byte of the 2nd number with CARRY"  
  9. MOV H, A     : "Store result in H-register"  
  10. SHLD 4004H   : "Store 16-bit result in memory locations 2505H and 2506H"  
  11. HLT          : "Stop" 

Comments

Popular posts from this blog

2017//2(b)//Engineering Eco//KU

A loan of $10,000 is to be repaid over a period of eight years. During the first four years, exactly half of the loan principal is to be repaid (along with accumulated compound interest) by a uniform series of payments of A1 dollar per year. The other half of the loan principal is to be repaid over four years, with accumulated interest, by a uniform series of payments of A2 dollar per year, If i=9% per year, what are A1 and A2?

Testing servo motor with arduino

  Testing servo motor with arduino  Components Needed: Arduino board (e.g., Arduino Uno) Servo motor Jumper wires Steps for Connection: Servo Motor Pins: Ground (GND): Usually the brown or black wire of the servo motor. Power (VCC): Usually the red wire of the servo motor. Control Signal (PWM): Usually the yellow, orange, or white wire of the servo motor. Connecting to Arduino: Ground (GND): Connect the ground wire of the servo motor to one of the GND pins on the Arduino. Power (VCC): Connect the power wire of the servo motor to the 5V pin on the Arduino. Control Signal (PWM): Connect the control signal wire of the servo motor to digital pin 9 on the Arduino, as specified in the code by myservo.attach(9); Connection Arduino  Servo motor  VCC/ 5V Red wire  GND Black Wire  9  Yellow wire Explanation: Ground (GND): This connection ensures that the servo motor and the Arduino share a common ground, which is necessary for proper operation. Power (VCC): The ...