Summary: This module contains the programs involving Data transfer instructions, Arithmetic and logical instructions, string

manipulation instructions etc

Q1. Byte and word move using different addressing modes Program: .model small .data Num dw 4321h .code Mov ax,@data Mov ds,ax Mov ax,1234h ;immediate addressing Mov bx,ax ;register addressing

Mov ax,num ;direct addressing Mov si,1000h Mov al,[si] ;indirect addressing Mov bl,[si+100h] ;relative addressing Mov bx,1000h Mov ax,[si+bx] ;base index addressing Mov cx,[si+bx+100h] ;relative base index addressing Mov ah,4ch Int 21h End

decrement the counter .ax lea si.5 d2 db 10 dup(0) . 2.Increment si .al .05 .[si] .2.d1 .@data .Increment di .Move to d2 inc si inc di dec cx jnz up .3.code mov d1 db 1.Repeat till cx becomes zero .Load offset address of d1 in si lea di. Program to transfer a block of data without overlap .Load offset address of d2 in di mov cx.load cx with count up:mov al.model small ..d2 .Output: Ax=1234h Bx=1234h Ax=4321h….4.Initialize the data segment mov ds.Move the 1st element of d1 to al mov [di].

Terminate the program int 21h end d1 d2 Table 1 01 02 03 04 05 Table 2 01 .4ch .mov ah.

@data .05h .02 03 04 05 3.code mov ax.model small .3.Load the offset address of d1 in si lea lea si.Load the offset address of d2 in di mov d1 db 1.d1 .Initilize the data segment mov ds.4. Program to transfer a block of data with overlap .d2 .5 d2 db 10 dup(0) .load cx with count .

Repeat till cx becomes zero mov cx.Load si with offset address of d1+2 lea di.up:mov al.Load cx with count lea .Move the first element of d1 to al mov [di].Increment si loop up1 .[di] .Increment di dec cx .4ch .Move al to d1 INC di .Move the first element of d2 to al mov [si].05h .Increment di inc si .[si] .d1+2 .Move to d2 inc si .Increment si inc di .Terminate the program int 21h end d1 d2(temp location) (after block transfer) (with overlap) Table 3 01 02 .Repeat the loop mov .Load the offset address of d2 in di up1:mov al.decrement the counter jnz up .d2 .

03 04 05 Table 4 01 02 03 04 05 .

Table 5 01 02 01 02 03 04 05 .

66h .4.Increment si .ax lea si.Move al to d2 mov[si].Move the first element of d1 to al mov bl.4ch . Jump to label up mov .4.2.decrement the count .@data .05h .model small .Move the first element of d2 to bl mov [di].[si] .5 d2 db .44h.33h.[di] .code mov ax.Initilize the data segment mov ds.55h.Terminate the program int 21h endTable 60102030405Table 71122334455 d1 d2 d1 d2Table 80102030405Table 91122334455Before block exchange After block exchange 5 .load cx with count up:mov al.d1 .data d1 db 1.Load offset address of d1 in si lea di.Load offset address of d2 in di mov cx.d2 . write an ALP to interchange 2 blocks of data .Move bl to d1 inc si inc di dec cx jnz up .Increment di .If not=0.

4444h.datan1 dw 1111h.datad1 dd 0f2222222hd2 dd 33333333hd3 dd 10 dup(0).04h .@data .Load cx with countmov dx.d1 .00 .3333h.Decrement cxjnz up .2222h.Load bx with offset address of d3+5mov bxinc si .Move the carry to memory locationmov ah.Load cx with with the countmov dl.else if carry =0.4444h..Move the lower byte of Ist number to aladc to label downinc dl .the loopjnc down .If cx≠0.0ffffho/p:1aaa9h 6 .Load di with offset address of d2lea bx.clear dlclc .00h ..d3+5 .decrement bxdec cx .to point to the next data worddec cx .if cx is not equal to zero.Clear accumulator mov cx.Increment si twiceinc si .axlea si.00h .by simov [si+2]. Write an ALP to add/subract 2 32 bit signed/unsigned numbers.model small.Add with carry the second no. repeat .codemov ax.clear carryup:add [bx].Clear dxclc .if carry=1.Increment didec bx .Load si with offset address of d1lea di.@data .else increment carry counterdown:mov [bx].Load si with the offset address of n1mov ax.model small.3333h. Addition and subtraction of N numbers Program to add N data words .dl .0ffffhn2 dw 02 dup(0).[si] .d2 .ax . repeat the loopjnc down .00h .Add the first element with accumulatorinc si .n1 .Store carry in next memory locationmov ah.clear carryup:mov al.terminate the programint 21hend Input: 0f2222222h and 33333333h( unsigned number addition) Output:125555555h . jump to label downinc dx .Decrement the countjnz up .If no carry.4ch .Initialize Data segmentmov ds.Store the result in memory pointed to .Increment siinc di .axmov ax.[si] .05h .4ch .al .Clear axlea si. increment dxdown:mov [si].codemov ax.Terminate the programint 21h endI/p:1111h.2222h.Store the result in memory pointed to .[di] .Initialize the data segmentmov ds.dx .

repeat the loopjnc exit .ah .2222h.model small.[si] .move remainder to memorymov [di+2].Store carry in memory locationmov ah.datanum dd 12345678hnum1 dw 2345hres dw 02 dup(0).08h . array .else if carry=0.@datamov ds.datad1 dq 1234567812345678hd2 dq 1234567812345678hres db 09 dup(0).num1 .move the divisor into bxdiv bx .Program to add/subtract 2 64 unsigned/signed numbers.Load bx with offset of the resultmov ah.else increment carryexit:mov [bx].cx=number of elements in the array mov ax.codemov ax.6.terminate the programint 21hend Input: 1111h.num .ax .Load cx with countlea si.@data .[bx] .[si+2] .compare the 1st and 2nd elementjnc below .05h .If cx≠0.Mov 00 to ahup:mov al.Add with carry to the LS byte of the .[bx+2]below:inc bxinc bxdec cxjnz up .@data .5555h . To find the Largest/smallest number in an array of 16 bit numbers .Load si with EA of nummov dx.Decrement bx inc si .move the 1st word of the array to axup:cmp ax.Increment didec cx .terminate the programint 21hend Input: dividend-12345678h .[bx+2] .move quotient to memorymov ah.Load si with offset of d1lea di.codemov 00 in memoryinc ah .ax .axlea si. to aladc al.model small.Increment siinc di .for smallest numbermov ax.dx:ax/bxlea di.Terminate the programint 21hendInput: 1234567812345678h.Move the result to memory pointed by bxdec bx .4589h.[di] .Clear carrymov cx.5555hres dw 02 dup(0).1234567812345678hOutput:2468ACF02468ACF0H 7 Program to divide a 32 bit number by a 16 bit number .dataarray dw 1111h.res+8 .Load BX with EA of arraymov .Initialize Data segmentlea bx.Initialize data segmentmov ds.second numbermov [bx].if cx≠0. Remainder:134Eh 8 .4ch .axclc .Decrement count jnz up .8567h.codemov ax.[si] .model small.res .al .Mov the LS byte of first no.8567h.d2 . divisor-2345h Output:Quotient:8422h.2222h.Load di with offset of d2lea bx.4ch .00 .load ax with lower word mov bx.Initialize data segmentmov ds.4589h..d1 .load dx with higher word of dividendmov ax.if 1st number>2nd number compare 1st with .3rd number and so on.dx .Jc below . repeat mov res.4ch .store the largest number in location resmov ah.load di with EA of resmov [di].

[si] . Program to search a character in a given string .@data .msg1 .code mov ax.move the 1st number of n1 to axinc siinc sicmp with the next numberjc rep1 .4ch .0dh.09hint 21hend1:mov ah.bx . 0ffffh.09hint 21hjmp end1found:lea dx. 3333h.jnc rep1 .0dh.00h .bx=number of elements to be sorteddec bxl2: mov cx. 5555h.terminateint 21hend Output: character not found 11 Program to find the factorial of a given number(no<=8) .3333h.datastring db "bmscollege$"enter db "j"msg db 0ah.axmov es.4chint 21hend Input: 0ffffh.enter .datan1 dw 0ffffh.n1[si] .msg .>2nd no.display.number of iterationsmov si.0ah .jump to foundinc si .7777hcount dw 04h."character found$"msg1 db 0ah.all the iterations over?mov ah. 7777h Output: 3333h.Output:8567h stored in location res 9 .jnc for descending the first character to alcmp al.searchedjz found .model small. no exchange.xchg ax. 5555h. char foundmov ah.axrep1:loop l1 .si=0l1: mov ax.repeat till cx=0dec bx jnz l2 .display.else repeat the loopdec cljnz upnfound:lea dx."charcter not found$"char db 02 dup(0).compare with the character to be .if 1st no.5555h.CL=countlea si.count .codemov ax.string .initialize DS and ESmov ds. 7777h.n1[si] .model small. Program to sort a given set of 16 bit unsigned integers in ascending/descending order . char not foundmov ah.Initialize Data segmentmov ds.n1[si] .ax mov cl.@data .else exchange 1st and 2nd nomov n1[si-2].axmov bx. 10 .Load the EA of string into siup:mov al.

Else display the no is negativemov ah.4ch .0dh.n3 ..codemov ax.'it is not a palindrome$'num dw 4421h. through carryrcr bx.axmov ah. jump to label palimov ah.n2 mov with 02hjz down .else decrement bxmul bx .Initialize data segmentmov ds.Clear carryback:rol the remainder with 0.01h .multiply ax and bxcmp bx.n1 .model .09hlea dx.bx .If cl≠0.09h .jz down .Initialize data segmentmov ds.model small.display” the given …even”mov ah. Program to check whether the given data word is a nibble wise palindrome .jump to down up:dec bx .10h ."it is not a palindrome$".4chint 21hendInput:09hOutput:the data is positiveInput:0ffhOutput:the data is negative 13.datanum dw 8448hmsg1 db 0ah.@data .divide by 2cmp ah. Program to check whether data byte is odd or even .02h .Move 00 to bxclc .model small.Load cx with the countmov bx.axmov ax."the given data is odd $"n3 db 0ah.0dh.'it is a palindrome$'msg2 db 0ah.09hint 21hend1:mov ah.num .09hint 21hjmp end1d1:mov dx. Initialize data segmentmov .Decrement the countjnz back .datano dw 08hres dw 02 dup(0). repeat the loopcmp ax. Program to check whether the given data byte is positive or negative .compare bx with 01jz down .0dh.axmov ah.if 0.end of the programint 21hendI/P=08hO/P=9D80h 12.@data .Clear carry mov al."the data is negative $".Initialize data segmentmov ds.If 0.Program to check whether the given word is a bitwise palindrome.Rotate bx once without carrydec cl .Display “it is not a palindrome”int 21hjmp lastpali:mov ah.Move number to axmov cl.datan1 db 0feHn2 db 0ah.Display ”it is a palindrome”int 21hlast:mov ah.10h .00h . compare ax and bxjz pali .offset n2 .if 0.jump to end1down:lea dx.0dh.n1 and al.if no=2.dxmov res+2.00 .If ax=bx.4ch .0dh.msg1 .0dh.axmov ax.datamsg1 db 0ah.0dh.codemov ax.4ch ."it is a palindrome$"msg2 db 0ah.01 .codemov ax.01 .axclc . store the resultjmp updown:mov res.datan1 db 09Hn2 db 0ah.if cl=0.@data .codemov ax.offset n3mov ah. the number is positivelea dx."the data is positive $"n3 db 0ah.nocmp ax.0dh.@data . display the no is positive mov dx.codemov ax.Display “the given …odd”int 21hjmp end1 .Terminate the programint 21hend 15."the given data is even$"n4 db 04 dup(0).model small.09hint 21hend1:mov ah.end of the programint 21hendInput:0fehOutput displayed on the screen:“the given data is even”Input:09hOutput displayed on the screen:”the given data is odd”14.initialize DSmov ds.Check the MSB jz d1 .02hmov al.msg2 .factorial=2.@data .Rotate left ax once.move the number to aldiv bl .00h mov bl.move the number to ax and bxmov bx.09hlea dx.model small.

al mov ax.Display “it is a palindrome”lea dx.jump to D1Jc d1 Add .display the content of ahMov ah.4ch .msg2int 21hjmp end1 .Decrement cljnz up .model small.get the BCD number to alAnd with 0ahJc d2 .if cl=0.mask the upper nibbleAdd al.Repeat the loop if cl≠0.@data .codeMov ax.07h .Move 04 to clmov bx.mask the lower nibbleMov cl.04h Rol al.msg1int 21hend1:mov ah.end of the programInt 21hEnd Input : 99 Output: 63hInput : 85Output: 55h .ds.model small.if the number is<0ah. add al and blAaa .num . Program to convert a hex number to ascii number .07h .add al and blMov .al Mov al.mask the upper nibbleCmp al.datanum db 35h.N1 db ‘9’.axMov . jump to D2Add al.00h .Clear carryup:ror bl.if the number is < 0ah.If bh=bl.ASCII adjust after additionOr ax.ah .n1 .move the first no to alMov bl.end of the programInt 21hEndInput : N1=’9’ N2=’9’Output: 18Input: N1 = ‘5’ N2 = ‘8’Output: 13 17. Initialize data segmentMov al. Rotate right bl once.@dataMov ds.if the number is>0ah.4ch .09h .4ch .second number to blMov ah.D1 .04 .0ah .02hInt 21hPop axMov dl.Or ax with 3030h for displayPush axMov dl. Program to convert an 8 bit BCD number to binary number .end of the programInt 21hEndInput:35hOutput:33h and 35h.clear ahAdd al.30hLea si.0ah .cl .0fh .01 .0fh .multiply with 0ahMov bl.n2 .D1 db 85hD2 db 02 dup(0). jump to label palimov ah.model small.02hInt 21hMov ah.0f0h .D1 .3030h .ax .Jump to label end1pali:mov ah.04hRol al.Move number to axmov cl.numAnd al. compare bh with bljz pali .@dataMov ds. Program to add 2 ASCII numbers.cmp bh.Terminate the programint the result in memoryMov [si].alMov al.num .display the content of alMov the result in blMov al.move the BCD number to alAnd .ax .0f0h . bring the upper nibble to LS positionMov bl.30hMov [si+1]. add 37hD2:add the binary no in D2Mov ah.4ch . add 37hD1:add .Initialize data segmentMov ds.mask the lower nibble of the digitMov cl.Move ax to bxclc . through carrydec cl .num db 0AAhres db 2 dup(0).N2 db ‘9’N1 db ‘5’N2 db ‘8’N3 db 02 dup(0).store the result in memoryMov .if the number is >0ah.codeMov ax.res .dataD1 db .al .codeMov ax.0ahMul bl .bring the digit to LSB positionCmp al.move the number to alAnd al.09hlea dx. stored in memory locations [si] & [si+1]Input:0AAh Output: 41h and 41h stored in memory locations [si] & [si+1] 18. Initialize data segmentMov al.

Je exitJb downDivaxbx:mov .al .bx .if ax>bx.check for number of ones in remaining 5 . jump to againxchg ax.4ch .end of the programint 21hendInput :0ffhOutput:02 05 05 stored in locations [si.jnz invalid .Initiliaze data segmentMov ax.4ch .si+1.09hint 21hjmp end1 .n2.push ax and dx onto the stackpush dxdiv bx .ax .02hnum dw 09h.ah .num+2 .clear ahmov bl.increment dl if carry=1d1:dec bl .compare ax and bxjnc again .res Mov [si].codemov ax.divide ax by 64hLea .bx .al .@datamov ds.0dh.numjnc no_incrementinc dxno_increment: jmp againstore: pop lcm+2pop lcmmov ah.num .jump to end1invalid:lea dx.invalidmov bl.if bl≠0. Initialize data segmentMov al.02h .stack 64.@dataMov ds. display “the code is not a mov ah. jump to invalidlea dx.check for carryinc dl .09hGcd dw ?.axmov num+2.num dw 05h.divide ax by bxcmp dx.initialize the data segmentmov al.0ah div bl . Program to find the GCD of two numbers.01h . repeatcmp dl.0e0h .move the 1st number to axMov bx.09h .if dl≠]Input : 063hOutput:09 09 stored in locations [si+1.0h .Initiliaze data segmentmov ax.model small.n3 .datanum dw 1bh.model small.2dhlcm dw 2 dup(0).move the 1st number to axmov bx.model small.4chint 21hendInput:05h.and 2nd number to bxmov dx.and it with 0ehjnz invalid .decrement the countjnz up .n1 .ah dl with 02. move the .and 2nd number to bxAgain:cmp ax.move the binary number to alMov ah.00h . 02hOutput:0ahInput:22.otherwise exchange ax and bxmov num.00hand al.00h .0 .move the quotient to [si]Mov al.end of the programint 21hendInput:0fhOutput: the code is not a 2 out of 5 codeInput:09hOutput: the code is a 2 out of 5 code 21.@dataMov ds. Program to find the LCM of two data bytes . 2 out of 5 codeint 21hend1:mov dxcmp ax."the code is not a 2 out of 5 code$"n3 db 0fh.move the remainder to almov ah.if 1st three MSBs are not zero jump to .05h mov al.display ”the code is 2 out of 5 code” mov ah.clear ahMov bl. si+2] 20.codemov ax.move the quotient to [si+1]mov [si+2]."the code is 2 out of 5 code$"n2 db 0ah.Program to convert an 8 bit binary number to BCD number .compare the remainder with 0je storepop dxpop axadd ax.num . Program to check whether the code belongs to 2/5 code .64hdiv bl .datanum db 0ffh.number to alup:ror al.@datamov .num+2 .if 1st three MSBs are non-zero.num .bx .bxagain: push ax .ax .divide ax by blmov [si+1].codeMov ax.move the remainder to [si+2]mov ah.datan1 db 0ah.num db 63hres db 03 dup(0).bitsjnc d1 .move the number to almov dl.19.codeMov ax. n3 .

axMov dx.alMov ah.clcmp dl.00h mov al.cxadc dx.00hmov[bx+4].n1Mov bl.axmov cx.07hdown1:add dl.0f0hmov cl.0fhcmp mov ah.Program to multiply two unpacked BCD numbers and display the result.model small.02hInt 21hpop axMov dl.codeMov ax.00hpop cxadd ax. N2=5Output:45 displayed on the screen 2 5.codeMov ax.almov ch.@data mov ds.3030hPush axMov dl.ahmov[si+1].axmov cx.model small.02hint 21hinc sidec chjnz upmov ah.dxMov ah.alMov ah.ahMov ah.4chint 21hendInput:04hOutput:10h is displayed on the screenInput:0ffhOutput:FE01h is displayed on the screen 27 .@dataMov ds.4chint 21hendInput:Num1:0ff0aff0hNum2:03304002hOutput:32d32d18dd5fe0h26. " "mov ah.codeMov ax.@dataMov ds.dxmov ax.n1Mov al.Program to find the square of a given data byte.3030hPush axMov dl.n2mul blAamOr ax.@dataMov ds.02hint 21hpop axMov dl.@dataMov ds.02up:mov dl.dxMul numAdd ax.axmov[bx+6].0Div bxCmp dx.num1Lea di.dxJmp againDown:xchg ax.datanum dw 05h.[si]mul word ptr[di+2]pop cxadd ax.axMov ah.bxMov gcd+2.[si]and dl. Program to find the Cube of a given number .dx.nummov bl.model small.4chInt 21hEnd 23.numMul numMov cx.cxadc dx. Program to divide a packed bcd number by an unpacked bcd number and display the quotient and remainder on the screen .0ahjb downadd dl.02hInt 21hMov ah.dxmov ah.cxMov cube.datanum1 dd 0ff0aff0hnum2 dd 03304002hres dq 00h.0ahjc down1add dl.almul bllea si.4chInt 21hEndInput:6 and 7Output: Quotient 7.axJnc skipInc dxSkip:mov cube+2.00hmov[bx+2].00hpush dxpush axmov ax.dxmov ax[si+2]mul word ptr[di]add ax.model small.model small.0hMov ax.num dw 0ffhcube dw 02 dup(0).resclcmov ax.n2mov ch.dataN1 db 6N2 db 7N3 db 02 dup(0).axMov ah.bxJmp divaxbxExit:mov gcd.axLea si.4chInt 21hEndInput: N1=9.02hint 21hmov dl.datanum db 0ffhres db 04 dup(0).02hInt 21hMov ah. [si]mul word ptr[di]mov[bx].resmov[si].0Je exitMov ax.ahMov ah.[si+2]mul word ptr[di+2]add ax.codemov ax.30hmov ah.[si]and dl.num2Lea bx.02hInt 21hmov dl.30hmov ah.4chInt 21hEndInput:0ffhOutput:fd02ffh in locations cube and cube+2Input:05hOutput:7d in locations cube and cube+2 . Remainder 4 displayed on the screen24.program to multiply two 32 bit unsigned numbers .axMov al.dataN1 db 9N2 db 5N3 db 02 dup(0).stack 100h.09hAaddiv chOr ax.cxadc dx.07hdown:add dl.cxadc dx.04hror dl.codeMov ax.

4chint 21hend30."$"string db 18 dup(0).00again:mov al.02hInt 21hpop axMov dl.0f0hmov cl.bldec cxjnz upmov dl.30hmov ah.0dh.axmov es.4chint 21hendInput:0fff0hOutput:0c displayed on the screen29.n3clcmov cl.09hlea dx.Program to transfer the string.07hd12:add dl.30hmov ah.00hlea si."$"blank db " ".0ahjc d11add dl.@datamov ds.02hInt 21hMov ah."$"mes2 db "enter the string to be searched".0dh.datan1 dw 0fff0hn3 db 04 dup(0)mes1 db 0ah.09hint 21hmov ah.offset stringadd si.alMov ah.axlea si.model small.09h.01hint 21hcmp al.allea dx."$"sfound db "string found$"nfound db "string not found$"null equ 0dhcr db 0ah.offset blank mov ah.ds:datastart:mov ax.crmov ah.24hmov [si].datasrc db 'string transfer$'dst db 25 dup(0).0fhcmp dl.0fhrep movsbmov ah.dataN1 db 6N2 db 7N3 db 02 dup(0).00hAaddiv chOr ax.datamov ds.[si]and dl.allea dx.axmov dx.00mov di.0ah.09hint 21hmov si.codemov ax.01hint 21hcmp al.[si]and dl.sfoundint 21hjmp quitt2:mov ah.3030hPush axMov dl.axmov es.@dataMov ds.00t3:mov ah.0ahjc d12add dl.codemov ax.09hlea dx.mes2int 21hmov di.offset mes1mov ah.0dhjz revdec simov [si].dlcops:mov ah. program to search a sub string in a main stringdata segmentmainstr db 80 dup(0)subst db 80 dup(0)mes1 db "enter the string".4chint 21hcode endsend startOutput on the screenEnter the string: bmscollegeEnter the string to be searched: collegeOutput: string found 3 .codeMov ax.dstcldmov cx.14hmov dl.alinc dijmp t3out:mov subst[di].02hint 21hmov ah.4chInt 21hEnd 2 9 .subst[di]cmp al.0ah.n2mov ch.04hror dl.09hlea dx."enter the string".srclea di.alinc sijmp upacc:mov mainstr[si]. Program to find number of ones in a given data word and display the count on the screen .09hint 21hmov si.n1up:rcl ax.00up:mov ah.nfoundint 21hquit:mov ah.0dh.0dh.axmov es.ahMov ah.model small.mes1int 21hmov si.0dhjz outmov subst[di].01hint 21hcmp al. 0ah.n1Mov al.siint 21hmov ah.0dh.codemov ax.00inc sijmp againdown:inc siinc dimov al.clcmp dl.mainstr[si]cmp al.@datamov ds.Mov ah.0dh.nulljz t2cmp al.model small.ascii multiplication.4chint 21hend31.axmov bx.09hint 21hlea dx.02hint 21hmov dl.crmov ah.nulljz foundjmp againfound:mov ah.axmov ah.model small.@datamov ds. Program to reverse the string .aljmp copsrev:mov dx.07hd11:add dl.10hmov ax.subst[di]jz downmov di.0dhjz accmov mainstr[si].28.axMov ah."no of 1's$".01jnc d1inc bld1:mov [si].0dh.datames1 db 0ah.09hmov dx.0ah."$"data endscode segmentassume cs:code.

displayed on the screen .0fhcmp dl.30hpush axmov ah.aland dl.0ahjc down1add dl.aland dl.0f0hmov cl.0ahjb downadd dl.clcall dispmov ah. Program to multiply two data words and display the answer by calling a far procedure data segment.clcmp dl.02hint 21hpop axpop cxpop dxpop axretdisp endpsbrt endsendInput:12h 24hOutput:0288h.axmov sp.4chint 21hcode endsend startFar procedure to display the number on the screenpublic dispsbrt segment publicdisp proc farassume cs:sbrtpush axpush dxpush cxmov dl.07hdown:add dl.04hror dl.07hdown1:add dl.2.mul2 db 24hmul1 db 0ffhmul2 db 0ffhdata endsstack_seg segmentdw 40 dup(0)tps label wordstack_seg endssbrt segment publicextrn disp:farsbrt endscode segmentassume cs:code.offset tpsmov al.datamov ds.axmov al.ds:datastart:mov ax.mul1 db 12h.02hint 21hpop axmov dl.30hpush axmov ah.mul1mul mul2mov cx.ahcall dispmov al.

Sign up to vote on this title
UsefulNot useful