Class Examples
Topic
Examples
DSC Examples
Example 0
(
ex0.asm
) (20Feb)
Example 0
(
ex0.asm.docx
) (12Feb)
Dr. Gugel's command linker file
(
KG_RAM_Link1.cmd
)
Dr. Gugel's command linker file
(
KG_RAM_Link1.cmd.docx
)
Dr. Gugel's example 0
AND
command linker file, zipped
(
example0.zip
)
Dr. Gugel's example 1
(
ex1.asm
)
Dr. Gugel's example 1
(
ex1.asm.docx
)
32-bit mov examples
(
test_32.asm
)
32-bit mov examples
(
test_32.pdf
)
Timer example
(
timer_ex1.asm
) uses Timer1 to blink an LED [by Adam Mills]
Timer example
(
timer_ex1.pdf
) uses Timer1 to blink an LED [by Adam Mills]
Divide subroutines
(
divide.asm
) and examples [by Paul Launier]
Divide subroutines
(
divide.pdf
) and examples [by Paul Launier]
Output Compare (PWM) example
(
OC_ex_s12.asm
) for demo on board
Simple Examples
To demonstrate assembler and simulator
(
simple_ex.asm
)
Using * with tables
(
tabtrick.asm
)
Addressing Modes
Immediate addressing mode
(
immaddr.asm
)
Direct addressing mode
(
diraddr.asm
)
Extended addressing mode
(
extaddr.asm
)
Indexed addressing mode
(
indaddr.asm
)
Phone example of indexed addressing mode
(
phone.asm
)
Subroutine and stack interactions
(
sub_cntr.asm
)
Various
Assembler directives & simple code
(
example0.asm
)
Loop example
(
example1.asm
)
Character search in string
(
example2.asm
)
Stack Example
(
stack1.asm
)
Simulator example
(
sim_hc12.asm
)
Simulator example (with no COP)
(
sim_hc12_no_COP.asm
)
SCI system
Asynch. Serial
An SCI 9600Hz polling example using both Tx and Rx
(
sci_pol9600.asm
)
An SCI 1200Hz polling example using both Tx and Rx
(
sci_pol.asm
)
Address and Data
Bus Timing
Machine Cycle (6811)
(
mach_cyc.asm
)
Data Structures
TI F28335
Simple stack example
(
stack0.asm
)
TI F28335
Vector addition
(
vectadd.asm
)
68HC12 Vector addition
(
vectadd.asm
)
Parameter Passing
Parameters in internal registers
(
pram1a.asm
)
Parameters address (pointer) in the internal registers
(
pram1b.asm
)
Parameters in program memory space
(
pram2a.asm
)
Parameters pointers in program memory space
(
pram2b.asm
)
Parameters on stack
(
pram3a.asm
)
Parameters pointers on stack
(
pram3b.asm
)
Parameters in global memory
(
pram4.asm
)
Parameter Passing Notes (68HC11)
(
param_passing.PDF) [PDF]
Macro Examples
Macro examples
(
macro.asm
)
Bubble sorting
Ascending bubble sort
(
bsort.asm
)
Multiply/Divide
Examples of multiply and divide arithmetic
(
multdiv.asm
)
Polling
Polling
(
polling.asm
)
IRQ and
Debouncing
IRQ Example A (counts to 255, uses pseudo-vectors for UF's D-Bug4744; not for simulator)
(
irq_inta.asm
)
IRQ Example B (counts to 65535; uses pseudo-vectors for UF's D-Bug4744; not for simulator)
(
irq_intb.asm
)
IRQ Example C (like B but uses real interrupt vectors; for simulator)
(
irq_intc.asm
)
IRQ Example D (like C but uses both pseudo-vectors and vectors; for simlator)
(
irq_intd.asm
)
RTI and TOI
Use RTI for a single process
to toggle bits (
rtia.asm
)
Use RTI single process
to rotate bits (
rtib.asm
)
Like RTIa
, but with polling (
rtia_p.asm
)
Co-processing
example using RTI for two processes (
co_proc_rti.asm
)
TOF example
(
timeover.asm
)
TOF example for UF 68HC12 board (with D-Bug12)
(
timeover_debug.asm
)
Output compare
(OC) and PWM
Use OC2 to generate a PWM
(
oc2pwm.asm
)
Like oc2pwm above, but uses both interrupt vectors interrupt pseudo-vectors.
Work on simulator, but NOT on UF board. (
oc2pwm_sim_debug.asm
)
OC7 to generate two PWM's
and uses CFORC (
oc7pwm.asm
)
OC5 to generate a periodic signal
(
oc5siggn.asm
)
Generation of a skinny (1-Eclk) pulse
(
1E-clk_Pulse.asm
)
A/D system
A/D example of storing EEG samples
(
ad_eeg.asm
)
Input Capture (IC) system
Finding the width of a signal
(
ic3.asm
)
Detecting a digital code
(
ic5_det.asm
)
My equates
My equates and other templates
(
equates.asm
)
PA
Pulse Accumulator Detection Example 1
(
padetect.asm
)
Pulse Accumulator Duration Example
(
padur.asm
)
Pulse Accumulator BIG Duration Example
(
padurbig.asm
)
SPI
SPI Example (Master)
(
spi_master.asm
)
SPI Example (Slave)
(
spi_slave.asm
)
SPI Master Transmit & Receive a Table
(
spi_master_tab.asm
)
SPI Output Port Expansion from HW
(
spi_out.asm
)
Multitasking
Steps
in an RTI multi-tasking routine (
rti_step.asm
)
Single process
of an multi-tasking routine (
rti_1process.asm
)
Multi-tasking
with RTI (
rti_mult_proc.asm
)
Another Multi-tasking
with RTI (
rti_mult_proc2.asm
)
Multi-tasking
using RTI and TOF (
rti_mult_tof.asm
)
68HC11 examples
68HC11 Examples