mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-11-16 19:48:56 +01:00
check in copy of Piotr Meyer's VM implementation for 65c816 as vm/nga-816
FossilOrigin-Name: a5c5ebaf691d78fc548dd7b69cd1f14f713abbf980a3f491f9321a9a6f14169e
This commit is contained in:
parent
8cbd868004
commit
707274bb9b
10 changed files with 7038 additions and 0 deletions
|
@ -26,6 +26,11 @@
|
|||
- removed unused variables
|
||||
- use a struct for processor state, stacks
|
||||
|
||||
- nga-816
|
||||
|
||||
- assembly implementation for 65c816
|
||||
- by Piotr Meyer
|
||||
|
||||
## Examples
|
||||
|
||||
- reduced some line lengths
|
||||
|
|
21
vm/nga-816/LICENSE
Normal file
21
vm/nga-816/LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 Piotr Meyer
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
17
vm/nga-816/README.md
Normal file
17
vm/nga-816/README.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
# retro/816
|
||||
Port of [RETRO Forth](http://retroforth.org/) created
|
||||
by [Charles Childers](https://www.patreon.com/_crc) to
|
||||
[C256 Foenix](https://c256foenix.com/), a retro-computer
|
||||
based on 65c816 CPU.
|
||||
|
||||
This port is in infancy and there are dark and spooky things inside,
|
||||
but at this moment is able to run simple code in 1:1 pair to one of
|
||||
original interpreters (`vm/nga-c/barebones`).
|
||||
|
||||
It runs in [Foenix IDE](https://github.com/Trinity-11/FoenixIDE),
|
||||
it is also possible to run current, unmodified version of this
|
||||
port on [go65c816 emulator](https://github.com/aniou/go65c816)
|
||||
(use `retro.ini` parameters file here).
|
||||
|
||||
## obligatory screenshot
|
||||
![sample run](Screenshot_20210222_213209.png)
|
BIN
vm/nga-816/Screenshot_20210222_213209.png
Normal file
BIN
vm/nga-816/Screenshot_20210222_213209.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
BIN
vm/nga-816/barebones.image
Normal file
BIN
vm/nga-816/barebones.image
Normal file
Binary file not shown.
4
vm/nga-816/build.sh
Normal file
4
vm/nga-816/build.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
NAME=nga
|
||||
|
||||
64tass -Wall -Wmacro-prefix -Wshadow --verbose-list -o ${NAME}.hex -L ${NAME}.lst --intel-hex --m65816 ${NAME}.asm
|
50
vm/nga-816/macros_inc.asm
Normal file
50
vm/nga-816/macros_inc.asm
Normal file
|
@ -0,0 +1,50 @@
|
|||
; Set 8-bit accumulator
|
||||
setaxs .macro
|
||||
SEP #$30 ; set A&X short
|
||||
.as
|
||||
.xs
|
||||
.endm
|
||||
|
||||
; Set 16-bit accumulator
|
||||
setaxl .macro
|
||||
REP #$30 ; set A&X long
|
||||
.al
|
||||
.xl
|
||||
.endm
|
||||
|
||||
; Set 8-bit accumulator
|
||||
setas .macro
|
||||
SEP #$20 ; set A short
|
||||
.as
|
||||
.endm
|
||||
|
||||
; Set 16-bit accumulator
|
||||
setal .macro
|
||||
REP #$20 ; set A long
|
||||
.al
|
||||
.endm
|
||||
|
||||
; Set 8 bit index registers
|
||||
setxs .macro
|
||||
SEP #$10 ; set X short
|
||||
.xs
|
||||
.endm
|
||||
|
||||
; Set 16-bit index registers
|
||||
setxl .macro
|
||||
REP #$10 ; set X long
|
||||
.xl
|
||||
.endm
|
||||
|
||||
sdb .macro ; Set the B (Data bank) register
|
||||
pha ; begin setdbr macro
|
||||
php
|
||||
.setas
|
||||
lda #\1
|
||||
pha
|
||||
plb
|
||||
.databank \1
|
||||
plp
|
||||
pla ; end setdbr macro
|
||||
.endm
|
||||
|
1571
vm/nga-816/nga.asm
Normal file
1571
vm/nga-816/nga.asm
Normal file
File diff suppressed because it is too large
Load diff
1256
vm/nga-816/nga.hex
Normal file
1256
vm/nga-816/nga.hex
Normal file
File diff suppressed because it is too large
Load diff
4114
vm/nga-816/nga.lst
Normal file
4114
vm/nga-816/nga.lst
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue