![]() |
|
|
#1 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
I've tried iczelion tutorial for message box it works. I try adding mov(ax,1) it tells me I missed the right parenthesis and if i just try his basic outline it assembles fine but I goto check it out and it tells me it's not win32. any help i have books but I don't understand why i can't get mov(ax,1) to work. if i could maybe it's a start lol. I'm on a intel pentium d processor.
|
|
|
|
|
|
#2 |
|
Oct 2007
2×53 Posts |
You're using MASM? There's no need for parenthesis. It's just MOV (E)AX, 1.
|
|
|
|
|
|
#3 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
|
|
|
|
|
|
#4 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
once I got one thing working I remember that I made this code before lol.
Code:
include \masm32\include\masm32rt.inc .code AppName db "Masm32:", 0 start: mov eax,9h MsgBox 0, str$(eax), addr AppName, MB_OK exit end start |
|
|
|
|
|
#5 | |
|
Aug 2006
3×1,993 Posts |
Quote:
![]() You want to take numbers below, say, a billion and check if they're exponents of Mersenne numbers. The first natural step would be to test if the number is prime. For numbers this size, trial division is reasonable. Can you program that in assembly? |
|
|
|
|
|
|
#6 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
I know the book I has breaks thing down to the parts that make up loops etc. and then talks of knowing your data as it's rarely random.
if possible conditional jumps should be used minimally. to be prime it can't be a power and has to be of form 6n+1/-1 if above 3 so inc(eax) is useful in groups of 2 or 4 counting down is more efficient if I read the book correct. checking for 6n+1 doesn't seem hard unless you put the limit on jumps to me. be nice if we could make a table of equivalent codes between languages so I could possibly turn Pari Codes into asm etc. |
|
|
|
|
|
#7 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
yeah that would be a 2 variable operation one the exponent you want to test and 2 the number to divide it by also as we go could we not push it on the stack to make an array of primes found along the way.
|
|
|
|
|
|
#8 |
|
"Ben"
Feb 2007
3×1,171 Posts |
Indeed, but the first step, IMO, should not be assembly at all! I realize that assembly language has the great lure of speed, but speed gains can typically only be realized with *extensive* knowledge of the underlying hardware... something yet to be demonstrated.
Why anyone would want to burden themselves with assembly language syntax/tools for anything but the most critical loops of code is beyond me. A msgbox... in ASM... really?? |
|
|
|
|
|
#9 | |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
win32 asm
anyway maybe something I can learn from asm I can carry into something else. Code:
include \masm32\include\masm32rt.inc .code AppName db "Masm32:", 0 start: mov eax,7 imod 6,edx:eax cmp edx,1 jne bust MsgBox 0, str$(eax), addr AppName, MB_OK exit bust: end bust end start Quote:
Last fiddled with by science_man_88 on 2010-09-28 at 17:49 |
|
|
|
|
|
|
#10 |
|
Aug 2006
10111010110112 Posts |
|
|
|
|
|
|
#11 |
|
Aug 2002
Buenos Aires, Argentina
2·683 Posts |
You should replace the instruction you marked in red by:
xor edx,edx mov ebx,6 div ebx Then you have the quotient in EAX and the remainder in EDX. |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| installation of OS trouble | wildrabbitt | Linux | 5 | 2015-12-22 16:51 |
| Is Entropia in trouble? | ekugimps | PrimeNet | 1 | 2005-09-09 16:18 |
| More trouble in randomness | Orgasmic Troll | Math | 11 | 2005-04-15 15:26 |
| Trouble with display | ThomRuley | Hardware | 3 | 2005-01-17 23:11 |
| Trouble at t' mill | Wacky | NFSNET Discussion | 6 | 2004-01-27 17:56 |