Execute a system command: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
(Create x86 Assembly entry for "Execute a system command") |
||
Line 2,001: | Line 2,001: | ||
=={{header|Wart}}== |
=={{header|Wart}}== |
||
<lang wart>system "ls"</lang> |
<lang wart>system "ls"</lang> |
||
=={{header|x86 Assembly}}== |
|||
{{works with|NASM}} |
|||
{{works with|Linux}} |
|||
32 bit |
|||
<lang asm> |
|||
; Executes '/bin/ls' |
|||
; Build with: |
|||
; nasm -felf32 execls.asm |
|||
; ld -m elf_i386 execls.o -o execls |
|||
global _start |
|||
section .text |
|||
_start: |
|||
mov eax, 0x0B ; sys_execve(char *str, char **args, char **envp) |
|||
mov ebx, .path ; pathname |
|||
push DWORD 0 |
|||
push DWORD .path |
|||
lea ecx, [esp] ; arguments [pathname] |
|||
xor edx, edx ; environment variables [] |
|||
int 0x80 ; syscall |
|||
.path: |
|||
db '/bin/ls', 0x00 |
|||
</lang> |
|||
=={{header|zkl}}== |
=={{header|zkl}}== |