[DONE] TailBite and small problems in asm

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

Lna
User
User
Posts: 21
Joined: Wed Dec 06, 2006 10:49 pm
Location: France

[DONE] TailBite and small problems in asm

Post by Lna »

Hi,

'TailBite V1.3 PR 1.871 + PureBasic 4.10 + asm' don't want tailbited. :roll:

Code: Select all

ProcedureDLL.l test_esp()
  
  XOR EAX,EAX
  
  PUSH WORD 12
  
  MOV DX,WORD[ESP] ; <- 1st bug (4.10) (NAMELIB_DX,WORD[ESP])
  
  POP CX
  
  MOV AX,DX        ; <- 2nd bug (4.10) (MOV AX,NAMELIB_DX)
  
  ProcedureReturn
  
EndProcedure

Debug test_esp() ; Return 12

Code: Select all

ProcedureDLL.l test_espp()
  
  XOR EAX,EAX  
  
;  PUSH WORD 12
  
;  MOV DX,WORD[ESP] ; <- 1st bug (4.10) (NAMELIB_DX,WORD[ESP])
  
;  POP CX
  
  MOV AX,DX         ; <- 2nd bug (4.10) (MOV AX,NAMELIB_DX)
  
  ProcedureReturn
  
EndProcedure

Debug test_espp() ; Return 0

Code: Select all

ProcedureDLL.l test_esppp()
  
  PUSH DWORD 12
  
  MOV EDX,DWORD[ESP] ; <- bug (4.10) (NAMELIB_DWORD[ESP])
  
  POP ECX
  
  MOV EAX,EDX        ; <- no bug (4.10)
  
  ProcedureReturn
  
EndProcedure

Debug test_esppp() ; Return 12
Thank you for watching. 8)
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

For the last code block, I'd try:

Code: Select all

mov dword edx, [esp]
For the first and second blocks, I'd try using 32 bit registers if it's an option.

(Just guessing, anyway, hope it helps) :oops:

Regards,
El_Choni
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

fixed for the next version.

Hi El_Choni,
Do you remember your varalias routine ?
You added D and F as varalias, i think its for detecting things like this :

Code: Select all

...  PUSH   dword [D1]
...  FMUL   dword [F1]

...
F1: dd 1092616192
F2: dd 1103835955
F3: dd 0
D1: dd 1717986918,1077503590
I have already setup an exclusion list for this:

Code: Select all

                            Select Trim(Left(ThisLine$,rem-1))
                              Case "MOV DL,AL"
                              Case "MOV DH,AH"
                              Case "CMP AL,DL"
                              Case "MOV DX,WORD[ESP]"
                              Case "MOV AX,DX"
                              Case "MOV EDX,DWORD[ESP]"
                              Default
                                THS$ = Left(ThisLine$, vPos-1)
                                THS$+LibName$+"_"+Right(ThisLine$, Len(ThisLine$)-vPos+1)
                                ThisLine$ = THS$
                                vPos+Len(LibName$+"_")
                            EndSelect
Lna
User
User
Posts: 21
Joined: Wed Dec 06, 2006 10:49 pm
Location: France

Post by Lna »

I did not know, we could use the prefix 'dword' in this way. 8)
Thank you for the trick, El_Choni. :wink:

The exclusion list is a very good idea :idea: , and easy to modify for everyone.
Thank you ABBKlaus. :wink:
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

I have replaced the exclusion list by a much easier approach (i hope).
Post Reply