Page | 10
JSR SORT STOP #$2700 SORT MOVE.B D
MOVE.B D LOOP MOVE.B $0(A2,D6.W),D2
MOVE.B $0(A2,D7.W),D3
CMP.B DD
BGT EXCHANGE
ADD.B D
CMP.B D
BLT LOOP JMP CHECK EXCHANGE MOVE.B D2,$0(A2,D7.W)
MOVE.B D3,(A2,D6.W)
ADD.B D
CMP.B D
BLS LOOP CHECK ADD.B D
MOVE.B DD
CMP.B D
BLT LOOP
RTS
END $1500 Note, although assembly code are very close to what machine code is, they are still different. An assembler converts assembly code into true machine code as we have seen earlier (the realm of binary. In the above program, the addresses
are physical addresses, which correspond to individual bytes on your memory banks. If you have hard coded these addresses, you better only run one program on your processor at each time How tedious it is to program in assembly language It may take 30 lines of code to just put a character on your console, provided that you are not making system calls.
As an anecdote, while WordPerfect and Word look very similar, one is written in assembly and the other in Cb
WEEK TWO Learning Outcome for this week:
An insight into the
concept of Operating SystemThe meaning and work of The meaning of a pass Assembler
Teacher’s Activities Go through the program example and give a line byline explanation of the working of a pass assembler and a 2-
ASSEMBLER
We have seen that atypically modern instruction mnemonics into opcodes and other entities. The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution sequences
of instructions to run inlineShare with your friends: