Fix typos in aarch64-mes-gcc

This commit is contained in:
Artemis Tosini 2023-11-05 20:33:24 +00:00
parent b88b0184ab
commit 67780639e9
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
4 changed files with 13 additions and 13 deletions

View file

@ -28,9 +28,9 @@ void
_exit (int code)
{
asm (
"mov x7, $"SYS_exit"\n\t"
"mov x7, #"SYS_exit"\n\t"
"mov x0, %0\n\t"
"svc $0\n\t"
"svc #0\n\t"
: // no outputs "=" (r)
: "r" (code)
: "x0", "x7"

View file

@ -29,11 +29,11 @@ _write (int filedes, void const *buffer, size_t size)
{
long r;
asm (
"mov x7, $"SYS_write"\n\t"
"mov x7, #"SYS_write"\n\t"
"mov x0, %1\n\t"
"mov x1, %2\n\t"
"mov x2, %3\n\t"
"svc $0\n\t"
"svc #0\n\t"
"mov %0, x0\n\t"
: "=r" (r)
: "r" (filedes), "r" (buffer), "r" (size)

View file

@ -31,22 +31,22 @@ void
_start ()
{
asm (
"mov w0,#0\n\t"
"mov %0,w0\n"
"mov x0,#0\n\t"
"mov %0,x0\n"
: "=r" (__stdin)
: //no inputs ""
);
asm (
"mov w0,#1\n\t"
"mov %0,w0\n"
"mov x0,#1\n\t"
"mov %0,x0\n"
: "=r" (__stdout)
: //no inputs ""
);
asm (
"mov w0,#2\n\t"
"mov %0,w0\n"
"mov x0,#2\n\t"
"mov %0,x0\n"
: "=r" (__stderr)
: //no inputs ""
);
@ -56,7 +56,7 @@ _start ()
"ldr x0,[sp]\n\t" /* x0 = argc */
"add x1,sp,#8\n\t" /* x1 = &argv[0] */
"add x2,x0,#1\n\t" /* x2 = argc + 1 (skip zero word after argv) */
"lsl x2,#3\n\t" /* x2 = (argc + 1) << 3 */
"lsl x2,x2,#3\n\t" /* x2 = (argc + 1) << 3 */
"add x2,x2,x1\n\t" /* x2 = ((argc + 1) << 3) + &argv[0] */
"stp x1,x2,[sp,#0x10]!\n\t" /* argv, envp */
"stp xzr,x0,[sp,#0x10]!\n\t" /* 0, argc */

View file

@ -27,7 +27,7 @@ __sys_call_internal (long sys_call)
long r;
asm (
"mov x7, %1\n\t"
"svc $0\n\t"
"svc #0\n\t"
"mov %0, x0\n\t"
: "=r" (r)
: "r" (sys_call)
@ -44,7 +44,7 @@ __sys_call2_internal (long sys_call, long one, long two)
"mov x7, %1\n\t"
"mov x0, %2\n\t"
"mov x1, %3\n\t"
"swi $0\n\t"
"svc #0\n\t"
"mov %0, x0\n\t"
: "=r" (r)
: "r" (sys_call), "r" (one), "r" (two)