Uploaded July 2020 | Updated September 2026, 2 weeks ago
In this episode we're learning about memory bank switching - a technique common in the retro game console days - that allows us to address more memory than the limited address space that 16 bits provides!
=[ ℹ About ℹ ]=
This series is all about building a powerful virtual machine in JavaScript with the following features:
- A flexible, extensible, register-based virtual machine
- Support for signed, unsigned and floating point operations
- A call stack
- Interrupt capabilities
- Ability to do memory mapping for IO
- An assembly language with macro and module support
- A higher level, C like language. We'll use and expand the library from the parser combinators from scratch series
- And finally, to be able to take the whole thing into the browser and extend it to create a sort of fantasy console - an emulator for a machine that never existed
- 💌 Updates to your inbox: tinyletter.com/lowleveljavascript
- ⭐️ Patreon: patreon.com/lowleveljavascript
- Series Playlist: youtube.com/playlist?list=PLP29wDx6QmW5DdwpdwHCRJsEubS5NrQ9b&playnext=1&index=1
- Github Repo: github.com/LowLevelJavaScript/16-Bit-Virtual-Machine
- Bank Switching: en.wikipedia.org/wiki/Bank_switching
- 16BitVM Episode 5: youtu.be/hLYGTpvoMgE
=[ 🔗 Links 🔗 ]=
- Playlist: youtube.com/playlist?list=PLP29wDx6QmW5DdwpdwHCRJsEubS5NrQ9b&playnext=1&index=1
- Github Repo: github.com/LowLevelJavaScript/16-Bit-Virtual-Machine
In this episode we're learning about memory bank switching - a technique common in the retro game console days - that allows us to address more memory than the limited address space that 16 bits provides!
=[ ℹ About ℹ ]=
This series is all about building a powerful virtual machine in JavaScript with the following features:
- A flexible, extensible, register-based virtual machine
- Support for signed, unsigned and floating point operations
- A call stack
- Interrupt capabilities
- Ability to do memory mapping for IO
- An assembly language with macro and module support
- A higher level, C like language. We'll use and expand the library from the parser combinators from scratch series
- And finally, to be able to take the whole thing into the browser and extend it to create a sort of fantasy console - an emulator for a machine that never existed
- 💌 Updates to your inbox: tinyletter.com/lowleveljavascript
- ⭐️ Patreon: patreon.com/lowleveljavascript
- Series Playlist: youtube.com/playlist?list=PLP29wDx6QmW5DdwpdwHCRJsEubS5NrQ9b&playnext=1&index=1
- Github Repo: github.com/LowLevelJavaScript/16-Bit-Virtual-Machine
- Bank Switching: en.wikipedia.org/wiki/Bank_switching
- 16BitVM Episode 5: youtu.be/hLYGTpvoMgE
=[ 🔗 Links 🔗 ]=
- Playlist: youtube.com/playlist?list=PLP29wDx6QmW5DdwpdwHCRJsEubS5NrQ9b&playnext=1&index=1
- Github Repo: github.com/LowLevelJavaScript/16-Bit-Virtual-Machine
![Worlds Simplest Bootloader :: Bare Metal Programming Series 4
In this episode of the bare metal programming series, were taking our first steps into building a fully fledged bootloader! To do this, we need to split the application in two, build some supporting scripts, learn how to use linker scripts, and understand some of the internal CPU registers for relocating the interrupt vector table at runtime.
=[ 🔗 Links 🔗 ]=
🎥 Series Playlist: https://www.youtube.com/playlist?list=PLP29wDx6QmW7HaCrRydOnxcy8QmW0SNdQ
🗣 Discord: https://discord.gg/FPWaVgk
⭐️ Patreon: https://www.patreon.com/lowleveljavascript
💻 Github Repo: https://github.com/lowbyteproductions/bare-metal-series Worlds Simplest Bootloader :: Bare Metal Programming Series 4](https://i.ytimg.com/vi/cfNJ85cX-ms/mqdefault.jpg)
![The End Of Low Level JavaScript
Low Level JavaScript is no more.
=[ 🔗 Links 🔗 ]=
💌 Updates to your inbox: https://tinyletter.com/lowleveljavascript
🗣 Discord: https://discord.gg/FPWaVgk
⭐️ Patreon: https://www.patreon.com/lowleveljavascript The End Of Low Level JavaScript](https://i.ytimg.com/vi/cpb02XgX_FA/mqdefault.jpg)
![[stream] Driver For SPI Flash + Bus Pirate in TypeScript
=[ 🔗 Links 🔗 ]=
💌 Updates to your inbox: https://tinyletter.com/lowleveljavascript
🗣 Discord: https://discord.gg/FPWaVgk
⭐️ Patreon: https://www.patreon.com/lowleveljavascript
💻 Github Repo: [stream] Driver For SPI Flash + Bus Pirate in TypeScript](https://i.ytimg.com/vi/e7_lAcVndNo/mqdefault.jpg)
![16-Bit Virtual Machine in JavaScript 001
In this episode we begin implementing a 16-bit virtual machine from scratch in JavaScript. The concepts of computation are introduced, along with the basics of assembly language and machine code.
=[ ℹ About ℹ ]=
This series is all about building a powerful virtual machine in JavaScript with the following features:
- A flexible, extensible, register-based virtual machine
- Support for signed, unsigned and floating point operations
- A call stack
- Interrupt capabilities
- Ability to do memory mapping for IO
- An assembly language with macro and module support
- A higher level, C like language. Well use and expand the library from the parser combinators from scratch series
- And finally, to be able to take the whole thing into the browser and exend it to create a sort of fantasy console - an emulator for a machine that never existed
=[ 🔗 Links 🔗 ]=
- ⭐️ Patreon: https://www.patreon.com/lowleveljavascript
- 💌 Updates to your inbox: https://tinyletter.com/lowleveljavascript
- Playlist: https://www.youtube.com/playlist?list=PLP29wDx6QmW5DdwpdwHCRJsEubS5NrQ9b&playnext=1&index=1
- Github Repo: https://github.com/LowLevelJavaScript/16-Bit-Virtual-Machine
- 16BitJS: https://github.com/francisrstokes/16bitjs
- VMFC: https://github.com/francisrstokes/vmfc
- Turing Machine: https://en.wikipedia.org/wiki/Turing_machine
- Von Neumann architecture: https://en.wikipedia.org/wiki/Von_Neumann_architecture
- CPU: https://en.wikipedia.org/wiki/Central_processing_unit
- Stack Machine: https://en.wikipedia.org/wiki/Stack_machine
- Register Machine: https://en.wikipedia.org/wiki/Register_machine
- Instruction set architecture: https://en.wikipedia.org/wiki/Instruction_set_architecture 16-Bit Virtual Machine in JavaScript 001](https://i.ytimg.com/vi/fTBwD3sb5mw/mqdefault.jpg)
![First Successful Firmware Update! :: Bare Metal Programming Series 11
In this episode, were building the firmware updater application, which communicates with the bootloader in order to send a firmware update reliably over USB/UART. Its a fun break from writing low level C, and a chance to write some code in language that provides nice abstractions for sequencing asynchronous code!
=[ 🔗 Links 🔗 ]=
🎥 Series Playlist: https://www.youtube.com/playlist?list=PLP29wDx6QmW7HaCrRydOnxcy8QmW0SNdQ
🗣 Discord: https://discord.gg/FPWaVgk
⭐️ Patreon: https://www.patreon.com/lowleveljavascript
💻 Github Repo: https://github.com/lowbyteproductions/bare-metal-series First Successful Firmware Update! :: Bare Metal Programming Series 11](https://i.ytimg.com/vi/fnulMkctAWk/mqdefault.jpg)
![Building A Fantasy Game Console Emulator: System Overview and Graphics Pipeline
In this video we explore the details of the fantasy game console, based on the 16 Bit Virtual Machine - and begin coding the graphics pipeline.
The fantasy console serves as a very simple model for an emulator of a classic game console like the NES or the GameBoy, only without all the tricky real world details and limitations that come with such systems. It allows us to contextualise all the topics weve been learning about while building the VM, and gain some understanding about how it must have been to be a programmer in the days of true resource constraint!
00:00 - Series Introduction
00:43 - System overview
10:06 - Building the graphics pipeline
=[ 🔗 Links 🔗 ]=
🎞 Series Playlist: https://www.youtube.com/playlist?list=PLP29wDx6QmW5DdwpdwHCRJsEubS5NrQ9b&playnext=1&index=1
💌 Updates to your inbox: https://tinyletter.com/lowleveljavascript
🗣 Discord: https://discord.gg/FPWaVgk
⭐️ Patreon: https://www.patreon.com/lowleveljavascript
💻 Github Repo: https://github.com/LowLevelJavaScript/16-Bit-Virtual-Machine/ Building A Fantasy Game Console Emulator: System Overview and Graphics Pipeline](https://i.ytimg.com/vi/g29vCtzZPuk/mqdefault.jpg)
![Simple Timer API :: Bare Metal Programming Series 9
In this installment of the bare metal programming series, were taking a minute to build a very simple timer API, allowing us to quickly setup, check, and reset software based timers - accounting for any drift that may occur between checks!
=[ 🔗 Links 🔗 ]=
🎥 Series Playlist: https://www.youtube.com/playlist?list=PLP29wDx6QmW7HaCrRydOnxcy8QmW0SNdQ
🗣 Discord: https://discord.gg/FPWaVgk
⭐️ Patreon: https://www.patreon.com/lowleveljavascript
💻 Github Repo: https://github.com/lowbyteproductions/bare-metal-series Simple Timer API :: Bare Metal Programming Series 9](https://i.ytimg.com/vi/g4TLA_R_Tk4/mqdefault.jpg)
![[stream] File System Hacking: FAT32 Deep Dive
=[ 🔗 Links 🔗 ]=
🎥 Stream Playlist: https://www.youtube.com/playlist?list=PLP29wDx6QmW7jg0LgRJYAmHLM6G_6NDw6
💌 Updates to your inbox: https://tinyletter.com/lowleveljavascript
🗣 Discord: https://discord.gg/FPWaVgk
⭐️ Patreon: https://www.patreon.com/lowleveljavascript
💻 Github Repo: [stream] File System Hacking: FAT32 Deep Dive](https://i.ytimg.com/vi/giVfqICb2J4/mqdefault.jpg)
![What is Memory Mapped I/O? (16-Bit VM in JavaScript 005)
This this episode we implement memory mapped I/O, where the address space is utilised as common bus for components to communicate.
=[ ℹ About ℹ ]=
This series is all about building a powerful virtual machine in JavaScript with the following features:
- A flexible, extensible, register-based virtual machine
- Support for signed, unsigned and floating point operations
- A call stack
- Interrupt capabilities
- Ability to do memory mapping for IO
- An assembly language with macro and module support
- A higher level, C like language. Well use and expand the library from the parser combinators from scratch series
- And finally, to be able to take the whole thing into the browser and exend it to create a sort of fantasy console - an emulator for a machine that never existed
=[ 🔗 Links 🔗 ]=
- ⭐️ Patreon: https://www.patreon.com/lowleveljavascript
- 💌 Updates to your inbox: https://tinyletter.com/lowleveljavascript
- Series Playlist: https://www.youtube.com/playlist?list=PLP29wDx6QmW5DdwpdwHCRJsEubS5NrQ9b&playnext=1&index=1
- Github Repo: https://github.com/LowLevelJavaScript/16-Bit-Virtual-Machine
- Memory Mapped IO: https://en.wikipedia.org/wiki/Memory-mapped_I/O
- Address Space: https://en.wikipedia.org/wiki/Address_space What is Memory Mapped I/O? (16-Bit VM in JavaScript 005)](https://i.ytimg.com/vi/hLYGTpvoMgE/mqdefault.jpg)
![Unpacking squished bits (Bit Packer part 2)
In this video, were writing the unpack half of the Bit Packer API, where we can recognise patterns in the bitstream, and return the value they actually represent!
=[ 🔗 Links 🔗 ]=
🎥 Series Playlist:
💌 Updates to your inbox: https://tinyletter.com/lowleveljavascript
🗣 Discord: https://discord.gg/FPWaVgk
⭐️ Patreon: https://www.patreon.com/lowleveljavascript
💻 Github Repo: https://github.com/LowLevelJavaScript/Bit-Packer Unpacking squished bits (Bit Packer part 2)](https://i.ytimg.com/vi/haaa3XEIsFo/mqdefault.jpg)
![Fixed-point math is better than floating point (sometimes)
In this video, were learning about fixed-point: A different method for doing non-integer arithmetic without floats!
Floating point is a ubiquitous standard that works everywhere, but it needs specialised hardware to have any chance of running fast. This can make calculations on low-powered microcontrollers extremely expensive. Fixed-point solves, giving us a method for cheaply computing fractional results with flexible precision!
00:00:00 Intro
00:03:46 Floating point vs fixed point
00:10:07 Fixed point bit representation
00:17:10 Code: Fixed point defines
00:21:30 Getting to the integer and fractional parts
00:24:24 Sign function and representing ints in fixed point
00:32:14 Converting to and from floating point
00:36:23 Addition and subtraction
00:38:27 Multiplication
00:42:20 Division
00:48:52 Rounding operations
00:50:14 Absolute value
00:54:50 Floor
00:58:57 Getting the fractional part
01:02:38 Ceiling
01:05:37 Round
01:14:14 Motivating example: Analog to digital converter readings
01:30:10 Next time: Sines and cosines
=[ 🔗 Links 🔗 ]=
⭐️ Become a patron and get bonus videos! https://www.patreon.com/lowleveljavascript
🗣 Discord: https://discord.gg/FPWaVgk
💻 Github Repo: https://github.com/lowbyteproductions/fixed-point-math Fixed-point math is better than floating point (sometimes)](https://i.ytimg.com/vi/i1phJl-0v54/mqdefault.jpg)