Re: two mains

2013-01-27 Thread Tyro[17]
On 1/27/13 8:57 AM, David Nadlinger wrote: On Saturday, 26 January 2013 at 20:42:27 UTC, Tyro[17] wrote: Trying to learn from the ground up and would appreciate some assistance making sense of the following: // void main(){} [1] [...] This might not be directly relevant here, but in general,

Re: two mains

2013-01-27 Thread David Nadlinger
On Saturday, 26 January 2013 at 20:57:54 UTC, Tyro[17] wrote: On 1/26/13 3:42 PM, Tyro[17] wrote: The second is the use of leave in [2]. If I understand correctly, leave is the exact same as: movRBP,RSP popRBP So why do we need to mov RBP, RSP in [2] but not in [1]? I'

Re: two mains

2013-01-27 Thread David Nadlinger
On Saturday, 26 January 2013 at 20:42:27 UTC, Tyro[17] wrote: Trying to learn from the ground up and would appreciate some assistance making sense of the following: // void main(){} [1] [...] This might not be directly relevant here, but in general, I'd steer clear of main() for such experim

Re: two mains

2013-01-27 Thread Vladimir Panteleev
On Saturday, 26 January 2013 at 20:42:27 UTC, Tyro[17] wrote: So why do we need to mov RBP, RSP in [2] but not in [1]? I'm thinking this is because RBP contains the address of args but not sure. The x64 calling convention passes the first few arguments via registers. I think it's most likely

Re: two mains

2013-01-26 Thread Tyro[17]
On 1/26/13 3:42 PM, Tyro[17] wrote: [Snip] Both segments of code deal with a minimal D program: the first taking no arguments and the second taking a string array. Information prior to the ".text_Dmain segment" in both files mirror each other with the exception of module name differences. The f

two mains

2013-01-26 Thread Tyro[17]
Trying to learn from the ground up and would appreciate some assistance making sense of the following: // void main(){} [1] .text._Dmainsegment assume CS:.text._Dmain _Dmain: pushRBP mov RBP,RSP xor EAX,EAX

two mains

2013-01-26 Thread Tyro[17]
Trying to learn from the ground up and would appreciate some assistance making sense of the following: // void main(){} [1] .text._Dmainsegment assume CS:.text._Dmain _Dmain: pushRBP mov RBP,RSP xor EAX,EAX