public void AddExternCall(string externCall, string comment = "") { externStringSet.Add(externCall); AppendCommentedLine($"EXTERN, \"{externCall}\"", comment); programCounter += UdonSharpUtils.GetUdonInstructionSize("EXTERN"); }
public void AddJumpIfFalse(JumpLabel jumpTarget, string comment = "") { if (jumpTarget.IsResolved) { AppendCommentedLine($"JUMP_IF_FALSE, {jumpTarget.AddresStr()}", comment); } else { AppendCommentedLine($"JUMP_IF_FALSE_LABEL, [{jumpTarget.uniqueName}]", comment); } programCounter += UdonSharpUtils.GetUdonInstructionSize("JUMP_IF_FALSE"); }
public void AddJump(JumpLabel jumpTarget, string comment = "") { #if USE_UDON_LABELS AppendCommentedLine($"JUMP, {jumpTarget.uniqueName}", comment); #else if (jumpTarget.IsResolved) { AppendCommentedLine($"JUMP, {jumpTarget.AddresStr()}", comment); } else { AppendCommentedLine($"JUMP_LABEL, [{jumpTarget.uniqueName}]", comment); } #endif programCounter += UdonSharpUtils.GetUdonInstructionSize("JUMP"); }
public void AddCopy(string comment = "") { AppendCommentedLine("COPY", comment); programCounter += UdonSharpUtils.GetUdonInstructionSize("COPY"); }
public void AddJumpIndirect(SymbolDefinition addressSymbol, string comment = "") { AppendCommentedLine($"JUMP_INDIRECT, {addressSymbol.symbolUniqueName}", comment); programCounter += UdonSharpUtils.GetUdonInstructionSize("JUMP_INDIRECT"); }
public void AddJumpToExit() { AppendCommentedLine($"JUMP, 0xFFFFFFFF", ""); programCounter += UdonSharpUtils.GetUdonInstructionSize("JUMP"); }
private void AddPush(string heapAddress, string comment) { AppendCommentedLine($"PUSH, {heapAddress}", comment); programCounter += UdonSharpUtils.GetUdonInstructionSize("PUSH"); }
public void AddJumpIndirect(SymbolDefinition addressSymbol, string comment = "") { //throw new System.NotImplementedException("Jump indirect instruction is not implemented in UdonSharp yet."); // I'm not sure why JUMP_INDIRECT both takes an address and pops an address from the stack AppendCommentedLine($"JUMP_INDIRECT, {addressSymbol.symbolUniqueName}", comment); programCounter += UdonSharpUtils.GetUdonInstructionSize("JUMP_INDIRECT"); }