# Multiplication of any dynamic Single, Double and triple Digit and display using loop in Assembly

`;MULTIPLICATION OF DYNAMICALLY ANY SINGLE, DOUBLE, TRIPLE DIGIT NUMBERS AND DISPLAY USING LOOP AND DISPLAY SUM IN ASSEMBLYORG 100H.MODEL SMALL.STACK 100H.DATA RANGE DB 13,10, 'ENTER RANGE: \$'R DW ?EN DB 13,10,'ENTER A NUMBER: \$'N DW ?UN DB 13,10, 'MULTIPLICATION = \$' MULT DW 1.CODEMAIN PROCMOV AX,@DATAMOV DS,AXMOV DX,OFFSET RANGEMOV AH,9INT 21HMOV AH,1 ;INPUT STORES IN ALINT 21HMOV AH,0MOV R,AXSUB R,48 MOV CX,R L:PUSH CXMOV DX,OFFSET ENMOV AH,9 ;FOR PRINTING STRINGINT 21H;INPUT CODE STARTS HEREMOV N,0 ;N = 0 MOV BL,10 ;BL = 10INPUT: ;LOOP LABELMOV AH,1 ;INPUT A CHARACTER => STORES IN ALINT 21H ;INTERUPT FOR TEXTCMP AL,13 ;COMPARE INPUT WITH ENTER KEYJE NEXT ;IF JUMP EQUAL TO THEN ITS JUMP ON LABELSUB AL,30H ;SUB AL = AL - 48 = AL - 30HMOV AH,0 ;AH = 0MOV CX,AX ;CX = AXMOV AX,N ;AX = NMUL BL ;MULTIPLY => AX = AX * BLADD AX,CX ;ADD => AX = AX + CX MOV N,AX ;N = AXJMP INPUT;INPUT CODE ENDS HERENEXT:MOV AX,N ;AX = N MOV BX,MULT ;BX = MULTMUL BX ;AX = AX * BXMOV MULT,AX ;MULT = AXPOP CXLOOP LLEA DX,UN ;LOAD EFFECTIVE ADDRESSMOV AH,9INT 21H;OUTPUT CODE STARTS HEREMOV AX,MULT ;AX = SUM = 25MOV DX,0 ;DX = 0MOV BX,10 ;BX = 10MOV CX,0 ;CX = 0 => COUNTER REGISTERL1:DIV BX ;DIVIDE => AX = AX / BX;IN CASE OF 8 BIT REGISTER => AL = QUOTIENT, AH = REMAINDER;IN CASE OF 16 BIT REGISTER => AX = QUOTIENT, DX = REMAINDER;AX = 2 , DX = 5PUSH DX ;5 SAVE IN STACKMOV DX,0 ;DX = 0MOV AH,0 ;AX AH = 00000000, AL = QUOTIENTINC CX ;CX = CX + 1CMP AX,0 ;(2 == 0)JNE L1 ;JUMP NOT EQUAL => AX != 0MOV AH,2 ;OUTPUT/PRINT A SINGLE CHARACTERL2:POP DX ;FIRST TIME POP 2 AND SECOND TIME POP 5 = 25ADD DX,48INT 21HLOOP L2;OUTPUT CODE ENDS HERERET MAIN ENDPEND MAINP` Contact Details for Assembly Projects

If you want any Project then contact our Customer support

Email: support@wsptech.pk

Mobile no: +92 304 5180559

You can contact any time on Mobile Number.