avrora.core
Class Assembler

java.lang.Object
  extended byavrora.core.Assembler

public class Assembler
extends java.lang.Object

The Assembler class represents an assembler that is capable of encoding AVR assembly instructions into binary machine code.


Constructor Summary
Assembler()
           
 
Method Summary
 int encode(Instr i, byte[] buffer, int offset)
          The encode() method translates an assembly instruction into a sequence of bytes and writes them into an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assembler

public Assembler()
Method Detail

encode

public int encode(Instr i,
                  byte[] buffer,
                  int offset)
The encode() method translates an assembly instruction into a sequence of bytes and writes them into an array. This method returns the number of bytes written into the array, which depends on the size of the instruction.

Parameters:
i - the instruction to encode into the array
buffer - an array of bytes into which to encode the instruction
offset - the offset in the buffer to which to write the bytes
Returns:
the number of bytes written into the array, which is equal to the size of the instruction