AIM To find LCM and HCF of two 8-bit numbers stored in 4200H and 4201H and store the result in 4202H and 4203H EQUIPMENTS REQUIRED: Microcontroller Kit THEORY The least common multiple (also called the lowest common multiple or smallest common multiple) of two integers a and b, usually denoted by LCM (a, b), is the smallest positive integer that is a multiple of both a and b. FLOW CHART
PROGRAM
OBSERVATION LCM AND HCF INPUT OUTPUT 4200: 4202: 4201: 4203:
PROCEDURE 1. Switch on the microcontroller trainer kit. Then a command window appears on the display. Enter the assembler command (a), press enter. 2. Then enter the origin address. 3. Type the program from starting address and press enter. Then corresponding opcode will be displayed. After entering full program, enter dot (.) and press enter to go back to command prompt. 4. Enter the substitute memory command (sd) followed by the location where data is to be entered. Enter the input data. To estimate this command press dot (.) followed by enter. 5. To execute the program enter go command with staring address and press enter. Then the program will be executed. 6. Press reset key in the kit to reset. Check the result by entering the substitute memory command followed by memory address where result is stored. RESULT Successfully executed the program and obtained LCM and HCF of two 8-bit numbers stored in 4200H and 4201H and stored the result in 4202H and 4203H