In: Computer Science
LDAA $3000
LDAB $20A0
MUL
STD $4002
What is the machine code for the instructions above
The operations of the processor is determined by the instructions it exicutes,referred to as machine instructions or computer instructions.The collection of different instructions that the processor can execute is referred to as the processors instruction set.these elements are as follows:
1.operation code.
2.source operand reference.
3.result operand reference.
4.next instruction reference.
The collection of machine instructions in main memory is called a machine language program.Machine code or machine language is a set of instructions executed directily by a computers central processing unit(cpu).
source and result operand can be in one of the three areas:
1.main or virtual memory: As with next instruction references ,the main or virtual memory address must be supplied.
2. processor register: With rare exceptions,a processor contains one or more registers that may be referenced by machine instructions.
3.i/o devices: The instructions must specify the i/o module and device for the operation.in memory mapped i/o is used ,this is just another main or virtual memory address.
LDAA :Add the content memory location.
LDAB : Add the content memory location.
STD : set flag.
This instruction is processor control instructions.
STD $4002 :set directional flag to 4002.
MUL : multiply byte or word(un signed).this method is arithmetic instructions.
For examples are,
mov a,28 ; load A.
mov b,45; load B
mul b ; multiply B
LDAA:
* Extended mode:
-The 16 bit address of the location of to operated on is given in the instruction.
LDAA $3000 ;A <- [$ 3000] LOAD A with the content of location $3000.
LDAB:
ldab<opr> load B B<-[OPR].