Just starting out? Need help? Post your questions and find answers here.
Ralf
Enthusiast
Posts: 203 Joined: Fri May 30, 2003 1:29 pm
Location: Germany
Post
by Ralf » Sun Jun 19, 2005 1:19 pm
Is there any way, to parse a labeladress to a procedure like following "not working" example
Code: Select all
; ---- Label as argument in Procedure? ----
Procedure LabelTest(?LabelAdress)
Restore ?LabelAdress
Read text.s
Debug text.s
EndProcedure
LabelTest(?label2)
End
DataSection
label1:
Data.s "Text from Label 1"
label2:
Data.s "Text from Label 2"
label3:
Data.s "Text from Label 3"
EndDataSection
jack
Addict
Posts: 1358 Joined: Fri Apr 25, 2003 11:10 pm
Post
by jack » Sun Jun 19, 2005 1:34 pm
Code: Select all
; ---- Label as argument in Procedure? ----
Procedure LabelTest(LabelAdress.l)
! MOV eax,[esp]
! MOV dword [PB_DataPointer],eax
Read text.s
Debug text.s
EndProcedure
LabelTest(?label2)
End
DataSection
label1:
Data.s "Text from Label 1"
label2:
Data.s "Text from Label 2"
label3:
Data.s "Text from Label 3"
EndDataSection
Ralf
Enthusiast
Posts: 203 Joined: Fri May 30, 2003 1:29 pm
Location: Germany
Post
by Ralf » Sun Jun 19, 2005 1:36 pm
very cool jack! many thanks! *GREAT*
Your example with strings and modifing to read vals works fine! But in my example i get everytime "invalied memory adress" message... (does not work) - now i am trying to check where the problem is...
possible the labeladress is doublelong?
Ralf
Enthusiast
Posts: 203 Joined: Fri May 30, 2003 1:29 pm
Location: Germany
Post
by Ralf » Sun Jun 19, 2005 2:07 pm
why does this doesnt work.. inline asm enabled..
Code: Select all
Procedure WhatsWrong(LabelAdress.l)
! MOV eax,[esp]
! MOV dword [PB_DataPointer],eax
Read Value.w
Debug Value.w
EndProcedure
WhatsWrong(label1)
DataSection
label1:
Data.w 4096 ; anzahl
EndDataSection
sec
Enthusiast
Posts: 792 Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:
Post
by sec » Sun Jun 19, 2005 2:16 pm
you're missing ? , it would be WhatsWrong(? label1)
Ralf
Enthusiast
Posts: 203 Joined: Fri May 30, 2003 1:29 pm
Location: Germany
Post
by Ralf » Sun Jun 19, 2005 2:24 pm
sec wrote: you're missing ? , it would be WhatsWrong(? label1)
oh my god
i havent noticed that while searching for the bug... thanks