Hacker News new | ask | show | jobs
by outworlder 2535 days ago
> As a senior Java / CPP developer

This makes me cringe. A "senior" engineer is defined by whatever role a company slots you in. This is compounded by adding programming languages to the mix.

> I really wish I had done more embedded and assembly at school. I can't understand it or appreciate it.

There is no hardware involved here, per-se. What is there is the 6502 instruction set, plus binary floating point calculations. But the fact it is on the 6502 is only interesting because of the constraints.

If you are interested, pick up some tutorials on x86 assembly (or ARM, or whatever you have emulators or real hardware available) and go to town. Actually creating full programs(with syscalls) is a bit involved, but a small ASM function inside C++ (since you mentioned C++) should be perfectly doable (example: https://github.com/diasurgical/devilution/blob/master/Source... – you'll notice the Diablo game was not an embedded system either)

1 comments

On Linux, a full asm program with syscalls isn't too bad.

Here's one example:

https://jameshfisher.com/2018/03/10/linux-assembly-hello-wor...

A 16-bit realmode DOS Hello World is also very simple, being less than 2 dozen bytes (8 bytes of actual machine instructions, and 15 bytes of message...) and something you can enter into DEBUG and run immediately if you have a 32-bit Windows system; on a 64-bit one, DOSBox or similar emulators will work well too:

    mov ah, 9
    mov dx, 108
    int 21
    ret
    db "Hello world!" 0D 0A "$"
And if you don't have a 32-bit Windows system, you could always just run Windows 95 on your browser

https://win95.ajf.me/win95.html

Why bother with Windows in that case? Just emulate DOS directly.
Not as cool though!
You can have fun writing simple programs too:

https://github.com/skx/math-compiler/