assmeblers and disassemblers

Steve Ravet steve.ravet at arm.com
Thu Sep 24 19:18:27 GMT 1998


Bruce Plecan wrote:
> >For example.
> >LDA $FF
> >The above means "load the A register with value $FF (which is 255 to you
> and me).  The assember converts this to:
> >08FF
> >The microprocessor likes the latter, people prefer the former.  Hope that
> answered your question without making it more confusing.
> >Frederic Breitwieser
> 
> 08 would be an address, right?
> How do you know A=address 08?.
> Bruce

the 08 part is the instruction itself.  The ff is the immediate data
specified by the instruction.  There's a lot of information packed into
that 08, more than just the register number. It contains at least the
instruction (load), the destination (register a), and probably other
information like the addressing mode, etc.  It's all nitty gritty
details, and it's totally different if you start looking at a different
microcontroller.  I don't even know what microcontroller that particular
instruction belongs to, but if you knew, you could look in the data book
for it, in the section called "instruction encoding", and you could
figure out by hand what instruction sequence is represented by a series
of bytes.  Or, you could write a program that has all those tables
entered into it and would decode the bytes for you.  That's what the
disassembler does.  Fred's just a nerd, that's why he knew that "lda
$ff" assembles to 08ff.

--steve

-- 
Steve Ravet
steve.ravet at arm.com
Advanced Risc Machines, Inc.
www.arm.com



More information about the Diy_efi mailing list