|
RE: [gbadev] -mthumb-interwork answer
> Maybe is the choice between ARM or THUMB code is in fact the choice of
which memory system is used.
Basically ROM and EX_WRAM (external work RAM) are connected to the CPU by a
16-bit bus. This means that you can fetch a Thumb instruction in one
waitstate and an ARM one in two. And since Thumb instructions cover the
most common instructions, what you get is a large gain in speed. WRAM
(internal work RAM) , VRAM, palette RAM etc. are connected to the CPU by a
32-bit bus so you can place ARM instructions without a fetch penalty.
However, ARM instructions are much more powerful than Thumb instructions so
you can get a gain in speed if you use ARM instructions (plus you have
access to more registers).
Theses are the reasons why Nintendo suggest Thumb in external RAM/ROM, ARM
in internal RAM.
Best regards,
Matt D.
|