- added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1416 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
;Interrupt example
|
||||
;
|
||||
CONSTANT waveform_port, 02 ;bit0 will be data
|
||||
CONSTANT counter_port, 04
|
||||
CONSTANT pattern_10101010, AA
|
||||
NAMEREG sA, interrupt_counter
|
||||
;
|
||||
start: LOAD interrupt_counter, 00 ;reset interrupt counter
|
||||
LOAD s2, pattern_10101010 ;initial output condition
|
||||
ENABLE INTERRUPT
|
||||
;
|
||||
drive_wave: OUTPUT s2, waveform_port
|
||||
LOAD s0, 07 ;delay size
|
||||
loop: SUB s0, 01 ;delay loop
|
||||
JUMP NZ, loop
|
||||
XOR s2, FF ;toggle waveform
|
||||
JUMP drive_wave
|
||||
;
|
||||
ADDRESS 2B0
|
||||
int_routine: ADD interrupt_counter, 01 ;increment counter
|
||||
OUTPUT interrupt_counter, counter_port
|
||||
RETURNI ENABLE
|
||||
;
|
||||
ADDRESS 3FF ;set interrupt vector
|
||||
JUMP int_routine
|
||||
Reference in New Issue
Block a user