%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.html.cs" Inherits="XSharp_index" %>
X# compiles C# code into assembly, but does it as it runs. This allows the use of intellisense, and modification of the output using C#.
EBP = EBP + 32;
This is not possible because C# operator overloading does not look at return
type but only the operand types. That is C# sees Register + int. If we supported
the previous example, then X# could not support:
EAX = Memory[EBP + 4];
In short, C# sees these two as the same and so X# can only support one. Because
the memory addressing is used more frequently than adding a constant to a
register, X# supports it.
To add a constant to a register use:
EBP.Add(32);
Valid and usable. Correspond to Inc and Dec.
Example:
EAX = EAX << 2;
Source and destination register must be the same.
Example:
EAX = 0x40;
Example:
EAX = EBP;
Address can be a string label. i.e. EAX = Memory["Data1"]
public static implicit operator RegisterEAX(Cosmos.Assembler.ElementReference aReference) { Instance.Move(aReference); return Instance; }
Example:
EAX = AddressOf("Labelname");