More complete InlineAsm

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

More complete InlineAsm

Post by remi_meier »

Hi
First of all, Int(4) shouldn't be translated to
INT (4)... (but that's not so important)

At the moment, we just can't use the FPU because of the lack of supported commands (at least in procedures it would be too complicated...).
Here is a list of the commands I miss at the moment:

Code: Select all

; FADDP
; FIADD  
; FNCLEX
; FCOMP
; FCOMPP
; FICOM
; FICOMP
; FCOS
; FSINCOS
; FDECSTP
; FDIVP
; FIDIV
; FDIVRP
; FIDIVR
; FNINIT
; FILD
; FBLD 
; FLDZ
; FLDPI
; FLDL2E
; FLDL2T
; FLDLG2
; FLDLN2
; FSTCW
; FNSTCW
; FNSTENV
; FLDENV
; FMULP
; FIMUL
; FPTAN
; FPREM1 
; FNSAVE 
; FRSTOR 
; FSTP
; FIST 
; FISTP 
; FBSTP 
; FNSTSW 
; FSUBP
; FISUB
; FSUBRP
; FISUBR
; FUCOMP
; FUCOMPP
; INVD
; UD2
; WRMSR
; RDTSC
; RDMSR
; RDPMC
; CMOVO
; CMOVNO
; CMOVB
; CMOVC
; CMOVNAE
; CMOVAE
; CMOVNB
; CMOVNC
; CMOVE
; CMOVZ
; CMOVNE
; CMOVNZ
; CMOVBE
; CMOVNA
; CMOVA
; CMOVNBE
; CMOVS
; CMOVNS
; CMOVP
; CMOVPE
; CMOVNP
; CMOVPO
; CMOVL
; CMOVNGE
; CMOVGE
; CMOVNL
; CMOVLE
; CMOVNG
; CMOVG
; CMOVNLE
; PUNPCKLBW
; PUNPCKLWD
; PUNPCKLDQ
; PACKSSWB
; PCMPGTB
; PCMPGTW 
; PCMPGTD
; PACKUSWB
; PUNPCKHBW
; PUNPCKHWD
; PUNPCKHDQ
; PACKSSDW 
; MOVD
; MOVQ
; PSLLW 
; PSRAW
; PSRLW
; PSLLD
; PSRAD
; PSRLD
; PSLLQ
; PSRLQ
; PCMPEQB
; PCMPEQW
; PCMPEQD
; EMMS
; MOVD
; MOVQ
; SETA
; SETNBE
; RSM
; XADD
; CMPXCHG8B
; PSRLW
; PSRLD
; PSRLQ
; PSUBUSB
; PSUBUSW
; PAND
; PADDUSB
; PADDUSW
; PANDN
; PSRAW
; PSRAD
; PMULHW 
; PSUBSB
; PSUBSW
; POR
; PADDSB
; PADDSW 
; PXOR
; PSLLW 
; PSLLD
; PSLLQ 
; PMADDWD
; PSUBB
; PSUBW
; PSUBD
; PADDB
; PADDW 
; PADDD
; INSB
; INSD
; INSW
; OUTSB
; OUTSD
; OUTSW
; FSTCW
; MOVSB 
; MOVSD
; MOVSW 
; CMPSB
; CMPSD
; CMPSW
; STOSB
; STOSD
; STOSW
; LODSD
; SCASB
; SCASD
; SCASW
; FLDENV
; FNSTCW
; FNSTENV
; FCMOVB
; FCMOVE
; FCMOVBE
; FCMOVU
; FUCOMPP
; FIADD
; FICOM
; FICOMP
; FIDIV
; FIDIVR
; FIMUL
; FISUB
; FISUBR
; FCMOVNB
; FCMOVNE
; FCMOVNBE
; FCMOVNU
; FNCLEX
; FUCOMI
; FCOMI
; FUCOMIP
; FCOMIP
; FBLD
; FBSTP
I don't know if every command is supported by Fasm, but mostly it's PB..
And the list is surely not complete!

And what about MMX, 3DNOW!, SSE, ...?

Perhaps it would be good if we could choose which asm-command-sets we want to use, like NORMAL, SSE, MMX, ... so we would be more free in choosing our names for variables and so..

Another wish is that PB recognizes PUSHing and POPing in Procedures for recalculating the variable addresses.

It would be cool, if everything was supported by PB :)

greetz
Remi
Athlon64 3700+, 1024MB Ram, Radeon X1600
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

fasm supports mmx 3dnow and sse, so you should be able to use them with putting a ! in front of the keyword. Have you tried this with those and the ones in your list?
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Yes this works, but it doesn't work in procedures, where local variables are on stack (yes you can access them on stack, but it's much more difficult). The only advantage of InlineAsm is that you can use local variables much easier! And the only place where I use IASM is within procedures, where I optimize them. Outside them I would loose the overview!
So please improve the InlineASM!
Athlon64 3700+, 1024MB Ram, Radeon X1600
Post Reply