Store a BCD number with the CHIP-8 FX33 instruction
FX33 splits V[X] into hundreds, tens and ones and stores them at I, I+1 and I+2. It leaves I unchanged, which is easy to get wrong in an emulator.
Short posts that solve one thing: the code, the output we got, and why it works.
FX33 splits V[X] into hundreds, tens and ones and stores them at I, I+1 and I+2. It leaves I unchanged, which is easy to get wrong in an emulator.
Split a 16-bit CHIP-8 opcode into X, Y, N, NN and NNN with shifts and masks, after fetching it big-endian from two memory bytes.
ioctl(kvm, KVM_CREATE_VM, 0) returns a new file descriptor for an empty VM. Pass 0 as the machine type on x86, which has no other values.
Open /dev/kvm and call ioctl(fd, KVM_GET_API_VERSION, 0). It returns 12, and the docs tell programs to refuse any other value.
Use -gdb tcp::1235 to move QEMU 10.0's gdbstub off port 1234, and bind it to 127.0.0.1 so the unauthenticated debug port stays local.
Pass console=ttyS0 in -append so a Linux 6.12 guest prints boot messages to QEMU's serial port, which -nographic wires to your terminal.
Tell Firecracker 1.10 which kernel to boot, and with what command line, by sending PUT /boot-source over its Unix socket before the microVM starts.
Link three split-virtqueue descriptors into one virtio-blk read request with VRING_DESC_F_NEXT, marking only the data and status buffers device-writable.
Call unshare(CLONE_NEWUSER) as a normal user on Linux 6.12 to get a namespace where you hold every capability, and see why geteuid shows 65534.
Write the simplest bytecode interpreter in C, a for loop around a switch on the opcode, and see where its single indirect branch limits you.
We send one email when a new post is published. No spam.