при компиляции
выдаются ошибки в консоли:
aarch64-none-elf-as main.o -o main
main.o: Assembler messages:
main.o: Warning: end of file not at end of a line; newline inserted
main.o:1: Error: junk at end of line, first unrecognized character valued 0x7f
main.o:1: Error: junk at end of line, first unrecognized character valued 0x1
main.o:1: Error: unknown mnemonic `·' -- `·'
main.o:1: Error: junk at end of line, first unrecognized character valued 0x1
main.o:1: Error: unknown mnemonic `Р' -- `Р☺️'
main.o:1: Error: junk at end of line, first unrecognized character is `@'
main.o:1: Error: junk at end of line, first unrecognized character is `@'
main.o:1: Error: junk at end of line, first unrecognized character valued 0x8
main.o:1: Error: junk at end of line, first unrecognized character valued 0x7
main.o:1: Error: unknown mnemonic ?Тб' -- ?Тб'
main.o:1: Error: unknown mnemonic `x' -- `x☻☺️'
main.o:1: Error: unknown mnemonic `x' -- ?R☺️'
main.o:1: Error: unknown mnemonic `Ф' -- `Ф'
main.o:1: Error: unknown mnemonic ?ТЁ' -- ?ТЁ♂?R☺️'
main.o:1: Error: unknown mnemonic `Ф' -- `Ф'
main.o:1: Error: junk at end of line, first unrecognized character valued 0xe
main.o:1: Error: unknown mnemonic `hello' -- `hello,ARM64!'
main.o:2: Error: junk at end of line, first unrecognized character valued 0x3
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1
main.o:2: Error: junk at end of line, first unrecognized character valued 0x3
main.o:2: Error: junk at end of line, first unrecognized character valued 0x3
main.o:2: Error: junk at end of line, first unrecognized character valued 0x3
main.o:2: Error: junk at end of line, first unrecognized character valued 0x4
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1
main.o:2: Error: junk at end of line, first unrecognized character valued 0x3
main.o:2: Error: unknown mnemonic `ся' -- `ся♫'
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1b
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1e
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1
main.o:2: Error: junk at end of line, first unrecognized character is `!'
main.o:2: Error: junk at end of line, first unrecognized character valued 0x10
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1
main.o:2: Error: unknown mnemonic `helloworld' -- `helloworld'
main.o:2: Error: unknown mnemonic `helloworld_len' -- `helloworld_len'
main.o:2: Error: unknown mnemonic `$x' -- `$x'
main.o:2: Error: unknown mnemonic `$d' -- `$d'
main.o:2: Error: unknown mnemonic `_start' -- `_start'
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1
main.o:2: Error: junk at end of line, first unrecognized character valued 0x2
main.o:2: Error: unknown pseudo-op: `.symtab'
main.o:2: Error: unknown pseudo-op: `.strtab'
main.o:2: Error: unknown pseudo-op: `.shstrtab'
main.o:2: Error: unknown pseudo-op: `.rela.text'
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1
main.o:2: Error: junk at end of line, first unrecognized character valued 0x6
main.o:2: Error: junk at end of line, first unrecognized character is `@'
main.o:2: Error: junk at end of line, first unrecognized character is `0'
main.o:2: Error: junk at end of line, first unrecognized character valued 0x8
main.o:2: Error: junk at end of line, first unrecognized character valued 0x1b
main.o:2: Error: junk at end of line, first unrecognized character valued 0x4
main.o:2: Error: junk at end of line, first unrecognized character is `@'
main.o:2: Error: unknown mnemonic ?' -- ?☺️'
.data /* Data segment: define our message string and calculate its length. */ helloworld: .ascii "Hello, ARM64!\n" helloworld_len = . - helloworld .text .globl _start _start: /* syscall write(int fd, const void *buf, size_t count) */ mov x0, #1 /* fd := STDOUT_FILENO */ ldr x1, =helloworld /* buf := msg */ ldr x2, =helloworld_len /* count := len */ mov w8, #64 /* write is syscall #64 */ svc #0 /* invoke syscall */ /* syscall exit(int status) */ mov x0, #0 /* status := 0 */ mov w8, #93 /* exit is syscall #1 */ svc #0 /* invoke syscall */
у тя точно верные обозначения коментариев? похоже на сишные, но пишешь на асме
Если это aarch64-none-elf-as ассемблер, то вы ему на вход какой-то бинарь скорее всего подаёте, нужно наоборот main -o main.o
я пытался еще полностью убрать их
спасибо, сейчас попробую
уоттак попробуй aarch64-none-elf-as --main.s -o main.o aarch64-none-elf-as main.s -o main.o upd: ОБНОВИЛ!
aarch64-none-elf-as: unrecognized option `--main.s'
тогда второй вариант
сработало, но в гайде еще из main.o комиплят main
там и не as, а что-то другое ld какой-нибудь
Обсуждают сегодня