Archive: invalid opcode


invalid opcode
hmm...

last time i used it it worked fine...
http://forums.winamp.com/showthread....onvertBStoDBS2

!include "MUI.nsh"
!include WinMessages.nsh

StrCpy $R0 $R2
Call ConvertBStoDBS2

; $R2 contains a valid path like c:\temp (not c:\temp\ )


Function ConvertBStoDBS2
MessageBox MB_ICONINFORMATION|MB_OK "'$R0'"
Exch $R0 ;input string
Push $R1 ;length string
Push $R2 ;output string
Push $R3 ;temp string
Push $R4 ;counter
Strlen $R1 $R0
StrCmp $R1 "0" done
StrCpy $R2 ""
StrCpy $R4 "0"
loop:
StrCpy $R3 $R0 1 $R4
StrCmp $R3 "\" "0" nobs
StrCpy $R2 "$R2$R3"
nobs:
StrCpy $R2 "$R2$R3"
IntOp $R4 $R4 + 1
IntCmp $R4 $R1 loop loop "0"
StrCpy $R0 $R2
done:
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Exch $R0 ;output string
FunctionEnd


this error cause also that the first IO is not shown - it skipped. 2nd IO is shown.

dunno :(

PS old version crashes too

Function ConvertBStoDBS
Exch $R0 ;input string
Push $R1
Push $R2
Push $R3
Push $R4
StrCpy $R1 0
loop:
IntOp $R1 $R1 - 1
StrCpy $R2 $R0 1 $R1
StrCmp $R2 "" done
StrCmp $R2 "\" 0 loop
StrCpy $R2 $R0 $R1 ;part before
Push $R1
IntOp $R1 $R1 + 1
StrCpy $R1 $R0 "" $R1 ;part after
StrCpy $R0 "$R2\\$R1"
Pop $R1
IntOp $R1 $R1 - 1
Goto loop
done:
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Exch $R0 ;output string
FunctionEnd

The most likely cause is an invalid relative jump in your script. Are you sure all relative jumps are valid?


call me dumb or sucker...

must be

Push $R2
Call ConvertBStoDBS2
Pop $R0

F*

(i found out that another scripts is working fine so far but i didnt get it)