Go to the first, previous, next, last section, table of contents.


Broken words

Some compilers, including GCC, will sometimes emit switch tables specifying 16-bit .word displacements to branch targets, and branch instructions that load entries from that table to compute the target address. If this is done on a 32-bit machine, there is a chance (at least with really large functions) that the displacement will not fit in 16 bits. The assembler handles this using a concept called broken words. This idea is well named, since there is an implied promise that the 16-bit field will in fact hold the specified displacement.

If broken word processing is enabled, and a situation like this is encountered, the assembler will insert a jump instruction into the instruction stream, close enough to be reached with the 16-bit displacement. This jump instruction will transfer to the real desired target address. Thus, as long as the .word value really is used as a displacement to compute an address to jump to, the net effect will be correct (minus a very small efficiency cost). If .word directives with label differences for values are used for other purposes, however, things may not work properly. For targets which use broken words, the `-K' option will warn when a broken word is discovered.

The broken word code is turned off by the WORKING_DOT_WORD macro. It isn't needed if .word emits a value large enough to contain an address (or, more correctly, any possible difference between two addresses).


Go to the first, previous, next, last section, table of contents.