Did ASM syntax changed for PB 6.00 alfa?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Psychophanta
Addict
Addict
Posts: 4970
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Did ASM syntax changed for PB 6.00 alfa?

Post by Psychophanta »

This code is inside one of my procedures. It does halt the compiled program in the PB 6.00a5, in normal mode and also in Backend C:

Code: Select all

    !mov edi,dword[p.p_fi]
    !fld dword[edi+12]; <- get *fi\m
    !fsincos
    !fstp dword[p.v_Rt]; <- Rt\x=Cos(*fi\m)
    !fstp dword[p.v_Rt+4]; <- Rt\y=Sin(*fi\m)
Is it bad written?
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by STARGÅTE »

Have you saved edi before you overwrite it? edi is no volatile register, just rax, rcx, rdx, r8 and r9.
In the C-backend, no ASM code is allowed.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
juergenkulow
Enthusiast
Enthusiast
Posts: 544
Joined: Wed Sep 25, 2019 10:18 am

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by juergenkulow »

Code: Select all

; fsincos in C Backend
Define rcos.f, rsin.f, angle.f=3.141
! asm volatile("fsincos" : "=%&t" (v_rcos), "=%&u" (v_rsin) : "0" (v_angle));
SetClipboardText(StrF(rsin)+" "+StrF(rcos))
; 0.0005926211 -0.9999998212
Please ask your questions, because switch on the cognition apparatus decides on the only known life in the universe.Wersten :DDüsseldorf NRW Germany Europe Earth Solar System Flake Bubble Orionarm
Milky Way Local_Group Virgo Supercluster Laniakea Universe
User avatar
Psychophanta
Addict
Addict
Posts: 4970
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Psychophanta »

Previous versions of PB do not have problem with it.
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by STARGÅTE »

Psychophanta wrote: Fri Oct 01, 2021 2:58 pm Previous versions of PB do not have problem with it.
This doesn't mean that it was correct (or allowed) in the previous versions.
The best example is the "problem" with some codes using long instead of integers and now give errors in PB 6.0 while handing with IDs or addresses:
Bug with .l PB6 a3 - ASM ????
[Done] Beta4 IDE -IMA Error
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
Psychophanta
Addict
Addict
Posts: 4970
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Psychophanta »

By the way,

Code: Select all

!push edi
not allowed since 5.70 :shock:
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Mijikai »

Psychophanta wrote: Fri Oct 01, 2021 4:02 pm By the way,

Code: Select all

!push edi
not allowed since 5.70 :shock:
Hm works just fine here (5.73 x86).
User avatar
Psychophanta
Addict
Addict
Posts: 4970
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Psychophanta »

Mijikai wrote: Fri Oct 01, 2021 4:14 pm
Psychophanta wrote: Fri Oct 01, 2021 4:02 pm By the way,

Code: Select all

!push edi
not allowed since 5.70 :shock:
Hm works just fine here (5.73 x86).
Not in the (x64) versions :?
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Mijikai »

Fasm says there is no such thing so i think PB is correct.

fasm:

Code: Select all

use64
push edi
User avatar
Psychophanta
Addict
Addict
Posts: 4970
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Psychophanta »

Mijikai wrote: Fri Oct 01, 2021 4:26 pm Fasm says there is no such thing so i think PB is correct.

fasm:

Code: Select all

use64
push edi
It still does not work.
The only thing x64 brings to me is called PROBLEMS. :evil:
No improvement at all for the FPU, just problems. :evil:
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by wilbert »

Psychophanta wrote: Fri Oct 01, 2021 5:53 pmIt still does not work.
The only thing x64 brings to me is called PROBLEMS. :evil:
No improvement at all for the FPU, just problems. :evil:
The x64 name of the register is rdi instead of edi.
So you need to push rdi.
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
Psychophanta
Addict
Addict
Posts: 4970
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Psychophanta »

Well, until now, I believed the old x86 code was compatible with x64.
So, there is open a new question to me: how the hell a code which runs on a windows NT or windows 2000, also runs ok on a wind 10 64bit? Is that all the windows code is not executeable, but a source code compiled at real time or something? :?: :| :?: :|
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Mijikai »

If you compile your code as x86 executable it will run on x64 Windows without change.
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Rinzwind »

64 bit Windows includes all 32 bit Windows libraries (hence program files (x86) and the stupidly named syswow64. 32 bit Windows included 16 bit libraries. Those are not included anymore in 64 bit.
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Did ASM syntax changed for PB 6.00 alfa?

Post by Denis »

Intel documentation about push instruction

In 64-bit mode
PUSH r/m32 is N.E. i.e.

N.E. — Indicates an instruction syntax is not encodable in 64-bit mode (it may represent part of a sequence of
valid instructions in other modes).


AMD documentation
In 64-bit mode, this instruction defaults to a 64-bit operand size and there is no prefix available to
encode a 32-bit operand size


you have to push in 64-bit mode rdi as wilbert tells you
A+
Denis
Post Reply