9 ms·
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 ge
by barrkel 8y ago
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.
- messe 8y agoNot 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.
- gecko 8y agoI might be missing something, but you're still relying on the BIOS to have the graphical representation of those letters. Right?
- messe 8y agoAs 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.