diff --git a/source2/Users/Kudzu/Kudzu-Notes.html b/source2/Users/Kudzu/Kudzu-Notes.html index e13ca0b3b..27a26908d 100644 --- a/source2/Users/Kudzu/Kudzu-Notes.html +++ b/source2/Users/Kudzu/Kudzu-Notes.html @@ -1,196 +1,158 @@ -

- Kudzu

- + public sealed class IOWrite8: AssemblerMethod + { + public override void AssembleNew(Cosmos.Assembler.Assembler aAssembler, object aMethodInfo) + { + //TODO: This is a lot of work to write to a single port. We need to have some kind of inline ASM option that can emit a single out instruction + new CPUx86.Move { DestinationReg = CPUx86.Registers.EDX, SourceReg = CPUx86.Registers.EBP, SourceDisplacement = 0xC, SourceIsIndirect = true }; + new CPUx86.Move { DestinationReg = CPUx86.Registers.EAX, SourceReg = CPUx86.Registers.EBP, SourceDisplacement = 0x8, SourceIsIndirect = true }; + new CPUx86.Out { DestinationReg = CPUx86.Registers.AL }; + } + } + ... + +

New way

+

See how much neater and self contained this is? :)

+
+				public class CPUBus 
+				{   
+					[AsmBody(Assembler = typeof(IOWrite8))]
+					public static void Write8(UInt16 aPort, byte aData) { }
+
+					// Nested class even... :) Keeps it all in one unit!
+					public class IOWrite8 : CodeBlock 
+					{
+						public override void Assemble() 
+						{
+							EDX = EBP + 0x0C;
+							EAX = EBP + 0x08;
+							Port[DX] = AL;
+						}
+					}
+				}     
+			
+ \ No newline at end of file