It is currently Thu Dec 05, 2019 4:41 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject:
PostPosted: Sat Dec 28, 2002 9:36 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by pbdep.


Hi,

Because it seems PB v3.30 does have RunProgram defined but is
not executed you could workout with the following example I
mixed it in 2 minutes.. Im lazy :) but its usefull. If you want the
Arguments and Environment settings You have to point them out
to and Array and end with a Null-byte. Hope its usefull. Pbdep.


;------------------------------------------------------
; execute program
;------------------------------------------------------
; You can extent by passing Environment and Arguments
; for returned errors see also /errno.h
;------------------------------------------------------
Procedure NewRunProgram(fname$)

FILENAME.s = FNAME$+chr(0)
ENVP.s = chr(0)
ARGV.s = chr(0)
RESULT = 0

MOV EAX,11 ; execve
MOV EBX,FILENAME ; filename
MOV ECX,ARGV ; arguments
MOV EDX,ENVP ; environment
INT 0X80 ; syscall
MOV RESULT,EAX ; result, if errors

ProcedureReturn RESULT
EndProcedure

printn (str( NewRunprogram("./file") ))


;------------------------------------------------------


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 28, 2002 10:58 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by fred.

FILENAME.s = FNAME$+chr(0)

just for your info, all string in pb are null terminated. Nice snippet anyway :).

Fred - AlphaSND


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Dec 28, 2002 11:11 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by pbdep.

Quote:
Originally posted by fred

FILENAME.s = FNAME$+chr(0)

just for your info, all string in pb are null terminated. Nice snippet anyway :).

Fred - AlphaSND



Heee i did not know that :wink: I thought only the ones
with PokeS ..

Thanks for the tip !

Norman.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Dec 29, 2002 7:23 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by boop64.

Thanks for the info pbdep ^_^!
I knew it could be done it's just I didn't know how to do it in asm.


Boop64


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Dec 29, 2002 8:09 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by Rings.

Let the good old times roll...

i see heavy INT Calls next time.....

i just should read some api- and system decriptions..


Its a long way to the top if you wanna .....CodeGuru


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Dec 29, 2002 7:26 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by Danilo.

Rings:
http://www.int80h.org/
http://www.int80h.org/bsdasm/
http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
http://www.janw.easynet.be/eng.html
http://www.linuxassembly.org/
http://linuxassembly.org/linasm.html
http://www.lxhp.in-berlin.de/lhpf8.html
http://www.winehq.com/

cya,
...Danilo

(registered PureBasic user)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 30, 2002 9:07 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by pbdep.


Woow I can tell you, I did a lot of programming on the 6502 and 8086
in my early IceAges :wink: for some years, but It took me 3 hours to understand how linux handels Assembly, coding the NewRunprogram() was
done in 2 minutes but befor I had the clue on linux :wink: hahaha..
Thats the trouble with those higher languages dies day, you dont have
to bother anymore about whats beneath it...
Well i learned form reading my Eyesout the last few days that the
32/64-bits are pritty changed compared to the 16 bits I used to do in
Asm coding... okay the basic are the same but i cant find my way in
the registers anymore :wink:...

For those who are intrested in more Mind failuers :wink: Have a look
at -> http://www.muppetlabs.com/~breadbox/bf/

That for sure will turn you upsidedown :wink:

Funny world... And the above all happens in 15 years :wink:

Have a nice day...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye