-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
1,860 additions
and
736 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
; | ||
; Standard common. Nothing special here except to remember that writes | ||
; to common space won't write through all banks | ||
; | ||
.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,10 +1,65 @@ | ||
# 0 "commonmem.S" | ||
# 0 "<built-in>" | ||
# 0 "<command-line>" | ||
# 1 "commonmem.S" | ||
; | ||
; Standard common. Nothing special here except to remember that writes | ||
; to common space won't write through all banks | ||
; Standard common. Nothing special here except to remember that writes | ||
; to common space won't write through all banks | ||
; | ||
.module commonmem | ||
.common | ||
|
||
# 1 "../../cpu-z80u/std-commonmem.s" 1 | ||
# 0 "../../cpu-z80u/std-commonmem.S" | ||
# 0 "<built-in>" | ||
# 0 "<command-line>" | ||
# 1 "/usr/include/stdc-predef.h" 1 3 4 | ||
# 0 "<command-line>" 2 | ||
# 1 "../../cpu-z80u/std-commonmem.S" | ||
; | ||
; | ||
; 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 | ||
|
||
.area _COMMONMEM | ||
|
||
.include "../../cpu-z80/std-commonmem.s" | ||
_ub: ; first 512 bytes: starts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 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
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,38 @@ | ||
; 2015-02-20 Sergey Kiselev | ||
; 2013-12-18 William R Sowerbutts | ||
|
||
#include "kernelu.def" | ||
|
||
; startup code (0x100) | ||
.code | ||
init: | ||
di | ||
; switch to stack in high memory | ||
ld sp, kstack_top | ||
|
||
; move the common memory where it belongs | ||
ld hl, __bss | ||
ld de, __common | ||
ld bc, __common_size | ||
ldir | ||
; and the discard | ||
ld de, __discard | ||
ld bc, __discard_size | ||
ldir | ||
|
||
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 | ||
|
||
; fuzix_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,80 +1,65 @@ | ||
# 0 "crt0.S" | ||
# 0 "<built-in>" | ||
# 0 "<command-line>" | ||
# 1 "crt0.S" | ||
; 2015-02-20 Sergey Kiselev | ||
; 2013-12-18 William R Sowerbutts | ||
|
||
.module crt0 | ||
# 1 "kernelu.def" 1 | ||
; FUZIX mnemonics for memory addresses etc | ||
|
||
; 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 _HOME ; compiler stores __mullong etc in here if you use them | ||
.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 _BUFFERS ; _BUFFERS grows to consume all before it (up to KERNTOP) | ||
.area _INITIALIZER ; binman copies this to the right place for us | ||
.area _GSINIT ; unused | ||
.area _GSFINAL ; unused | ||
.area _DISCARD | ||
.area _DISCARDL | ||
.area _DISCARDH | ||
.area _COMMONMEM | ||
U_DATA__TOTALSIZE .equ 0x200 ; 256+256 bytes @ F000 | ||
Z80_TYPE .equ 0 ; CMOS | ||
|
||
; exported symbols | ||
.globl init | ||
Z80_MMU_HOOKS .equ 0 | ||
|
||
; imported symbols | ||
.globl _fuzix_main | ||
.globl init_hardware | ||
.globl s__INITIALIZER | ||
.globl s__COMMONMEM | ||
.globl l__COMMONMEM | ||
.globl s__DISCARD | ||
.globl l__DISCARD | ||
.globl s__DATA | ||
.globl l__DATA | ||
.globl kstack_top | ||
CONFIG_SWAP .equ 1 | ||
|
||
.include "kernel.def" | ||
PROGBASE .equ 0x0000 | ||
PROGLOAD .equ 0x0100 | ||
|
||
NBUFS .equ 4 | ||
|
||
; | ||
; Select where to put the high code - in our case we need this | ||
; in common | ||
; | ||
|
||
; startup code (0x100) | ||
.area _CODE | ||
|
||
HIGHPAGE .equ 0 ; We only have 1 page byte and the low page | ||
; isn't used | ||
# 5 "crt0.S" 2 | ||
|
||
; startup code (0x100) | ||
.code | ||
init: | ||
di | ||
; switch to stack in high memory | ||
ld sp, #kstack_top | ||
ld sp, kstack_top | ||
|
||
; move the common memory where it belongs | ||
ld hl, #s__DATA | ||
ld de, #s__COMMONMEM | ||
ld bc, #l__COMMONMEM | ||
; move the common memory where it belongs | ||
ld hl, __bss | ||
ld de, __common | ||
ld bc, __common_size | ||
ldir | ||
; and the discard | ||
ld de, #s__DISCARD | ||
ld bc, #l__DISCARD | ||
ld de, __discard | ||
ld bc, __discard_size | ||
ldir | ||
|
||
ld hl, #s__DATA | ||
ld de, #s__DATA + 1 | ||
ld bc, #l__DATA - 1 | ||
ld (hl), #0 | ||
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 | ||
|
||
; fuzix_main() shouldn't return, but if it does... | ||
di | ||
stop: halt | ||
stop: halt | ||
jr stop |
Oops, something went wrong.