Hi every one..
Please.. I need a program to calculate X power Y by assembely language.. Please friends help me .
You need a code that loops that's all.Sample this one
mov ffffh, 0
inc ffffh ;memory location+1 until it's equal to one
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*/
/*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......
We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.