Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: Frank Kotler <fbkotler@xxxxxxxxxxx>
- Date: Tue, 27 Feb 2007 13:07:57 GMT
//\\o//\\annabee wrote:
....
mov edx 0
mov ecx 2
mov eax 1
While ecx <= N
add edx ecx
add edx ecx
add ecx 2
add edx eax
add eax 2
End_While
Sorry. I am drunk. Now I go kill myself :(
Heh! If you're drunk, you're already killing yourself. (don't get me started on the clinical effects of alcohol, as compared to, say, heroin...)
My CPU doesn't have a "While" opcode, so I can't test your code. I don't think it's quite right. But looking at it gave me the idea of doing the "double and add" by:
lea edx, [edx + ecx * 2]
Might be a "win"... not tested...
Best,
Frank
.
- References:
- Read N from keybord. Double even numbers. Using LOOP instruction
- From: aeter
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: SpooK
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: Rod Pemberton
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: SpooK
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: aeter
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: SpooK
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: Frank Kotler
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: //\\\\o//\\\\annabee
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: //\\\\o//\\\\annabee
- Re: Read N from keybord. Double even numbers. Using LOOP instruction
- From: //\\\\o//\\\\annabee
- Read N from keybord. Double even numbers. Using LOOP instruction
- Prev by Date: 64 bit Menuet 0.59 released
- Next by Date: Re: Accessing Command-line text
- Previous by thread: Re: Read N from keybord. Double even numbers. Using LOOP instruction
- Next by thread: Re: Read N from keybord. Double even numbers. Using LOOP instruction
- Index(es):
Relevant Pages
|