Mysterious RA value in assembly file

Programming, for all ages and all languages.
Post Reply
newanabe
Member
Member
Posts: 46
Joined: Mon Aug 05, 2013 8:15 am

Mysterious RA value in assembly file

Post by newanabe »

Hi! I am trying to translate a piece of assembly code written for GAS(I guess it is gas, cuz it's a Linux site) to NASM syntax.
Here:
https://github.com/torvalds/linux/blob/ ... 4-asm_64.S
at the line 206 I have the "RA" "RB" "RC" and "RD" I don't know where they are coming from.
I am not a GAS user, so please help me!!!!
I will appreciate it a lot!
Thanks!
Last edited by newanabe on Mon Aug 05, 2013 12:27 pm, edited 1 time in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Please help me with a GAS doubt!!!!!!!

Post by Combuster »

!!!!!!!
(...)
!!!!
I'm sure you didn't read the forum rules properly yet.
"RA" "RB" "RC" and "RD" I don't know where they are coming from.
Learn macro syntax, look at line 54-62 and 193.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
newanabe
Member
Member
Posts: 46
Joined: Mon Aug 05, 2013 8:15 am

Re: Please help me with a GAS doubt!!!!!!!

Post by newanabe »

Thank you for the help!
I think i could understand it now.

What have i done wrong? Where can I read the rules?
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Please help me with a GAS doubt!!!!!!!

Post by sortie »

Please don't use a lot of exclamation marks and beg for help. Your question isn't that important to warrant that many exclamation marks, and even if it wasn't, it isn't that important to those that would help you. If I see 7 exclamation marks, your statement better be about the imminent explosion of the sun and the annihilation of all life on Earth.

For example:

Bad topic: Please help me with a GAS doubt!!!!!!!
Good topic: Mysterious RA value in assembly file

To answer your question, look into how the GNU C preprocessor works and how the assembly file in question is preprocessed. It uses the ## assembly operator to concatenate a RA and 1 to form the RA1 value.
newanabe
Member
Member
Posts: 46
Joined: Mon Aug 05, 2013 8:15 am

Re: Mysterious RA value in assembly file

Post by newanabe »

ok, I fixed the title.
and I understood the RA problem after the combuster's answer.
thank you!
Post Reply