[Tutor] assembly language and boot loader

Steven D'Aprano steve at pearwood.info
Fri Sep 28 14:24:55 CEST 2012


On 28/09/12 21:59, Oscar Benjamin wrote:
> On 23 September 2012 05:46, Fit Wii<wii_fit at ymail.com>  wrote:
>
>> Is there any IDE or Python interpreter that can show the assembly language
>> generated by each line of python code?  Is there any popular boot loader
>> written in Python (plus some assembly code)?

That's two unjustified assumptions in two questions.

Boot loaders need to be small and fast, which is why they are written in
Forth or C. There aren't ANY boot loaders written in Python, let alone
popular ones. It's quite silly to be even thinking about writing a boot
loader in Python -- common hardware may require the boot loader to fit
in just 64K of memory. Regular Python requires megabytes of memory just
to start itself.

I suppose it is just barely possible that TinyPy or Pycorn could be used,
but I doubt it anyone has.


> Python doesn't generate assembly language code.

Pardon me, but I'm pretty sure that PyPy's JIT compiler will. Well, reasonably
sure. Slightly confident. I'm guessing. :)

However, I expect it only exists at runtime and you won't be able to get to it.
Besides, it will be heavily optimized and ugly as sin.



-- 
Steven


More information about the Tutor mailing list