help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs history, and "Is Emacs difficult to learn?"


From: Stefan Monnier
Subject: Re: Emacs history, and "Is Emacs difficult to learn?"
Date: Thu, 01 Aug 2013 12:44:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> b. If you are saying jumping into the middle of an instruction can be
> useful, well I confess this is beyond my ken.  For one I believe that in
> assembly alone with arithmetic on the location-counter that should be
> possible.  On the other hand I dont know how to do that without getting into
> undefined instruction issues.

You can do it in assembly, just like you an do it in C: by making
assumptions about how the compiler/assembler works.

But yes, jumping in the middle of an instruction can be useful, if the
"tail" of the byte-sequence encoding that instruction "happens" to be
a valid instruction.  E.g. back in the 68000, to skip a 4B instruction
you could either use a jump, or (more efficient) place that 4B
instruction in the "immediate constant" part of a CMP (compare)
instruction whose result you just don't use (i.e. this CMP instruction
was just used as a 6B no-op whose last 4B was free for you to choose as
you please).

Other things you can't do in assembly (without again making assumptions
about the way the assembler works, i.e. going down to machine code) is
to self-modify the code.  Or to use some of the instruction bytes as
data-constants (in case they happen to contain the same bit-pattern).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]