12 Years
Discussion Span
Last Post by lakshmi.1987

You need a code that loops that's all.Sample this one
mov ffffh, 0
label x_pow_y
mov ax,2
mul ax,2
inc ffffh ;memory location+1 until it's equal to one
cmp [ffffh],y
je display_result ;if it has been looped continously until Y times
loop x_pow_y ;else it wiil loop
code for displaying result
Exapmle is 2 power 3
2 is moved ot ax, multipied by itself and ffffh incremented
until it is =3


x equ 2
y equ 3 /*declare the var*/
mov ax,01h
mov bx,x
mov cx,y
loop1:mul bx
loop loop1
/*ax will have the result... and if in case the result occupies more than 16 bits...then the higher word is in dx */
note: this program is written for 8086 machine......

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.