Produce an execution history for the code below ORG 0080 Sum
Produce an execution history for the code below:
ORG $0080
Sum: DS.B 1
ORG $FC00
Start: lda Ax
sub #$AB
sta Sum
Done: bra Done
Ax: DC.B $12
ORG $FFFE
DC.W Start
Solution
This is the code for assembly language programming.
ORG The ORG pseudo-op, for ORiGin, specifies the location for the assembler to deposit the machine code (or object code). In assembly language programming, all code should be preceded by the following ORG command.An assembler program typically has its own set of commands, called pseudooperations or pseudo-ops, used to direct the assembly process. These pseudo-ops seem like real instructions, but they are interpreted as control information to the assembler rather than assembled into machine code.
DS.B defines storage bytes.
dc.w defines a constant word.
lda Ax loads the contents of Ax register into the accumulator.
STA copies the data byte from the accumulator in the memory location specified .
bra is a jump instruction.
dc.b $12 initializes a three byte constant with the data.
ORG $0080 =0080
DS.B 1 =0080+0001
ORG $FC00
LDA AX load the contents defined by ax into accumulator
SUB #$AB
sta SUM copies the contents of accumulator to location defined by sum i,e 0081
bra Done jump to done
DC.B $12 initializes three byte constant
ORG $FFFE system reset
DC.W Start it declares a constant word start
In the above program sum,start,done,ax are symbols and a seperate symbol table needs to be prepared with their specific memory locations,


