Assembly (Stage 5) -- Source file ready for simulation |
When you assembled the file e1v1.s using the command
as68000 -V 68020 -L -m -o e1v1.o e1v1.s
then in the file e1v1.lst you would have found two errors remaining. Both were associated with the directive ORG.
The SDS 68K software kit does not specify locations in memory using the standard Motorola ORG type descriptor. Instead the SDS tools break up the processor memory into a series of blocks (called sections) according to what happens in that location of memory.
The tools then place things that will not change during the program execution (code, number constants and string constants) into read only memory (ROM). These items are immediately available when the processor powers up.
The SDS tools also recognize that certain other items must change during the course of your program and must be stored in random access memory (RAM).
We can modify file "e1v1.s" to incorporate these memory specification assembler directives. The new file e1v2.s is now ready for the simulator. This file can be assembled with no errors
as68000 -V 68020 -L -m -o e1v2.o e1v2.s
giving the listing file "e1v2.lst". I have replaced the Motorola symbol for hexadecimal numbers ($) with the "C" symbol (0x) as discussed earlier.
; Code from HVZ Computer Organization ; Chapter 2 -- Figure 2.26 -- page 67 Changed file ; A 68000 routine for C <- [A] + [B] ; Version 1 -- M. R. Smith -- July 1, 1996 ******************************************************************** C EQU 0x202200 ; Specify location to store the result ; ORG 0x201150 ; Start of CONSTANTs section section const ; Start of const section (handled by linker) .EXPORT A ; (No HVZ notation equivalent) A DC.W 639 ; Specify and initialize a variable B DC.W -215 ; Specify and initialize a variable ******************************************************************** ; ORG 0x201200 ; Start of CODE section section code ; Start of CODE section (handled by linker) .EXPORT mycode ; (No HVZ notation equivalent) mycode ; (No HVZ notation equivalent) MOVE A, D0 ; D0 <- [A] ADD B, D0 ; D0 <- [D0] + [B} MOVE D0, C ; C <- [D0] END
All these directives allow information to be passed between the assembler, the linker and the simulator.
The use and importance of the .EXPORT and mycode directives will become apparent when we use the SDS 68K simulator to execute our code segment.
For more detailed information on the section assembler directive see the information in the "Full Companion".
![]() |
Last modified: July 22, 1996 12:07 PM by M. Smith.
Copyright -- M. R. Smith