Page 1 of 1

[DONE] TailBite and small problems in asm

Posted: Fri Apr 11, 2008 10:50 pm
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)

Posted: Sun Apr 13, 2008 2:00 am
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,

Posted: Sun Apr 13, 2008 12:22 pm
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

Posted: Wed Apr 16, 2008 7:06 am
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:

Posted: Mon Apr 21, 2008 8:33 pm
by ABBKlaus
I have replaced the exclusion list by a much easier approach (i hope).