Question on ASM.

Topics: Compiler, Off Topic, Other
Sep 29, 2012 at 7:35 PM

Hey guys. I have a question on ASM and IL.

 

Lets say I have this simple C# code.

Class Car {
       public int Passenger = 0;
       public void Change(int p) {
           this.Passenger = p;
       }
}

public class Kernel : Sys.Kernel
    {
        protected override void BeforeRun()
        {
            Car car2 = new Car();
            car2.Change(0xFF00FF);
        }

        protected override void Run()
        {
        }
    }

What would the ASM output look like? I mean for example, you pretty much cloning the Car class, and then calling a void that changes a value. I mean there's no such thing as Classes. Anyways just trying to see what the ASM would look like, so I can understand this some more. Thanks - Matt

 

if you have any good C# to ASM examples, please post them.

Coordinator
Sep 29, 2012 at 7:38 PM
On 9/29/2012 2:35 PM, civilwarrock wrote:
> What would the ASM output look like? I mean for example, you pretty much
> cloning the Car class, and then calling a void that changes a value. I
> mean there's no such thing as Classes. Anyways just trying to see what
> the ASM would look like, so I can understand this some more. Thanks - Matt
>
> if you have any good C# to ASM examples, please post them.

The .asm file is in the output dir, just look at it after compile.
Sep 29, 2012 at 7:40 PM
kudzu wrote:
On 9/29/2012 2:35 PM, civilwarrock wrote:
> What would the ASM output look like? I mean for example, you pretty much
> cloning the Car class, and then calling a void that changes a value. I
> mean there's no such thing as Classes. Anyways just trying to see what
> the ASM would look like, so I can understand this some more. Thanks - Matt
>
> if you have any good C# to ASM examples, please post them.

The .asm file is in the output dir, just look at it after compile.

I have, but its all bunched up. Hard to tell where everything is. Thanks - Matt

Coordinator
Sep 29, 2012 at 7:42 PM
On 9/29/2012 2:40 PM, civilwarrock wrote:
> I have, but its all bunched up. Hard to tell where everything is. Thanks

Look at the labels, or run it with our asm debugger.
Sep 29, 2012 at 7:44 PM
kudzu wrote:
On 9/29/2012 2:40 PM, civilwarrock wrote:
> I have, but its all bunched up. Hard to tell where everything is. Thanks

Look at the labels, or run it with our asm debugger.

Ok will do. Kudzu is there any chance I can Skype with you? And, also where do I find/use the Asm Debugger. Thanks, Matt

Coordinator
Sep 29, 2012 at 7:45 PM
On 9/29/2012 2:44 PM, civilwarrock wrote:
> Ok will do. Kudzu is there any chance I can Skype with you? And, also

Sorry I dont have time for skype right now, Im very buried with other
things.

> where do I find/use the Asm Debugger. Thanks, Matt

Set a bp, then select if from the cosmos window list.
Sep 29, 2012 at 7:49 PM
kudzu wrote:
On 9/29/2012 2:44 PM, civilwarrock wrote:
> Ok will do. Kudzu is there any chance I can Skype with you? And, also

Sorry I dont have time for skype right now, Im very buried with other
things.

> where do I find/use the Asm Debugger. Thanks, Matt

Set a bp, then select if from the cosmos window list.

Ok, no problem I understand. Alright ill take a look. What exactly will the Asm Debugger show me? And what can I learn from it? Thanks - Matt

Coordinator
Sep 29, 2012 at 11:30 PM
On 9/29/2012 2:49 PM, civilwarrock wrote:
> Ok, no problem I understand. Alright ill take a look. What exactly will
> the Asm Debugger show me? And what can I learn from it? Thanks - Matt

It will show you the ASM for the current C# line.
Sep 29, 2012 at 11:42 PM
Edited Sep 30, 2012 at 12:03 AM

Thanks Kudzu, although I can't find it? Was it in the current release? Or is it in the current devkit? Cause I just have the current release under downloads. Thanks, Matt

EDIT: Nvm I was being stupid. I got it now. Thanks =)

Coordinator
Sep 30, 2012 at 1:39 AM
On 9/29/2012 6:43 PM, civilwarrock wrote:
> Thanks Kudzu, although I can't find it? Was it in the current release?
> Or is it in the current devkit? Cause I just have the current release
> under downloads. Thanks, Matt

Dont know if its before or after last user kit.
Sep 30, 2012 at 2:57 AM

If someone could show me this, I would seriously be happy. 

Ok so here's what I am trying to do. I have a vairable called letter like this

Letter: db 104

which 104 = h in Text. Now I want to put variable 'Letter' into memory location 0xB8000 so it's displayed. I have the following code, but it

never works. 

mov byte[0xB8000], Letter

and it never is the letter. How can I define a variable that is one byte? Then insert it to a memory location? Do I have to use the stack?

Also, could this be possible. Could you have a variable like this

word: db 104, 15

which if you inserted into Memory location 0xB8000 you would get a h that's white. Can you do this by using mov? Thanks guys, sometimes I swear there is not info on the simplest of things. =) 

That or assembly hates me.