8086 Programming Environment and Basic Arithmetic
Set up DOSBox, MASM, LINK and DEBUG, then add two 16-bit numbers held in registers.
- 1.1 Set up the environment (Hello program)
- 1.2 Add two 16-bit numbers in registers
Basic Arithmetic and Logical Operations (8086)
16-bit subtraction, addition of memory operands, and AND / OR / XOR on data in memory.
- 2.1 Subtract two 16-bit numbers
- 2.2 Add two 16-bit numbers stored in memory
- 2.3 AND, OR and XOR on data in memory
Multiplication and Division (8086)
8×8 and 16×16 unsigned multiplication and 16÷8 division with operands in memory.
- 3.1 Multiply two 8-bit numbers (memory)
- 3.2 Multiply two 16-bit numbers (memory)
- 3.3 Divide a 16-bit number by an 8-bit number
Data Handling and Array Operations (8086)
Block transfer of N bytes/words, the smallest and largest values in an array, and counting the 0s and 1s in a byte.
- 4.1a Block transfer of N bytes (REP MOVSB)
- 4.1b Block transfer of N words (loop)
- 4.2 Smallest and largest number in an array
- 4.3 Count the 0s and 1s in a byte
8051 Microcontroller Exp 5–12
Introduction to the 8051 Programming Environment
Keil µVision project set-up, building a HEX file, and programming a Nuvoton W78E052D with the ISP utility.
- 5.1 A LED blink (assembly)
- 5.1 B LED blink (Embedded C)
8051 Assembly Language Programming
8-bit addition in internal RAM, subtraction in external RAM, block transfer, and bit manipulation.
- 6.1 Add two 8-bit numbers in internal RAM
- 6.2 Subtract two 8-bit numbers in external RAM
- 6.3 Block transfer of N bytes in internal RAM
- 6.4 Bit-manipulation operations
LED and Switch Interfacing Using Embedded C
Flash LEDs, alternate them, N-bit and ring counters, and mirror 8 keys onto LEDs on Port 3.
- 7.1 Flash LEDs with a time delay
- 7.2 Flash LEDs alternately
- 7.3 N-bit counter and ring counter
- 7.4 Read 8 keys and show them on Port 3 LEDs
Relay, Buzzer, Switch and LED Interfacing Using Embedded C
Drive a relay and a buzzer through transistors, and select actions with two switches.
- 8.1 Relay ON/OFF with a time delay
- 8.2 Buzzer ON/OFF with a time delay
- 8.3 Switch-selected actions (8.4–8.7)
Seven-Segment Display Interfacing Using Embedded C
Four common-anode displays in multiplexed mode: hex digits 0–F and the number 1234.
- 9.1 Interface test: light every segment
- 9.2 Display hex digits 0 to F
- 9.3 Display 1234 (multiplexed)
LCD Interfacing Using Embedded C
Initialise an HD44780 16×2 LCD in 8-bit mode and display messages.
- 10.1 A Display two messages
- 10.1 B Scrolling message
- 10.1 C Live counter (number → ASCII)
Stepper Motor Interfacing
Clockwise and anticlockwise rotation, direction by switch, and rotation by N steps.
- 11.1 A Clockwise then anticlockwise
- 11.1 B Direction selected by a switch
- 11.2 Rotate by N steps
DAC Interfacing and Waveform Generation
Generate square, ramp and triangular waveforms (plus a sine table) with a DAC0808.
- 12.1 A Square wave
- 12.1 B Ramp (sawtooth) wave
- 12.1 C Triangular wave
- 12.1 D (Extension) Sine wave from a table
How to use this lab
- Open an experiment and read the Aim and Theory.
- Take the Pre-Lab Test.
- In the Simulator choose a sub-task, build, run and step. Then edit the code and explore the edge cases.
- Record your results in Data & Analysis and write your conclusion.
- Finish with the Post-Lab Test and the self-evaluation.
The simulators model the 8086 instruction subset used in these experiments and a W78E052D/8051 with its peripherals. Timing for Embedded C uses an estimated cycle model; calibrate against Keil's stopwatch on real hardware.