Hello ABBKlaus
After compiling with the following function TailBite v1.4.3 PB451
I at the time of execution the following error
Quote:
Polink: Unresolved external error '_PB_StringBasePosition
Polink: Fatal error: 1 unresolved external (s)
The procedure works well without being compiled by tailbite
Code:
ProcedureDLL.s m_h(ad.l,lng.l)
For i=0 To lng-1
num.q=PeekC(ad+i)
If Chr(num)<" "
cart$=cart$+"."
Else
cart$=cart$+Chr(num)
EndIf
hexs.s=hexs.s+RSet(Hex(num),2,"0")+" "
Next
sort.s="$"+Hex(ad)+" "+hexs+" "+cart$
ProcedureReturn sort
EndProcedure
q.q=12345678900987654321
b.s="12345678900987654321"
D.D=12345678900987654321
DDd.D=ValD("1.2345678900987654321E19")
aaa$= m_h(@b,32)
Debug m_h(@q,8)+" "+Str(q)
Debug m_h(@q,10)
Debug m_h(@d,8)+" "+StrD(d)
Debug m_h(@d,10)
Debug m_h(@ddd,8)+" "+StrD(d)
Debug m_h(@ddd,10)
ASM generated
Code:
PureBasicStart:
;
PUSH dword I_BSSEnd-I_BSSStart
PUSH dword 0
PUSH dword I_BSSStart
CALL _memset
ADD esp,12
PUSH dword 0
CALL _GetModuleHandleA@4
MOV [_PB_Instance],eax
PUSH dword 0
PUSH dword 4096
PUSH dword 0
CALL _HeapCreate@12
MOV [PB_MemoryBase],eax
CALL _SYS_InitString@0
CALL _PB_InitMemory@0
;
; ProcedureDLL.s m_h(ad.l,lng.l)
macro {MP0
_Procedure0:
PUSH ebx
PS0=32
XOR eax,eax
PUSH eax
PUSH eax
PUSH eax
PUSH eax
PUSH eax
PUSH eax
; For i=0 To lng-1
MOV dword [esp],0
_For1:
MOV ebx,dword [esp+PS0+4]
DEC ebx
CMP ebx,dword [esp]
JL _Next2
; num.q=PeekC(ad+i)
MOV ebx,dword [esp+PS0+0]
ADD ebx,dword [esp]
PUSH ebx
CALL _PB_PeekC@4
CDQ
PUSH edx
PUSH eax
POP dword [esp+8]
POP dword [esp+4+4]
; If Chr(num)<" "
MOV eax,[_PB_StringBasePosition]
PUSH eax
PUSH eax
MOV eax,dword [esp+12]
PUSH eax
CALL _PB_Chr@8
INC dword [_PB_StringBasePosition]
MOV edx,_S1
POP ecx
MOV dword [_PB_StringBasePosition],ecx
ADD ecx,[PB_StringBase]
CALL _SYS_StringInferior
JE _EndIf4
; cart$=cart$+"."
MOV edx,dword [esp+12]
PUSH dword [_PB_StringBasePosition]
CALL _SYS_CopyString@0
MOV edx,_S2
CALL _SYS_CopyString@0
LEA eax,[esp+16]
PUSH eax
CALL _SYS_AllocateString4@8
; Else
JMP _EndIf3
_EndIf4:
; cart$=cart$+Chr(num)
MOV edx,dword [esp+12]
PUSH dword [_PB_StringBasePosition]
CALL _SYS_CopyString@0
MOV eax,[_PB_StringBasePosition]
PUSH eax
PUSH eax
MOV eax,dword [esp+16]
PUSH eax
CALL _PB_Chr@8
POP eax
LEA eax,[esp+16]
PUSH eax
CALL _SYS_AllocateString4@8
; EndIf
_EndIf3:
; hexs.s=hexs.s+RSet(Hex(num),2,"0")+" "
MOV edx,dword [esp+16]
PUSH dword [_PB_StringBasePosition]
CALL _SYS_CopyString@0
MOV eax,[_PB_StringBasePosition]
PUSH eax
PUSH eax
PUSH dword _S3
PUSH dword 2
MOV eax,[_PB_StringBasePosition]
PUSH eax
PUSH eax
PUSH dword [esp+32+4]
PUSH dword [esp+36]
CALL _PB_Hex@12
MOV edx,[PB_StringBase]
ADD [esp+0],edx
CALL _PB_RSet2@16
POP eax
MOV edx,_S1
CALL _SYS_CopyString@0
LEA eax,[esp+20]
PUSH eax
CALL _SYS_AllocateString4@8
; Next
_NextContinue2:
INC dword [esp]
JNO _For1
_Next2:
; sort.s="$"+Hex(ad)+" "+hexs+" "+cart$
PUSH dword [_PB_StringBasePosition]
MOV edx,_S4
CALL _SYS_CopyString@0
MOV eax,[_PB_StringBasePosition]
PUSH eax
PUSH eax
MOV eax,dword [esp+PS0+12]
CDQ
PUSH edx
PUSH eax
CALL _PB_Hex@12
POP eax
MOV edx,_S1
CALL _SYS_CopyString@0
MOV edx,dword [esp+20]
CALL _SYS_CopyString@0
MOV edx,_S5
CALL _SYS_CopyString@0
MOV edx,dword [esp+16]
CALL _SYS_CopyString@0
LEA eax,[esp+24]
PUSH eax
CALL _SYS_AllocateString4@8
; ProcedureReturn sort
MOV edx,dword [esp+20]
PUSH dword [_PB_StringBasePosition]
CALL _SYS_CopyString@0
POP eax
ADD eax,[PB_StringBase]
JMP _EndProcedure1
; EndProcedure
MOV eax,[_PB_StringBasePosition]
ADD eax,[PB_StringBase]
MOV byte [eax],0
_EndProcedure1:
PUSH dword [esp+12]
CALL _SYS_FreeString@4
PUSH dword [esp+16]
CALL _SYS_FreeString@4
PUSH dword [esp+20]
CALL _SYS_FreeString@4
ADD esp,24
POP ebx
RET 8