0

I'm using MacBook Pro to learn assembly language. I tried to run the assembly program which contains .ascil "the processor vender id is 'xxxxxxxxxxxx'\n" in my terminal, but somethings bad happened:

macdeMacBook-Pro:assembly mac$ as -o cpuid.o test1
test1:4:2: error: unknown directive
        .ascil "the processor vender id is 'xxxxxxxxxxxx'\n"
        ^

I found someone said it was because the derivative was not longer supported in 64. But how can I solve it? Also, if someone have learned Professional Assembly Language, please share your experiences. Thanks!

4
  • 6
    Isn't that supposed to be .ascii
    – Mat
    Nov 13, 2019 at 6:41
  • 1
    unrelated: call your GAS-syntax asm source file test1.s or .S like a normal person. Nov 13, 2019 at 6:52
  • @Yunnosch: are you objecting to "like a normal person"? I'm intending that as a joking way of pointing out that what someone is doing is unusual and not what most people do, and that there's a better way. Does it come across as rude in this case to you? Or are you just worried it might to some hypothetical reader? (Serious question; I can see the hypothetical but I hope most people wouldn't read it as rude. But I'd like to know another person's perspective.) Nov 13, 2019 at 7:07
  • @Yunnosch: Thanks. It's a fun phrase I like to use, but probably works better with more friendly/helpful context to make it more obvious it's not an insult. In this case my followup comments should be enough, and it's off topic anyway so I'm not going to repost it. Nov 13, 2019 at 7:11

1 Answer 1

2

change .ascil to .ascii

ascii "string": The .ascii directive places the characters in string into the object module at the current location but does not terminate the string with a null byte (\0). String must be enclosed in double quotes (") (ASCII 0x22). The .ascii directive is not valid for the .bss section.

reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.