Copyright (C) 2022-present @Maarten_ Code usage/copy requires proper credit This basic stack machine should allow for more advanced procedures in Scratch. Conventional functions are not able to return data. Despite the community's effort, it looks like Scratch is not adding this anytime soon. This can be used to return items onto the stack. Stack is resizable. Does not include a demo. Glossary for names are put at the bottom. Code contains seven functions in total: - ENTER (@Int X) Enter a stackframe, and reserve X spaces for local variables. Uses EBP, ESP - LEAVE Leave a stackframe Uses EBP, ESP - POP Increments ESP, pops from the stack. - PUSH (@Any X) Decrements ESP (Stack grows down), pushes X onto the stack. - System initialisation Initialise system, registers, and its memory - System logging (@Any X) Log an action X to the console - System memory refill Refill (broken/missing) memory The following are assembly x86 instructions: ENTER, LEAVE, PUSH, POP The following are assembly x86 32-bit registers: EAX, EBX, ECX, EBP, ESP Stackframes (ENTER, LEAVE): https://stackoverflow.com/questions/5858996/enter-and-leave-in-assembly Registers: https://wiki.osdev.org/CPU_Registers_x86 See the Intel (R) manual on the x86 ISA for more specific and detailed information.