URL
https://opencores.org/ocsvn/tv80/tv80/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 2 |
Rev 46 |
.module basic_int
|
.module basic_int
|
|
|
test_ctl_port = 0x80
|
test_ctl_port = 0x80
|
print_port = 0x81
|
print_port = 0x81
|
int_timeout_port = 0x90
|
int_timeout_port = 0x90
|
|
|
.area BOOT_VEC
|
.area BOOT_VEC
|
|
|
jp main
|
jp main
|
|
|
.area INT_VEC
|
.area INT_VEC
|
|
|
int_entry:
|
int_entry:
|
exx
|
exx
|
|
|
ld b, a
|
ld b, a
|
ld hl, #int_seen_str
|
ld hl, #int_seen_str
|
|
|
print_str:
|
print_str:
|
ld a, (hl)
|
ld a, (hl)
|
cp #0
|
cp #0
|
jp z, print_str_exit
|
jp z, print_str_exit
|
out (print_port), a
|
out (print_port), a
|
inc hl
|
inc hl
|
jp print_str
|
jp print_str
|
|
|
print_str_exit:
|
print_str_exit:
|
ld a, b
|
ld a, b
|
exx
|
exx
|
|
|
ld h, #1
|
ld h, #1
|
reti
|
reti
|
|
|
.area _CODE
|
.area _CODE
|
|
|
main:
|
main:
|
ld h, #0
|
ld h, #0
|
ld bc, #100
|
ld bc, #100
|
ld a, #50
|
ld a, #50
|
out (int_timeout_port), a
|
out (int_timeout_port), a
|
|
|
test_timeout_loop:
|
test_timeout_loop:
|
ld a, #1
|
ld a, #1
|
cp h
|
cp h
|
jp z, test_pass
|
jp z, test_pass
|
|
|
dec bc
|
dec bc
|
jp nz, test_timeout_loop
|
jp nz, test_timeout_loop
|
|
|
test_fail:
|
test_fail:
|
ld a, #2
|
ld a, #2
|
out (test_ctl_port), a
|
out (test_ctl_port), a
|
.db 0x76 ; hlt
|
.db 0x76 ; hlt
|
|
|
test_pass:
|
test_pass:
|
ld a, #1
|
ld a, #1
|
out (test_ctl_port), a
|
out (test_ctl_port), a
|
.db 0x76 ; hlt
|
.db 0x76 ; hlt
|
|
|
.area _DATA
|
.area _DATA
|
|
|
int_seen_str:
|
int_seen_str:
|
.ascii "Interrupt asserted"
|
.ascii "Interrupt asserted"
|
.db 0x0a
|
.db 0x0a
|
.db 0x00
|
.db 0x00
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.