ESSENTIALS: Subroutines & The Wheeler Jump - Computerphile

preview_player
Показать описание
A true essential, the subroutine saves time, effort and helps avoid bugs. Dr Bagley explains why he has two essentials!

Many thanks to Microsoft Research UK for their support with the 'Essentials' mini-series.

This video was filmed and edited by Sean Riley.

Рекомендации по теме
Комментарии
Автор

It makes me happy that Brady is really learning and understanding how this works

kennypu
Автор

An ESSENTIALS playlist would be really useful to catch up on fundamentals

vaer-k
Автор

The interesting thing is that the Wheeler Jump will actually still work on modern processors. It won't be very efficient. But the processor needs to be able to support self-modifying code. (It always amazes me when people condemn self-modifying code and turn around and extol the virtues of "just-in-time" compilers. How, exactly do they think "just-in-time" compilers work?

The processor guarantee is that after a jump instruction any code modifications made before the jump instruction will take effect. This may require discarding the instruction prefetch queue and is not generally recommended.

PvblivsAelivs
Автор

Dr Bagley's office is the best office ever.

stevencotton
Автор

Now, the reason why ARM chips use a link register, as described in the video, is because they have LDM and STM instructions, which allow you to load/save load multiple registers from/to a stack at once. When you have instructions like that, using a register makes a tonne of sense.

talideon
Автор

So store "subroutines" in a text file and copypaste them into the code as needed, got it!

Kr-nvfo
Автор

Just one thing on why subroutines are useful is also that bugs only exist once, not in every copy/paste of the same slice of code so you need only fix the subroutine, not all the versions of it.

IllusionzZBxD
Автор

Can you make a video on how the x86 MOV instruction is Turing-complete?

jsbarretto
Автор

"Self modifying code" is some pretty nice playground for a non study guy (in germany). Pretty fascinating ^^

veloctyTV
Автор

Can you imagine code without subroutines? Miles and miles of lines.

nab-rkob
Автор

Love the essentials series, keep it up!

indexoverflow
Автор

Long story short—use SMC. I do it all the time when writing in Z80 assembly. Not just for jumps, but for saving memory and speeding up execution in many parts of the code (e.g. storying and modifying variables).

Can’t do it on modern systems, though—the protected memory paradigm will not allow for SMC to execute.

AstAMoore
Автор

It's quite common for subroutibes to have multuple return points. Wheeler jumps would have had to modify the address at each point individually.
+1 for pushing return addresses to the stack

thomasreichert
Автор

Our second year class project was to build an assembler for a simulator designed by our lecturer. He did not have "save program pointer in register before jumping" and I invented the Wheeler Jump. I was really annoyed when he changed his simulator. I felt really hard done by.

jamieoglethorpe
Автор

... and then there was "inlining", getting rid of the whole thing again :)

JaapVersteegh
Автор

I see Dr Bagley is living the #donglelife with his late-model Macbook Pro

linguica
Автор

Ah yes, I remember COBOL's ALTER verb! It was a fireable offense to even think of using it!

russellthompson
Автор

can you do recursion with the wheeler jump?

xybersurfer
Автор

Could you please make a video to covering how you would make a complete but simple computer.

littleal
Автор

I have exam in medicinal chemistry tomorrow, and I'm watching this now 😐 great video though!

Lostpanda
visit shbcf.ru