News for hackers. Stuff that matters.
Re:Show HN: Game of Life in 32 bytes of assembler by adhoc32 on Thursday April 30, 2020 @08:08PM (#23037756)
I did the same thing! The year was 1997. There was some kind of online coding competition back then if I recall correctly. Mine is larger (256 bytes) but it has a nice background image (a mandelbrot fractal). Here is the binary:

    M8CO4LATzRC7JABmZP83ZMcHvwFkjE8CaACgB7AI+jPJSfOqv0ABscaqUL3C/jPAM9tXvxAAZg+/
    8w+v2GaYZvfoZovQZg+v9mYrxmbB+AcrxS0AAcH7BivZg8NkZgPWZsHqEHUDT3XNi8cEEF+qRXW8
    WKris/u/6Hu+2HyL6rv///7EsQK62gPsqAh1++yoCHT74vGwCSaAPQ+qdoBP/sAmgDwPJogED4Zy
    /wP9A/P+zHXOZmSPBiQAsAPNEMPkYIrgPC11A71AATwRdQO9wP48HnUDvf//PCB1A70BADxQdQO7
    QAE8SHUDu8D+PEt1A7v//zxNdQO7AQCwIOYgzw==
Re:Show HN: Game of Life in 32 bytes of assembler by gregschlom on Thursday April 30, 2020 @08:17PM (#23037822)
Running on twt86.com:

http://twt86.co/?c=M8CO4LATzRC7JABmZP83ZMcHvwFkjE8CaACgB7AI%...

I see the mandelbrot background but then it exits

Re:Show HN: Game of Life in 32 bytes of assembler by adhoc32 on Thursday April 30, 2020 @08:25PM (#23037876)
Not sure why, just tested it in native dosbox and it works.

edit: try pressing any arrow key when the fractal is drawing.

    ~controls :

    Player 1        Player 2 (or arrows)

       W               8
     A + D           4 + 6
       X               2
Re:Show HN: Game of Life in 32 bytes of assembler by mycall on Thursday April 30, 2020 @10:35PM (#23038550)
This is so interesting, VM using a URL for the code.
Re:Show HN: Game of Life in 32 bytes of assembler by gregschlom on Friday May 01, 2020 @12:49AM (#23039235)
A bit of hair splitting, but technically it's an emulator, not a VM, since it's just simulating the CPU using javascript in your browser.
Re:Show HN: Game of Life in 32 bytes of assembler by mycall on Friday May 01, 2020 @01:12AM (#23039320)
It is a base64 encoded highly optimized x86 assembly in DOSBox emulator inside a Javascript VM Chrome browser inside my Windows 10 Sandbox Nested Hyper-V VM inside VMware Workstation inside my Windows 10 machine.
Re:Show HN: Game of Life in 32 bytes of assembler by SomeoneFromCA on Friday May 01, 2020 @08:28AM (#23041316)
Yeah, and then CPU which translates x86 code into uOPs.
Re:Show HN: Game of Life in 32 bytes of assembler by scubbo on Sunday May 03, 2020 @01:29AM (#23057057)
There's always a relevant xkcd: https://xkcd.com/676/
Re:Show HN: Game of Life in 32 bytes of assembler by anonexpat on Friday May 01, 2020 @01:32AM (#23039394)
It’s turtles all the way down.
Re:Show HN: Game of Life in 32 bytes of assembler by monocasa on Friday May 01, 2020 @01:50AM (#23039456)
Emulators are VMs too.
Re:Show HN: Game of Life in 32 bytes of assembler by eru on Friday May 01, 2020 @04:39AM (#23040207)
Well, depends a bit on what definitions you use.

For example there's VM in the sense of JVM. But there's also in VM in the sense of Xen (VM) vs Docker (not a VM).

And probably a few more slightly different usages.

Re:Show HN: Game of Life in 32 bytes of assembler by monocasa on Friday May 01, 2020 @09:44AM (#23041903)
Those are both VMs in the same sense. A VM creates an abstract, indirect implementation of a computing system. Sometimes that's with a lot of hardware offload as in Xen or picojava. Sometimes that's with a JIT as in HotSpot, orginal VMWare, or Transmeta. Sometimes that's just with an interpreter like the original JVM or Dosbox.

They're all virtual machines whether they're running code originally meant for execution on hardware or not.

Re:Show HN: Game of Life in 32 bytes of assembler by eru on Monday May 04, 2020 @03:51AM (#23065523)
That's a pretty wide definition. One that also encompasses any 'bare metal' OS, because they use microcode these days.
Re:Show HN: Game of Life in 32 bytes of assembler by mfabbri77 on Friday May 01, 2020 @02:05AM (#23039498)
10 years later, I wrote a fractal zoomer in asm, it was 399bytes, with a nice color palette.

https://www.pouet.net/prod.php?which=24447

Re:Show HN: Game of Life in 32 bytes of assembler by Frondo on Friday May 01, 2020 @12:23AM (#23039108)
I remember that! it was on rec.games.programmer, wasn't it?
Re:Show HN: Game of Life in 32 bytes of assembler by adhoc32 on Friday May 01, 2020 @01:07PM (#23044183)
It was usenet for sure, probably the rec.games.programmer.