URL
https://opencores.org/ocsvn/tv80/tv80/trunk
[/] [tv80/] [trunk/] [tests/] [bintr_crt0.asm] - Diff between revs 84 and 89
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 84 |
Rev 89 |
;; Generic crt0.s for a Z80
|
;; Generic crt0.s for a Z80
|
.module bintr_crt0
|
.module bintr_crt0
|
.globl _main
|
.globl _main
|
.globl _isr
|
.globl _isr
|
|
.globl _nmi_isr
|
|
|
.area _HEADER (ABS)
|
.area _HEADER (ABS)
|
;; Reset vector
|
;; Reset vector
|
.org 0
|
.org 0
|
jp init
|
jp init
|
|
|
.org 0x08
|
.org 0x08
|
reti
|
reti
|
.org 0x10
|
.org 0x10
|
reti
|
reti
|
.org 0x18
|
.org 0x18
|
reti
|
reti
|
.org 0x20
|
.org 0x20
|
reti
|
reti
|
.org 0x28
|
.org 0x28
|
reti
|
reti
|
.org 0x30
|
.org 0x30
|
reti
|
reti
|
.org 0x38
|
.org 0x38
|
di
|
di
|
|
push af
|
call _isr
|
call _isr
|
|
pop af
|
ei
|
ei
|
reti
|
reti
|
|
|
|
.org 0x66
|
|
push af
|
|
call _nmi_isr
|
|
pop af
|
|
retn
|
|
|
.org 0x100
|
.org 0x100
|
init:
|
init:
|
;; Stack at the top of memory.
|
;; Stack at the top of memory.
|
ld sp,#0xffff
|
ld sp,#0xffff
|
|
|
;; enable interrupts
|
;; enable interrupts
|
im 1
|
im 1
|
ei
|
ei
|
|
|
;; Initialise global variables
|
;; Initialise global variables
|
call _main
|
call _main
|
jp _exit
|
jp _exit
|
|
|
;; Ordering of segments for the linker.
|
;; Ordering of segments for the linker.
|
.area _HOME
|
.area _HOME
|
.area _CODE
|
.area _CODE
|
.area _GSINIT
|
.area _GSINIT
|
.area _GSFINAL
|
.area _GSFINAL
|
|
|
.area _DATA
|
.area _DATA
|
.area _BSS
|
.area _BSS
|
.area _HEAP
|
.area _HEAP
|
|
|
.area _CODE
|
.area _CODE
|
__clock::
|
__clock::
|
ld a,#2
|
ld a,#2
|
rst 0x08
|
rst 0x08
|
ret
|
ret
|
|
|
_exit::
|
_exit::
|
;; Exit - special code to the emulator
|
;; Exit - special code to the emulator
|
ld a,#0
|
ld a,#0
|
rst 0x08
|
rst 0x08
|
1$:
|
1$:
|
halt
|
halt
|
jr 1$
|
jr 1$
|
|
|
.area _GSINIT
|
.area _GSINIT
|
gsinit::
|
gsinit::
|
|
|
.area _GSFINAL
|
.area _GSFINAL
|
ret
|
ret
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.