We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print_b.s内で
# print_b.s .global print print: mov $0, %rcx jmp loop loop: (略) inc %rcx cmp $0x10, %rcx je loop ret
としていて、loopが16回回るはずなのに、一回しか回らない。
コンソール $ gcc -nostdlib substart.s print_b.s hello.c -o hello $ ./hello
実行結果 aaa H Hello World
# substart.s .global _start _start: call main mov $60, %eax # exit xor %rdi, %rdi # mov $0, %rdi syscall
// hello.c void print(const void* c); int main(void) { char str[] = "Hello World"; print(&"a"); print(&"a"); print(&"a"); print(&"\n"); print(&str); print(&"\n"); for (int i = 0; i < sizeof(str) / sizeof(char); i++) { print(&str[i]); } print(&"\n"); return 0; }
syscall前後でrcxが破壊されていると考えてpush, popしようとして、コメントアウトを外した。でも、gccによると
print_b.s: Assembler messages: print_b.s:13: Error: invalid instruction suffix for `push' print_b.s:15: Error: invalid instruction suffix for `pop'
と言われ、アセンブルすらできない。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
loopが回らない
print_b.s内で
としていて、loopが16回回るはずなのに、一回しか回らない。
push, popできない
syscall前後でrcxが破壊されていると考えてpush, popしようとして、コメントアウトを外した。でも、gccによると
と言われ、アセンブルすらできない。
The text was updated successfully, but these errors were encountered: