Skip to content

Instantly share code, notes, and snippets.

View WiFi.cs
using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Devices.Spi;
using GHIElectronics.TinyCLR.Drivers.STMicroelectronics.SPWF04Sx;
using GHIElectronics.TinyCLR.Pins;
using System;
using System.Diagnostics;
using System.Net;
using System.Net.NetworkInterface;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
View SizeReflection.cs
using GHIElectronics.TinyCLR.Devices.Can;
using GHIElectronics.TinyCLR.Devices.SerialCommunication;
using GHIElectronics.TinyCLR.Pins;
using GHIElectronics.TinyCLR.Storage.Streams;
using System.Reflection;
namespace TinyCLRApplication1 {
public class Size {
private static object[] empty = new object[0];
private readonly object provider;
View IceCream.cs
using System;
using System.Collections.Generic;
using System.Linq;
public class Solution {
public static void Main() {
int readSingle() => int.Parse(Console.ReadLine());
IEnumerable<int> readList() => Console.ReadLine().Split(' ').Select(int.Parse);
(int sum, int count, IEnumerable<(int id, int cost)> costs) readTrip() => (readSingle(), readSingle(), readList().Select((c, i) => (i + 1, c)));
View working.k
func main() : word {
var s: A;
s.v1 = 1234;
s.v2 = 5678;
R5 = s.v1;
R6 = s.v2;
}
View struct.k
func main() : word {
var foo1: B;
var foo2: ptr[B] = &foo1;
R0 = foo1.var2.var1;
R0 = foo1.var1;
R0 = foo2->var2.var1;
R0 = foo2->var1;
R0 = foo2;
View Kohl.lst
v1: 0x0000000000000000
v2: 0x0000000000000001
_0: 0x0000000000000002
_1: 0x0000000000000003
_2: 0x0000000000000004
_3: 0x0000000000000005
_4: 0x0000000000000006
_5: 0x0000000000000007
_6: 0x0000000000000008
_7: 0x0000000000000009
View Flattening.txt
a = 1 + 2 + 3
_1 = 1;
_2 = 2;
_3 = _1 + _2;
_4 = 3;
_5 = _3 + _4;
a = _5
View FunctionVisitor.cs
public class FunctionVisitor {
private readonly FunctionDeclarationNode func;
private List<BasicBlockInstruction> currentInstructions = new List<BasicBlockInstruction>();
private BasicBlock entry;
private BasicBlock parent;
private BasicBlock current;
private FunctionVisitor(FunctionDeclarationNode func) => this.func = func;
public static Function Visit(FunctionDeclarationNode func) => new FunctionVisitor(func).Visit();
View IR.cs
using ArkeOS.Tools.KohlCompiler.Syntax;
using System.Collections.Generic;
namespace ArkeOS.Tools.KohlCompiler.IR {
public enum SymbolType {
GlobalVariable,
Constant,
LocalVariable,
FunctionArgument,
Function
View Pointers.asm
BRK
SET RSP 0x1_0000
SET RBP RSP
CALL {0x3}
HLT
SET [0x0] 0x1
SET [0x1] 0x0
SET S 0x0
SET S [S]
SET [S] 0x2
You can’t perform that action at this time.