-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05a2850
commit 493fa7a
Showing
13 changed files
with
1,267 additions
and
440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; | ||
; Common on z80pack is at 0xF000 as defined by hardware. | ||
; | ||
|
||
.common | ||
|
||
#include "../../cpu-z80u/std-commonmem.s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,59 @@ | ||
# 0 "commonmem.S" | ||
# 0 "<built-in>" | ||
# 0 "<command-line>" | ||
# 1 "commonmem.S" | ||
; | ||
; Common on z80pack is at 0xF000 as defined by hardware. | ||
; Common on z80pack is at 0xF000 as defined by hardware. | ||
; | ||
|
||
.module commonmem | ||
.common | ||
|
||
.area _COMMONMEM | ||
# 1 "../../cpu-z80u/std-commonmem.s" 1 | ||
; | ||
; | ||
; Standard Z80 common memory area blocks. | ||
; | ||
; Must remain a multiple of 256 bytes | ||
; | ||
; exported symbols | ||
.export _ub | ||
.export _udata | ||
.export kstack_top | ||
.export istack_top | ||
.export istack_switched_sp | ||
|
||
|
||
_ub: ; first 512 bytes: starts with struct u_block, with the kernel stack working down from above | ||
_udata: | ||
kstack_base: | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
kstack_top: | ||
|
||
.include "../../cpu-z80/std-commonmem.s" | ||
; next 256 bytes: 254 byte interrupt stack, then 2 byte saved stack pointer | ||
istack_base: | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
istack_top: | ||
istack_switched_sp: .word 0 | ||
# 8 "commonmem.S" 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
; startup code | ||
.code | ||
|
||
init: | ||
di | ||
ld sp, kstack_top | ||
|
||
; Configure memory map | ||
call init_early | ||
|
||
; move the common memory where it belongs | ||
ld hl, __bss | ||
ld de, __common | ||
ld bc, __common_size | ||
ldir | ||
ld de, __commondata | ||
ld bc, __commondata_size | ||
ldir | ||
; and the discard | ||
ld de, __discard | ||
ld bc, __discard_size | ||
ldir | ||
; then zero the data area | ||
ld hl, __bss | ||
ld de, __bss + 1 | ||
ld bc, __bss_size - 1 | ||
ld (hl), 0 | ||
ldir | ||
|
||
; Hardware setup | ||
call init_hardware | ||
|
||
; Call the C main routine | ||
call _fuzix_main | ||
|
||
; main shouldn't return, but if it does... | ||
di | ||
stop: halt | ||
jr stop | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,45 @@ | ||
; 2013-12-18 William R Sowerbutts | ||
|
||
.module crt0 | ||
|
||
; Ordering of segments for the linker. | ||
; WRS: Note we list all our segments here, even though | ||
; we don't use them all, because their ordering is set | ||
; when they are first seen. | ||
.area _CODE | ||
.area _CODE2 | ||
.area _CONST | ||
.area _INITIALIZED | ||
.area _DATA | ||
.area _BSEG | ||
.area _BSS | ||
.area _HEAP | ||
; note that areas below here may be overwritten by the heap at runtime, so | ||
; put initialisation stuff in here | ||
.area _INITIALIZER | ||
.area _GSINIT | ||
.area _GSFINAL | ||
.area _DISCARD | ||
.area _COMMONMEM | ||
.area _COMMONDATA | ||
|
||
; imported symbols | ||
.globl _fuzix_main | ||
.globl init_early | ||
.globl init_hardware | ||
.globl s__INITIALIZER | ||
.globl s__COMMONMEM | ||
.globl l__COMMONMEM | ||
.globl s__COMMONDATA | ||
.globl l__COMMONDATA | ||
.globl s__DISCARD | ||
.globl l__DISCARD | ||
.globl s__DATA | ||
.globl l__DATA | ||
.globl kstack_top | ||
|
||
# 0 "crt0.S" | ||
# 0 "<built-in>" | ||
# 0 "<command-line>" | ||
# 1 "/usr/include/stdc-predef.h" 1 3 4 | ||
# 0 "<command-line>" 2 | ||
# 1 "crt0.S" | ||
; startup code | ||
.area _CODE | ||
.code | ||
|
||
init: | ||
di | ||
ld sp, #kstack_top | ||
ld sp, kstack_top | ||
|
||
; Configure memory map | ||
call init_early | ||
|
||
; move the common memory where it belongs | ||
ld hl, #s__DATA | ||
ld de, #s__COMMONMEM | ||
ld bc, #l__COMMONMEM | ||
ldir | ||
ld de, #s__COMMONDATA | ||
ld bc, #l__COMMONDATA | ||
ldir | ||
; and the discard | ||
ld de, #s__DISCARD | ||
ld bc, #l__DISCARD | ||
ldir | ||
; then zero the data area | ||
ld hl, #s__DATA | ||
ld de, #s__DATA + 1 | ||
ld bc, #l__DATA - 1 | ||
ld (hl), #0 | ||
ldir | ||
; move the common memory where it belongs | ||
ld hl, __bss | ||
ld de, __common | ||
ld bc, __common_size | ||
ldir | ||
ld de, __commondata | ||
ld bc, __commondata_size | ||
ldir | ||
; and the discard | ||
ld de, __discard | ||
ld bc, __discard_size | ||
ldir | ||
; then zero the data area | ||
ld hl, __bss | ||
ld de, __bss + 1 | ||
ld bc, __bss_size - 1 | ||
ld (hl), 0 | ||
ldir | ||
|
||
; Hardware setup | ||
call init_hardware | ||
|
||
; Call the C main routine | ||
call _fuzix_main | ||
|
||
; main shouldn't return, but if it does... | ||
di | ||
stop: halt | ||
stop: halt | ||
jr stop | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.