
Code a 16-bit virtual machine with a virtual CPU, memory, six registers, and a custom assembly language featuring mov, nop, and halt, plus 65 kilobytes of code and stack memory.
Build a bare-bones virtual machine in C, focusing on the vm constructor, memory allocation, program copying, error handling, and integrating a mem copy in birch utils.
Guide students to code a virtual machine in C, constructing a program as a series of instructions such as move and no op, using a map function to size instructions.
Allocate and zero argument memory, copy instructions into the virtual machine, and assemble a small program. Add a break line to separate code from data for loading and gdb debugging.
In part 5, the lecture upgrades the virtual machine to C23 with GCC 14.2, adds a HALT instruction, and implements an execute loop with memory layout and error handling.
Define 16-bit arguments for vm instructions, capturing a1 and a2 and updating the vm registers. Refine the execute loop and implement move to set ax from a1.
Debug a 16-bit virtual machine in C by implementing a halt and correct program counter updates to avoid segmentation faults. Refine break address handling and pointer arithmetic for correct execution.
Part 8 tackles converting 16-bit to 32-bit addresses, aligning PP and BRK, and debugging the VM's fetch-execute loop, including IPO, IP, and size handling to avoid segmentation faults.
Explore coding a virtual machine in C by validating opcode handling, memory operations, and instruction flow. See how values move into AX and prepare for a stack and more instructions.
Extend the virtual machine in C by expanding the move instruction to target all registers and memory, refine encoding, and update execute and map logic with range-based handling.
Develop a simple virtual machine in C by implementing move instructions, register handling (ax, bx, cx), and memory addressing, while debugging argument parsing and endianness in the execution loop.
Explore enabling 16-bit registers with 8-bit high/low access, adding a flags register with equal, greater than, lower, and higher flags, plus macros to support granular mov operations.
Implement a switch-based instruction handler for a c vm, adding set operations that modify the flags with or and and to cover equal, greater than, higher, and lower bits.
Implement a move instruction in a C-based virtual machine, targeting full registers and their high or low parts, including ax, ah, and sp.
Develop a virtual machine in C by generating raw bytes for single instructions and implementing variable-arity functions to encode opcodes and operands into executable program memory.
Learn to implement va_args based argument handling in a C virtual machine, including program pointers, x86 arg handling, and memory copy strategies, with debugging insights.
Learn to implement a C-based virtual machine by executing stack instructions and debugging segfaults. Explore heap allocation, argument passing, and function signatures for flexible instruction input.
Learn to build a 16-bit virtual machine in C, implementing memory layout and push-pop stack operations using AX, BX, CX, DX and SP with read-only code and read-write data.
Develop and test a C virtual machine by implementing push and pop, managing a memory stack, printing memory and the stack pointer at halt, and debugging with hex memory dumps.
Code a virtual machine in C
In this extremely exciting new project we will be coding our own Virtual Machine. That means creating our own virtual CPU with registers and our own simple Assembly language. We will also have virtual memory (a stack and a code segment) and possibly some IO in form of a virtual serial port or a floppy drive.
We will be coding everything from scratch and not make use of any external libraries/dependencies. Except my own. We will barely use the standard C library at all - if we need a function, we make it. In this episode you will learn a lot about pointers, how to structure a big project and make design choices. You will also learn quite a lot about structures and different types of data structures. And of course, you'll learn the ins and outs of how a computer really works, at the low-level.
-Why learn C from dr Jonas Birch and not from the other ten Udemy instructors?
Experience in the C language. When dr Birch was 18 years old and had been coding C for five years, he was traveling all over Europe, invited to different coding and security conferences, giving lectures about C and security. Since then he has coded C almost every day - for an additional 20 years!
Experience in teaching. Dr Birch has been teaching the C language (live) almost full time the last six years, helping hundreds and hundreds of students learn the mother of all languages - in Linux.
Very soothening voice and amazing sound quality. Dr Birch has a very dark, relaxing voice which is very easy to listen to (a really underestimated feature). He is recording in a professional recording studio with enterprise level microphone and equipment, which makes for a very good listening experience.
Enroll Now or try out the free sample lectures.