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") ))
;------------------------------------------------------
RunProgram() exmaple in ASM Linux.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
Rings:
http://www.int80h.org/
http://www.int80h.org/bsdasm/
http://www.muppetlabs.com/~breadbox/sof ... eensy.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)
Rings:
http://www.int80h.org/
http://www.int80h.org/bsdasm/
http://www.muppetlabs.com/~breadbox/sof ... eensy.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)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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 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 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 ...
For those who are intrested in more Mind failuers Have a look
at -> http://www.muppetlabs.com/~breadbox/bf/
That for sure will turn you upsidedown
Funny world... And the above all happens in 15 years
Have a nice day...
Woow I can tell you, I did a lot of programming on the 6502 and 8086
in my early IceAges 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 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 ...
For those who are intrested in more Mind failuers Have a look
at -> http://www.muppetlabs.com/~breadbox/bf/
That for sure will turn you upsidedown
Funny world... And the above all happens in 15 years
Have a nice day...