Changeset 3558


Ignore:
Timestamp:
Apr 24, 2015, 2:53:41 PM (4 years ago)
Author:
boender
Message:
  • Added paragraph to branch displacement section
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Papers/jar-assembler-2015/boender-jar-2015.tex

    r3557 r3558  
    277277The three different types of branch instructions are:
    278278\begin{itemize}
    279   \item The {\em short} branch: a 2-byte instruction that can branch over a 1-byte displacement, i.e. XXX bytes forwards or YYY bytes backwards.
     279  \item The {\em short} branch: a 2-byte instruction that can branch over a 1-byte displacement, i.e. 127 bytes forwards or 128 bytes backwards.
    280280  \item The {\em absolute} branch: a 2-byte instruction that can change the last 11 bits of the program counter. Thus, it can branch to any destination within the same 2048-byte segment.
    281281  \item The {\em long} branch: a 3-byte instruction that can branch to any destination in memory.
     
    300300iteration, as all the intermediate solutions are safe, if not necessarily
    301301optimal. This is not the case for a least fixed point algorithm, but this
    302 algorithm, if it terminates, will result in a smaller solution.
     302algorithm, if it terminates, will result in a smaller (or at least equal-sized)
     303solution.
    303304
    304305In the particular case of the MCS-51 instruction set, matters are complicated
    305 by the existence of the absolute branch. Now, the encoding of a branch does not
    306 solely depend on its span, but also on their location within the program. This
    307 means that instead of being determined solely by the size of instructions
    308 within its span, the encoding of a branch is determined also by all of the
    309 branches that precede it.
     306by the existence of the absolute branch. With this instruction, the encoding of
     307a branch does not solely depend on its span, but also on their location within
     308the program. This means that instead of being determined solely by the size of
     309instructions within its span, the encoding of a branch is determined also by
     310all of the branches that precede it, since lengthening or shortening a
     311preceding instruction could propel a jump and its destination into the same
     312segment (or out of it).   
     313
     314This also means that the standard termination argument for the least fixed
     315point algorithm no longer holds. With only short and long jumps, once a short
     316jump is replaced by a long jump, it will never be replaced by a short jump
     317again (since the span of jumps only increases), so the number of jumps is
     318an upper bound. However, with the absolute jump, it is entirely possible for
     319a long jump to be replaced by an absolute jump, so this argument no longer
     320holds.
    310321
    311322%-%-%-%-%-%-%-%-%-%-%-%-%-%-%-%-%-%-%-%-%-%
Note: See TracChangeset for help on using the changeset viewer.