flat assembler
Message board for the users of flat assembler.
Index
> Windows > Code conversion (MASM to FASM) |
Author |
|
Vasilev Vjacheslav 21 Apr 2007, 09:12
masm: math_da REAL4 6.135923151E-3
fasm: math_da dd 6.135923151E-3 i think you must show us your code after "ASSUME esi:PTR PARTICAL" |
|||
21 Apr 2007, 09:12 |
|
ManOfSteel 22 Apr 2007, 10:27
Here it is:
Code: mov esi, pMem ASSUME esi:PTR PARTICAL fld math_da fldpi mov ecx, NUM_OBJECTS .REPEAT ... mov [esi].x, eax mov [esi].y, edx fstp [esi].vx fstp [esi].vy fsub st, st(1) ;// a da add esi, SIZEOF PARTICAL dec ecx .UNTIL ZERO? ... What will be the content of esi at every step? |
|||
22 Apr 2007, 10:27 |
|
farrier 22 Apr 2007, 13:54
ManOfSteel,
Try: Code: mov esi, [pMem] virtual at esi my_PARTICAL PARTICAL end virtual mov [my_PARTICAL.x], eax mov [my_PARTICAL.y], edx fstp [my_PARTICAL.vx] fstp [my_PARTICAL.vy] hth, farrier _________________ Some Assembly Required It's a good day to code! U.S.Constitution; Bill of Rights; Amendment 1: ... the right of the people peaceably to assemble, ... The code is dark, and full of errors! |
|||
22 Apr 2007, 13:54 |
|
Vasilev Vjacheslav 22 Apr 2007, 17:02
my version:
Code: mov esi,[pMem] fld [math_da] fldpi mov ecx,NUM_OBJECTS .lp: mov [esi+PARTICAL.x],eax mov [esi+PARTICAL.y],edx fstp [esi+PARTICAL.vx] fstp [esi+PARTICAL.vy] fsub st,st(1) add esi,sizeof.PARTICAL dec ecx jnz .lp |
|||
22 Apr 2007, 17:02 |
|
ManOfSteel 23 Apr 2007, 06:11
Thank you very much, both versions are perfect!
|
|||
23 Apr 2007, 06:11 |
|
HexEdit 28 Apr 2007, 14:54
I think, that the "virtual" version is better.
|
|||
28 Apr 2007, 14:54 |
|
Vasilev Vjacheslav 28 Apr 2007, 15:57
i thinks they're same
|
|||
28 Apr 2007, 15:57 |
|
ManOfSteel 29 Apr 2007, 05:39
Indeed, they give the same output. The virtual method results in a smaller and clearer source code, though.
|
|||
29 Apr 2007, 05:39 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.