Re: Read N from keybord. Double even numbers. Using LOOP instruction




"aeter" wrote:

Hello im new to this group and new to assembly langage.
i have a simple question how can i double even number?

WHAT is a "double even number" ? (babel-fish translated?)
Reminds me on the "field of the wheel-calulation" [r^2*PI] :)

As this may be a 'home-exercise' quest:

Look at your codeflow and tell yourself 'when' it's finished.
And where is the result to be found.

What I see you may perhaps mean:

x=fn[sum(n+(n+2))] |n=1..10 interval=2

(but infinitus sanctus is around yet)
___________
add ebx,1
and
inc ebx
do almost the same thing (INC wont alter carry-flag)
___________
Looks like MASM ?
Why PROC ? there is not a single stack operation in the code.

__
wolfgang




my code so far:
INCLUDE Irvine32.inc
.code
main PROC ; Label for the start of the main program
mov edx, 0
mov ebx, 1
mov ecx, 10 ;loop can be excuted 10 times
label1:
add edx, ebx
add ebx, 1
inc ebx
jmp label1
loop label1

exit
main ENDP
END main
thanks



.



Relevant Pages