-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the ncpm and ncpmz platforms, so they don't use the same linker…
… (which only worked because the z80 assembler I was using understood 8080 instructions...). --HG-- branch : bazel
- Loading branch information
1 parent
f31403c
commit 8bd6277
Showing
7 changed files
with
78 additions
and
18 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
File renamed without changes.
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,59 @@ | ||
const STACK_SIZE := 128; | ||
|
||
var workspaceSize: Size[NUM_WORKSPACES]; | ||
|
||
sub E_nl() is | ||
E_b8('\n'); | ||
end sub; | ||
|
||
sub ArchAlignUp(value: Size, alignment: uint8): (newvalue: Size) is | ||
newvalue := value; | ||
end sub; | ||
|
||
sub ArchEmitSubRef(subr: [Subroutine]) is | ||
E_b8('f'); | ||
E_u16(subr.id); | ||
E_b8('_'); | ||
E(subr.name); | ||
end sub; | ||
|
||
sub ArchEmitWSRef(wid: uint8, address: Size) is | ||
E("ws+"); | ||
E_u16(address); | ||
end sub; | ||
|
||
sub ArchEmitHeader(coo: [Coo]) is | ||
E("\torg 100h\n"); | ||
|
||
E("\tld sp, TOP+"); | ||
E_u16(STACK_SIZE); | ||
E_nl(); | ||
|
||
while coo != (0 as [Coo]) loop | ||
var main := coo.index.subroutines[0]; | ||
if main != (0 as [Subroutine]) then | ||
E("\tcall "); | ||
ArchEmitSubRef(main); | ||
E_nl(); | ||
end if; | ||
coo := coo.next; | ||
end loop; | ||
|
||
E("\trst 0\n"); | ||
end sub; | ||
|
||
sub ArchEmitFooter(coo: [Coo]) is | ||
E("TOP:\n"); | ||
|
||
E("ws equ TOP+"); | ||
E_u16(STACK_SIZE); | ||
E_nl(); | ||
|
||
E("LOMEM equ ws+"); | ||
E_u16(workspaceSize[0]); | ||
E_nl(); | ||
|
||
E("\tend\n"); | ||
E_b8(26); | ||
end sub; | ||
|
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