Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Viewed less than a minute ago

7LUX0N120vyXg86o

Bash script bash 5.0.17(1)-release

Created at 1 minute ago

Created by anonymous

Author

anonymous

1 minute ago

Language

Bash script

Compiler

bash 5.0.17(1)-release

Options
セオライド・テクノロジー㈱株式会社フィックスターズ
Siv3D

Author

anonymous

1 minute ago

test.s
driver.c
›
9
1
2
3
gcc -o test test.s driver.c
./test

›
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.global my_subroutine
my_subroutine:
pushq %rbp
movq %rsp, %rbp

subq $64, %rsp
movq %rdi, -64(%rbp)

# try to print the first character
movq -64(%rbp), %rdi # restore the saved pointer
#movzx (%rdi), %edi # read a character
movzb (%rdi), %rdi
call putchar

# try to print the second character
movq -64(%rbp), %rdi # restore the saved pointer
movzx 1(%rdi), %edi # read a character
call putchar

movq %rbp, %rsp
popq %rbp

ret

›
9
1
2
3
4
5
6
void my_subroutine(const char*);

int main(void) {
my_subroutine("Hello World!");
return 0;
}
$ bash prog.sh
He
Exit Code:
0
セオライド・テクノロジー㈱株式会社フィックスターズ
Siv3D