Notes on Addressing modes
August 31, 2011
An addressing mode is the method whereby the operand of an instruction specifies the data.
There are 7 generic addressing modes and many more addressing mode combinations.
Generic Addressing modes
A51 Bit manipulation
Sept. 6, 2013
The 8051 has a Boolean processor that allows direct manipulation of bits. Alternatively, you can
do the same operation with less efficiency using logic operations.
Set bit P0.2 to 1 but don't change any other bits
Revised: August 27, 2010
Assembly Program Format
Assembly language programs for the 8051 should be turned in using the following
Header describing what program does
;P0 to P3 are alre
Hour Exam 1
September 10, 2012
1. Fill in the blank with what is in the accumulator after each of the following sequences run.
mov a, #81h
mov sp, #8
mov R2, #0AAh
mov R1, #7Eh
mov a, #55h
orl a, R1
mov R1, #37h
xrl a, R2
Hour Exam 2
October 17, 2012
1. The AT89C51AC3 has an analog multiplexor. What is an analog multiplexor and how is it
used on the AT89C51AC3?
2. Given a floating point number x in the range 0 to 255.0. Show how to output this number to
Hour Exam 2 Review
October 12, 2012
This exam covers some hardware topics related to the AT89C51AC3, the C language as
it is implemented for the 8051, and some assembly language as it is used in conjunction
with C and the 8051.
Sample questions to
Hour Exam 3
November 19, 2012
1. What is the difference between an ARM instruction and a THUMB instruction?
2. What is the purpose of the phase locked loop on the ARM processor?
3. Write a prototype for a c-function to run on the ARM-7 proces
Review Questions for Exam 3
November 19, 2013
1. PWM has been called the "poor man's A/D converter". What are the advantages and
disadvantages of using PWM as an A/D converter?
2. The program below outputs a square wave to an output pin on the ARM7
Hour Exam 3 Review 1
1. The ARM Cortex M0 is running at 48 MHz. how long does it take the following loop to run?
TMR16B1PR = 1;
TMR16B1MR0 = 4096;
TMR16B1MCR |= 1;
/Set interrupt flag on match
TMR16B1TCR = 1;
while(TMR16B1TCR & 0x01)
Final Exam Review
December 4, 2013
Final Exam is Thursday, December 12, 2013 at 8:00am
The final exam will have problems similar to those on exams 1, 2, and 3 plus a few
problems related to the project.
Given below is a set of sample questions (som
A51 Sample Programs
Sept. 6, 2013
Note: These programs are meant to be run on the simulator and are used to illustrate
characteristics of the 8051 assembly code.
;Adds memory locations 40-41 to memory 42-43
; puts result in 43-44
/* Gets 5 inputs from the serial receive port at 9600 baud and stores
these in buffer. It then transmits these five inputs on the
serial out port at 1200 baud. The process repeats endlessly.
To run in the simulator open Serial Port 1 from t
Notes on Formatted Serial Data
The following program shows how to use the sprint function from the stdio.h library to format
floating point data and send it to the serial port at 4800 baud.
80C51 family architecture
80C51 ARCHITECTURE MEMORY ORGANIZATION
All 80C51 devices have separate address spaces for program and data memory, as shown in Figures 1 and 2. The logical separation of program and data memory