frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: Turbine – 16-bit CPU Architecture and Emulator built in C

https://www.errorcodezero.dev/blog/building-my-own-cpu-isa-and-virtual-machine/
33•errorcodezero•3d ago
Github: https://github.com/errorcodezero/turbine

Comments

lioeters•3h ago
Fun article and project. I enjoyed reading and playing around with it.

My first run of `make release` failed with this error.

    cc -std=c11 -Wall -Wextra -Werror -pedantic -O3 -DNDEBUG -c -o build/main.o src/main.c
    src/main.c: In function ‘main’:
    src/main.c:23:3: error: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
      23 |   fread(file, file_size, 1, fp);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

It might have something to do with my local setup. It was simple enough to solve, to check the return value and exit with error code.
johnisgood•3h ago
Yes, to fix it: either check its return value, or add "(void)" at the end of the function, e.g. "(void)fread(...)". Since they did not add "(void)", I assume they meant to check the return value, they just simply forgot.
errorcodezero•2h ago
Ah oops small mistake with the C file handling. Thank you for the kind words on my project and finding the issue I'll be sure to fix it when I get the time.
lioeters•1h ago
The article was really good, explaining the details of how the virtual machine works.

I starred the Git repo, good luck with the Hack Club!

drob518•3h ago
Fun project. You might want to build an emulator for a real 16-bit CPU like a 6502. That would allow you to run real, existing software on it. That way you don’t have to write your own code.
AlexeyBrin•2h ago
6502 is an 8-bit CPU. Writing an emulator for it would be cool though.
vardump•1h ago
It's interesting how arbitrarily CPU bitness is defined. Sometimes it's the register size, sometimes data bus width and sometimes the address width.

6502 has 8 bit registers, 8 bits wide data bus, and 16 bit addresses. Only PC register is 16-bit, but 6502 does have a zero page indirect 16-bit addressing mode.

wang_li•1h ago
Sometimes by register size, sometimes by ALU size, sometimes by data bus width. But I've never heard of a CPU bitness defined by address bus size.
pjc50•2h ago
M68k is probably the best choice for that. Not because of the architecture but because it was so widely used.
errorcodezero•2h ago
Thank you! I think building an emulator for a real platform is going to be next on my list. A game console might be interesting to try especially or a 16-bit cpu like you mentioned.

Backyard Coffee and Jazz in Kyoto

https://thedeletedscenes.substack.com/p/backyard-coffee-and-jazz-in-kyoto
128•wyclif•2h ago•73 comments

Making TRAMP go Brrrr

https://coredumped.dev/2025/06/18/making-tramp-go-brrrr./
66•celeritascelery•2h ago•30 comments

Launch HN: Reducto Studio (YC W24) – Build accurate document pipelines, fast

14•adit_a•1h ago•8 comments

Rocknix is an immutable Linux distribution for handheld gaming devices

https://rocknix.org/
57•PaulHoule•3d ago•15 comments

New Linux udisks flaw lets attackers get root on major Linux distros

https://www.bleepingcomputer.com/news/linux/new-linux-udisks-flaw-lets-attackers-get-root-on-major-linux-distros/
274•smig0•3d ago•180 comments

RaptorCast: Designing a Messaging Layer

https://www.category.xyz/blogs/raptorcast-designing-a-messaging-layer
22•wwolffrec•10h ago•5 comments

How to store Go pointers from assembly

https://mazzo.li/posts/go-asm-pointers.html
35•pdziepak•4h ago•4 comments

Cataphract: Medieval-fantasy roleplaying wargame, in the Black-Sea C. 1300

https://samsorensen.blot.im/cataphracts-design-diary-1
111•vidro3•3d ago•20 comments

WhatsApp banned on House staffers' devices

https://www.axios.com/2025/06/23/whatsapp-house-congress-staffers-messaging-app
44•fahd777•1h ago•38 comments

2B people don't have safe drinking water: what does this mean for them?

https://ourworldindata.org/what-no-safe-water-means
70•surprisetalk•2h ago•35 comments

Python can run Mojo now

https://koaning.io/posts/giving-mojo-a-spin/
260•cantdutchthis•2d ago•128 comments

Klein Bottle Amazon Brand Hijacking (2021)

https://www.kleinbottle.com/Amazon_Brand_Hijacking.html
365•sebg•21h ago•165 comments

Tell me about your favorite tree (a slow-web proposal)

https://nannnsss.omg.lol/2025/tell-me-about-your-favorite-tree/
65•surprisetalk•3d ago•43 comments

Using Home Assistant, adguard home and an $8 smart outlet to avoid brain rot

https://www.romanklasen.com/blog/beating-brainrot-by-button/
317•remuskaos•20h ago•163 comments

Homotopy Equivalences

https://bartoszmilewski.com/2025/06/20/weak-homotopy-equivalences/
44•ibobev•3d ago•7 comments

NASA's Voyager Found a 30k-50k Kelvin "Wall" at the Edge of Solar System

https://www.iflscience.com/nasas-voyager-spacecraft-found-a-30000-50000-kelvin-wall-at-the-edge-of-our-solar-system-79454
4•world2vec•23m ago•0 comments

Mechanical Watch: Exploded View

https://fellerts.no/projects/epoch.html
1100•fellerts•1d ago•122 comments

Show HN: Lego Island Playable in the Browser

https://isle.pizza
195•foxtacles•17h ago•51 comments

Nano-Vllm: lightweight vLLM implementation built from scratch

https://github.com/GeeeekExplorer/nano-vllm
71•simonpure•11h ago•13 comments

Backlash to artificial dye grows as Kraft ditches coloring for Kool-Aid, Jell-O

https://www.washingtonpost.com/business/2025/06/17/kraft-heinz-artificial-food-dyes-us-products/
47•bookofjoe•3h ago•89 comments

DHEA-S hormone linked to shorter lifespan in men, but not women

https://medicalxpress.com/news/2025-06-dhea-hormone-linked-shorter-lifespan.html
12•PaulHoule•1h ago•3 comments

Transparent Ambition: on translucent user interfaces

https://take.surf/2025/06/19/transparent-ambition
4•goranmoomin•1d ago•0 comments

Scroll snapping, state queries, monster hunter, and gamification

https://utilitybend.com/blog/the-customizable-select-part-four-scroll-snapping-state-queries-monster-hunter-and-gamification
19•tobr•3d ago•10 comments

Fairphone 6 is switching to a new design that's even more sustainable

https://www.androidcentral.com/phones/fairphone-6-official-render-leaks-showcase-its-sustainable-design
12•Bluestein•1h ago•5 comments

Rivulet: An esolang inspired by calligraphy && code [video]

https://media.ccc.de/v/gpn23-35-rivulet-an-esolang-inspired-by-calligraphy-and-other-experiments-in-natural-language-code
6•exiguus•3d ago•1 comments

Radio Garden

https://radio.garden/?2025
174•LeoPanthera•19h ago•36 comments

Finding a billion factorials in 60 ms with SIMD

https://codeforces.com/blog/entry/143279
152•todsacerdoti•17h ago•9 comments

The X Window System didn't immediately have X terminals

https://utcc.utoronto.ca/~cks/space/blog/unix/XTerminalsNotImmediate
86•zdw•12h ago•42 comments

Optifye.ai (YC W25) is hiring a back end engineer

1•Vivaan_Baid•15h ago

Polystate: Composable Finite State Machines

https://github.com/sdzx-1/polystate
92•goless•15h ago•32 comments