

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to the 68000 microprocessor, focusing on how it views memory, the syntax of its assembly language, and data types. Topics include memory models, big-endian vs. Little-endian, memory maps, compile-link-load vs. Assemble-load, source code notations, and sizes of data. The document also covers the basics of assembly language programming, including instructions, syntax, and semantics.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


CDAC 3331 Intro to Microprocessor Systems – Lecture 3 Dr. Michael VanHilst Today we will learn about how the 68000 views memory, and about the syntax of the assembly language for the 68000. This material is all covered in Chapter 2 of the textbook. Here is an outline of the material for today. Data Types Memory model Big-endian vs. Little-endian Memory maps Compile-Link-Load vs. Assemble-Load Source code notations and format Types of Instructions Sizes of data: The 68000 can operate on data in sizes of 32 bits, 16 bits, 8 bits and 1 bit. A 32 bit value is called a long or long-word. 32 bits can represent 2^32 different values, or roughly 4 billion. In the assembly language, long-word operations have a .L suffix. A 16 bit value is called a word. 16 bits can represent 2^16 different values, or 64K. The actual limits for unsigned 16 bit values are 0 to 65,535. For signed values, the limits are -32,768 to 32,767. In the assembly language, word operations have a .W suffix. An 8 bit value is called a byte. 8 bits can represent 2^8 different values or 256. The range of values goes from 0 to 255. In the A 1 bit value is simply called a bit. Within a byte, word, or long-word, each bit has an index. On the 68000, the bit in the one’s place, or the low order bit, is bit
The table above shows different binary numbers together with their short hand and actual decimal equivalents. The column on the left shows a pattern that provides an easy way to remember the powers of 2. Note that 2 to multiples of 10 correspond to the powers of 10 that we normally use for counting (1K, 1M, 1G). The in-between values of 2 raised to a multiple of 5 are always 32 times the previous 2 raised to a multiple of 10. Thus the
pattern is 1-32-1-32-1-32-1 … Can you guess what 2^35 is? Memorize this pattern!!! The column on the left shows values of significance on the 68000. Data comes in 8, 16, or 32 bits. Addresses are 24 bits. Addressing in the 68000 Data is stored in memory. Each location in memory that can hold data has an address. Think of it as being like the addresses of houses on a street, or perhaps of rooms along a hallway. Addresses are numbered consecutively from 0. Data in memory is referenced by giving its address on the address lines of the bus. The data that is stored at that address is then accessed by the data lines of the bus. The 68000 uses byte addressing. That means that each address is the address of a byte, and adding 1 to that address gives the address of the next byte. The 68000 uses 24 bit addresses. That means it can address up to 2^24 different bytes in memory, or 16M bytes. Addresses are normally written in Hex or base 16. In C and C++, Hex values are preceded by 0x as in 0x000008. In 68000 assembly, Hex values are preceded by a dollar sign, as in $000008. Note that each hex digit takes 4 bits, so a 24 bit address uses 6 hex digits. On the 68000, the address of a word is the address of the high order byte. See figure 2. on page 26 in the book. If $000008 is the address of a word, $000009 is the address of its low order byte and $00000A is the address of the next word. If $000008 is the address of a long, $000008 is the address of its high order byte, $00000B is the address of its low order byte, and $00000C is the address of the next long. This kind of addressing, where the address of the value is the same as the address of its high order byte, is called big- endian. This may seem confusing. But it is actually less confusing than the other choice, little-endian. Little-endian is used by the Intel x86 processors. The Memory Map: Not every address in memory needs to have actual memory with real data. Large ranges of the available memory addresses can be un-allocated. Each memory chip is hardwired to a region of the address space. That means it has a given starting address, and uses offsets from that address to access the data that it holds. If the starting address of a 64K byte memory chip is $400000, then $400000 is the address of its first byte and $400000 + 64K (or 2^16) is the address beyond its end. $64K is 2 * 32K. Remember from the above pattern that 2^15 is 32K. So 64K is 2^16. Now to convert to Hex, look at the actual binary pattern. 2^16 is 1 followed by 16 zeroes. Since each 4 bits is a hex digit, the 16 zeroes will be 4 Hex zeroes. The Hex value for 2^16, or %10000000000000000, is $10000. $400000 + $10000 = $410000. Since $410000 is just beyond the end of the chip, its last address is 1 less, or $40FFFF. Please study this method of computing addresses carefully. We will be using it throughout the class. We will practice it more. The first quiz will have several questions like this. Figure 2.7 on page 27 in the book shows how different ranges of addresses were used on the first Macintosh. This is called a memory map. Here is a Polish web site that reprints the sidebar from the 1984 Byte magazine article that explains the