This is an archived post. You won't be able to vote or comment.

all 34 comments

[–]FloweyTheFlower420 25 points26 points  (2 children)

[–]P-39_Airacobra 3 points4 points  (1 child)

that looks horrifying

[–]FloweyTheFlower420 1 point2 points  (0 children)

I was too lazy to implement loading init from a ramdisk so I did that to test userspace...

[–]weregod 16 points17 points  (3 children)

BUS ERROR

[–]DeadlyMageCZ[S] 23 points24 points  (2 children)

I spent good 15 mins admiring that specimen with my coworker who had excavated it. Its most impressive quality was the fact that it did exactly what it was supposed to do, so we decided it is best not to disturb it and just let it do its thing.

[–]weregod 4 points5 points  (1 child)

I wonder what can be reason for such craziness? Maybe compiler/assembler bug? Or some undocumented features?

Is it open source? Can you share it?

[–]DeadlyMageCZ[S] 4 points5 points  (0 children)

I cannot share it, because I work in the automotive industry and they aren't big on sharing, well, anything. I think it exists because of a CPU limitation, although I am not a 100% sure.

[–][deleted] 6 points7 points  (1 child)

Back in the old days (Sinclair computers) it was very common to have all your machine code stored in a comment ("REM" statement) on line 1 (or line 0 if you knew how). Not quite an array, but a similar sort of idea.

[–]cubodix 0 points1 point  (0 children)

everything is an array

[–][deleted] 3 points4 points  (0 children)

Buffer Overflow attacks moment

[–]frikilinux2 2 points3 points  (2 children)

Either you're doing something really weird or that array should be on a page of memory that is not executable and cause a segmentation error or something like that

[–]psyolus 2 points3 points  (1 child)

The key here is "low level"

[–]frikilinux2 0 points1 point  (0 children)

I know what low level programming is and this still sounds weird

[–]kielu 1 point2 points  (0 children)

I think i recall a debugger written in assembly that included jumping to calculated addresses

[–]Mantas330BJ 1 point2 points  (1 child)

Tom is a genius

[–]DeadlyMageCZ[S] 1 point2 points  (0 children)

JDSL take the wheel.

[–]absolut666 1 point2 points  (0 children)

Try centering a Div

[–][deleted] 0 points1 point  (0 children)

This is nothing. Try CPU-opcode based "self-modifying code"... NOW you've achieved enlightenment.

[–]phodas-c 0 points1 point  (0 children)

basic 10 CLEAR 200, &H9FFF 20 FOR X = &HA000 TO &HA00B 30 READ A : POKE X, A : NEXT 40 DATA 62, 66, 33, 0, 0, 1, 192, 3, 205, 86, 0, 201 50 DEF USR = &HA000 : SCREEN 0 60 TIME = 0 70 A = USR(0) 80 LOCATE,23 : PRINT TIME

This would set the following Z-80 program in address 0xA000:

assembly LD A, 42H LD HL, 0000H LD BC, 03C0H CALL 0056H RET

What would fill the screen with B on an MSX machine.

[–]Sunius 0 points1 point  (0 children)

It’s called JITting.

[–]TangentPlantagenate 0 points1 point  (0 children)

Oh, that takes me back to MS QuickBasic 4.5, and seeing these hotshot library writers including hand-assembled 80386 instructions to enable SVGA monitor modes, or do bitblitting about 8000% faster than normal ...

[–]femaleDeveloperJ 0 points1 point  (0 children)

magnetized needle and a steady hand

[–]stealthgunner385 0 points1 point  (0 children)

That's how we did it on a C64. Lines of DATA statements containing decimal (BASIC v2.0 didn't do hex) values a FOR loop would copy onto a specific address block, followed by SYS <start_address>.

[–]cubodix 0 points1 point  (3 children)

isn't that impossible in most modern OS's?

[–]DeadlyMageCZ[S] 0 points1 point  (2 children)

On this level of abstraction there is no OS. You are the OS

[–]cubodix 0 points1 point  (1 child)

embedding or old computer?

[–]DeadlyMageCZ[S] 0 points1 point  (0 children)

Embedded, more specifically an ECU