News for hackers. Stuff that matters.
Re:X86 assembly doesn’t have to be scary by barrkel on Tuesday June 19, 2018 @01:09AM (#17343995)
Hello world in real mode is leveraging a bunch of code and data from the BIOS, so it's not quite as small as you're suggesting, but yes, bloat is the cost in general purpose abstractions.

Smart linking is related to GC. Not all the conditional and indirect edges in the control flow graph can be skipped by the linker's graph traversal, so you usually end up with lots and lots of unused code. And then there's all the sledgehammers being used on peanuts, just because they're there, like xpath to retrieve config values.

Re:X86 assembly doesn’t have to be scary by messe on Tuesday June 19, 2018 @08:32AM (#17345958)
Not important, I just thought it'd be fun to write but:

> Hello world in real mode is leveraging a bunch of code and data from the BIOS

Not necessarily, you can avoid the BIOS calls by just copying the string directly to video memory:

            mov ax, 0xB800
            mov es, ax
            xor di, di
            mov ah, 0x07
            mov si, hello
    ;; Load character, if zero, jump to end otherwise store
    ;; character and color in video memory
    @@:     lodsb
            test al, al
            jz @f
            stosw
            jmp @b
    ;; Halt and wait for interrupt
    @@:     hlt
            jmp @b

    hello:  db 'Hello, World!', 00h
That's a total of 37 byes including the string.
Re:X86 assembly doesn’t have to be scary by gecko on Tuesday June 19, 2018 @10:11AM (#17346765)
I might be missing something, but you're still relying on the BIOS to have the graphical representation of those letters. Right?
Re:X86 assembly doesn’t have to be scary by messe on Tuesday June 19, 2018 @10:34AM (#17347032)
As far as I remember, the default VGA font is stored on the graphics card ROM and copied into the video memory by that same onboard ROM, not the motherboard BIOS, so no I don't believe so. I may be mistaken.