Skip to content

Commit 0bb3589

Browse files
committed
doc: add docs/ back to the main repo
It's easier to maintain docs in the same repo as the tagging is the same for the readthedocs tool.
1 parent 57f9a73 commit 0bb3589

File tree

328 files changed

+13932
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

328 files changed

+13932
-9
lines changed

docs/.readthedocs.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the version of Python and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
14+
# Build documentation in the docs/ directory with mkdocs
15+
mkdocs:
16+
configuration: mkdocs.yml
17+
fail_on_warning: false

docs/LICENSE.txt

Lines changed: 397 additions & 0 deletions
Large diffs are not rendered by default.

docs/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/doc/about.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# About
2+
3+
4+
## About the ZX BASIC Project
5+
6+
ZX BASIC is a [BASIC](http://en.wikipedia.org/wiki/BASIC) ''cross compiler''.
7+
It will compile BASIC programs (in your PC) for your [ZX Spectrum](http://en.wikipedia.org/wiki/Sinclair_ZX_Spectrum).
8+
ZX BASIC is an <abbr title="Software Development Kit">SDK</abbr> entirely written in [python](http://www.python.org).
9+
The SDK is implemented using the [PLY](http://www.dabeaz.com/ply/) (Python Lex/Yacc) compiler tool.
10+
It translates BASIC to Z80 assembler code, so it is easily portable to other Z80 platforms (Amstrad, MSX).
11+
Other non Z80 targets could also be available in the future.
12+
13+
ZX BASIC syntax tries to maintain compatibility as much as possible with
14+
[Sinclair BASIC](http://en.wikipedia.org/wiki/Sinclair_BASIC), it also have many new features, mostly taken from
15+
[FreeBASIC](http://www.freebasic.net/wiki) dialect.
16+
17+
### Platform Availability
18+
Since it is written in python, it is available for many platforms, like Windows, Linux and Mac.
19+
You only need to have python installed on these. For windows, there also is an installable (.MSI) _compiled_
20+
version, which does not need python previously installed.

docs/doc/abs.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ABS
2+
3+
## Syntax
4+
5+
6+
```
7+
ABS(numericExpression)
8+
```
9+
10+
11+
## Description
12+
13+
Returns the absolute value of the given argument.
14+
Argument must be a numeric expression. Returned value has the same type as the input argument.
15+
16+
## Examples
17+
18+
19+
```
20+
REM Absolute value
21+
LET a = -1
22+
PRINT "Absolute value of a is "; ABS(a)
23+
REM 'Will print 1
24+
```
25+
26+
27+
## Remarks
28+
29+
* This function is 100% Sinclair BASIC Compatible

docs/doc/acs.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ACS
2+
3+
## Syntax
4+
5+
```
6+
ACS(numericExpression)
7+
```
8+
9+
10+
## Description
11+
12+
Returns the arc cosine value of the given argument.
13+
Argument must be a numeric expression. Returned value type is [float](types.md#Float).
14+
15+
## Examples
16+
17+
```
18+
REM Arc cosine value
19+
PRINT "Arc Cosine value of a is "; ACS(a)
20+
```
21+
22+
23+
## Remarks
24+
25+
* This function is 100% Sinclair BASIC Compatible
26+
* If the given argument type is not float, it will be [converted](cast.md) to float before operating with it.
27+
28+
##See also
29+
30+
* [SIN](sin.md) and [ASN](asn.md)
31+
* [TAN](tan.md) and [ATN](atn.md)
32+
* [COS](cos.md)

docs/doc/architectures/6502.py.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# 6502.py
2+
3+
```
4+
#!/usr/bin/python
5+
# -*- coding: utf-8 -*-
6+
# vim:ts=4:et:
7+
#- important: this code is not acurated yet - needs fixes
8+
class Opcode(object):
9+
''' Describes opcodes and other info.
10+
'''
11+
def __init__(self, asm, time, size, opcode):
12+
self.asm = asm
13+
self.T = time
14+
self.size = size
15+
self.opcode = opcode
16+
6502SET = {
17+
"BRK": Opcode("BRK", 1, 1, "00"),
18+
"ORA (x,X)": Opcode("ORA (x,X)", 1, 1, "01 XX XX"),
19+
"ORA x": Opcode("ORA x", 1, 1, "05 XX"),
20+
"ASL x": Opcode("ASL x", 1, 1, "06 XX"),
21+
"PHP": Opcode("PHP", 1, 1, "08"),
22+
"ORA #x": Opcode("ORA #x", 1, 1, "09 XX"),
23+
"ASL": Opcode("ASL", 1, 1, "0a"),
24+
"ORA ?": Opcode("ORA ?", 1, 1, "0d XX XX"),
25+
"ASL ?": Opcode("ASL ?", 1, 1, "0e XX XX"),
26+
"BPL x": Opcode("BPL x", 1, 1, "10 XX"),
27+
"ORA (x),Y": Opcode("ORA (x),Y", 1, 1, "11 XX"),
28+
"ORA x,X": Opcode("ORA x,X", 1, 1, "15 XX"),
29+
"ASL x,X": Opcode("ASL x,X", 1, 1, "16 XX"),
30+
"CLC": Opcode("CLC", 1, 1, "18"),
31+
"ORA ?,Y": Opcode("ORA ?,Y", 1, 1, "19 XX XX"),
32+
"ORA ?,X": Opcode("ORA ?,X", 1, 1, "1d XX XX"),
33+
"ASL ?,X": Opcode("ASL ?,X", 1, 1, "1e XX XX"),
34+
"JSR ?": Opcode("JSR ?", 1, 1, "20 XX XX"),
35+
"AND (x,X)": Opcode("AND (x,X)", 1, 1, "21 XX"),
36+
"BIT x": Opcode("BIT x", 1, 1, "24 XX"),
37+
"AND x": Opcode("AND x", 1, 1, "25 XX"),
38+
"ROL x": Opcode("ROL x", 1, 1, "26 XX"),
39+
"PLP": Opcode("PLP", 1, 1, "28"),
40+
"AND #x": Opcode("AND #x", 1, 1, "29 XX"),
41+
"ROL A": Opcode("ROL A", 1, 1, "2a"),
42+
"BIT ?": Opcode("BIT ?", 1, 1, "2c XX XX"),
43+
"AND ?": Opcode("AND ?", 1, 1, "2d XX XX"),
44+
"ROL ?": Opcode("ROL ?", 1, 1, "2e XX XX"),
45+
"BMI x": Opcode("BMI x", 1, 1, "30 XX"),
46+
"AND (x),Y": Opcode("AND (x),Y", 1, 1, "31 XX"),
47+
"AND x,X": Opcode("AND x,X", 1, 1, "35 XX"),
48+
"ROL x,X": Opcode("ROL x,X", 1, 1, "36 XX"),
49+
"SEC": Opcode("SEC", 1, 1, "38"),
50+
"AND ?,Y": Opcode("AND ?,Y", 1, 1, "39 XX XX"),
51+
"AND ?,X": Opcode("AND ?,X", 1, 1, "3d XX XX"),
52+
"ROL ?,X": Opcode("ROL ?,X", 1, 1, "3e XX XX"),
53+
"RTI": Opcode("RTI", 1, 1, "40"),
54+
"EOR (x,X)": Opcode("EOR (x,X)", 1, 1, "41 XX"),
55+
"EOR x": Opcode("EOR x", 1, 1, "45 XX"),
56+
"LSR x": Opcode("LSR x", 1, 1, "46 XX"),
57+
"PHA": Opcode("PHA", 1, 1, "48"),
58+
"EOR #x": Opcode("EOR #x", 1, 1, "49 XX"),
59+
"LSR A": Opcode("LSR A", 1, 1, "4a"),
60+
"JMP ?": Opcode("JMP ?", 1, 1, "4c XX XX"),
61+
"EOR ?": Opcode("EOR ?", 1, 1, "4d XX XX"),
62+
"LSR ?": Opcode("LSR ?", 1, 1, "4e XX XX"),
63+
"BVC x": Opcode("BVC x", 1, 1, "50 XX"),
64+
"EOR (x),Y": Opcode("EOR (x),Y", 1, 1, "51 XX"),
65+
"EOR x,X": Opcode("EOR x,X", 1, 1, "55 XX"),
66+
"LSR x,X": Opcode("LSR x,X", 1, 1, "56 XX"),
67+
"CLI": Opcode("CLI", 1, 1, "58"),
68+
"EOR ?,Y": Opcode("EOR ?,Y", 1, 1, "59 XX XX"),
69+
"EOR ?,X": Opcode("EOR ?,X", 1, 1, "5d XX XX"),
70+
"LSR ?,X": Opcode("LSR ?,X", 1, 1, "5e XX XX"),
71+
"RTS": Opcode("RTS", 1, 1, "60"),
72+
"ADC (x,X)": Opcode("ADC (x,X)", 1, 1, "61 XX"),
73+
"ADC x": Opcode("ADC x", 1, 1, "65 XX"),
74+
"ROR x": Opcode("ROR x", 1, 1, "66 XX"),
75+
"PLA": Opcode("PLA", 1, 1, "68"),
76+
"ADC #x": Opcode("ADC #x", 1, 1, "69 XX"),
77+
"ROR A": Opcode("ROR A", 1, 1, "6a"),
78+
"JMP (?)": Opcode("JMP (?)", 1, 1, "6c XX XX"),
79+
"ADC ?": Opcode("ADC ?", 1, 1, "6d XX XX"),
80+
"ROR ?": Opcode("ROR ?", 1, 1, "6e XX XX"),
81+
"BVS x": Opcode("BVS x", 1, 1, "70 XX"),
82+
"ADC (x),Y": Opcode("ADC (x),Y", 1, 1, "71 XX"),
83+
"ADC x,X": Opcode("ADC x,X", 1, 1, "75 XX"),
84+
"ROR x,X": Opcode("ROR x,X", 1, 1, "76 XX"),
85+
"SEI": Opcode("SEI", 1, 1, "78"),
86+
"ADC ?,Y": Opcode("ADC ?,Y", 1, 1, "79 XX XX"),
87+
"ADC ?,X": Opcode("ADC ?,X", 1, 1, "7d XX XX"),
88+
"ROR ?,X": Opcode("ROR ?,X", 1, 1, "7e XX XX"),
89+
"STA (x,X)": Opcode("STA (x,X)", 1, 1, "81 XX"),
90+
"STY x": Opcode("STY x", 1, 1, "84 XX"),
91+
"STA x": Opcode("STA x", 1, 1, "85 XX"),
92+
"STX x": Opcode("STX x", 1, 1, "86 XX"),
93+
"DEY": Opcode("DEY", 1, 1, "88"),
94+
"TXA": Opcode("TXA", 1, 1, "8a"),
95+
"STY ?": Opcode("STY ?", 1, 1, "8c XX XX"),
96+
"STA ?": Opcode("STA ?", 1, 1, "8d XX XX"),
97+
"STX ?": Opcode("STX ?", 1, 1, "8e XX XX"),
98+
"BCC x": Opcode("BCC x", 1, 1, "90 XX"),
99+
"STA (x),Y": Opcode("STA (x),Y", 1, 1, "91 XX"),
100+
"STY x,X": Opcode("STY x,X", 1, 1, "94 XX"),
101+
"STA x,X": Opcode("STA x,X", 1, 1, "95 XX"),
102+
"STX x,Y": Opcode("STX x,Y", 1, 1, "96 XX"),
103+
"TYA": Opcode("TYA", 1, 1, "98"),
104+
"STA ?,Y": Opcode("STA ?,Y", 1, 1, "99 XX XX"),
105+
"TXS": Opcode("TXS", 1, 1, "9a"),
106+
"STA ?,X": Opcode("STA ?,X", 1, 1, "9d XX XX"),
107+
"LDY #x": Opcode("LDY #x", 1, 1, "a0 XX"),
108+
"LDA (x,X)": Opcode("LDA (x,X)", 1, 1, "a1 XX"),
109+
"LDX #x": Opcode("LDX #x", 1, 1, "a2 XX"),
110+
"LDY x": Opcode("LDY x", 1, 1, "a4 XX"),
111+
"LDA x": Opcode("LDA x", 1, 1, "a5 XX"),
112+
"LDX x": Opcode("LDX x", 1, 1, "a6 XX"),
113+
"TAY": Opcode("TAY", 1, 1, "a8"),
114+
"LDA #x": Opcode("LDA #x", 1, 1, "a9 XX"),
115+
"TAX": Opcode("TAX", 1, 1, "aa"),
116+
"LDY ?": Opcode("LDY ?", 1, 1, "ac XX XX"),
117+
"LDA ?": Opcode("LDA ?", 1, 1, "ad XX XX"),
118+
"LDX ?": Opcode("LDX ?", 1, 1, "ae XX XX"),
119+
"BCS x": Opcode("BCS x", 1, 1, "b0 XX"),
120+
"LDA (x),Y": Opcode("LDA (x),Y", 1, 1, "b1"),
121+
"LDY x,X": Opcode("LDY x,X", 1, 1, "b4"),
122+
"LDA x,X": Opcode("LDA x,X", 1, 1, "b5"),
123+
"LDX x,Y": Opcode("LDX x,Y", 1, 1, "b6"),
124+
"CLV": Opcode("CLV", 1, 1, "b8"),
125+
"LDA ?,Y": Opcode("LDA ?,Y", 1, 1, "b9"),
126+
"TSX": Opcode("TSX", 1, 1, "ba"),
127+
"LDY ?,X": Opcode("LDY ?,X", 1, 1, "bc"),
128+
"LDA ?,X": Opcode("LDA ?,X", 1, 1, "bd"),
129+
"LDX ?,Y": Opcode("LDX ?,Y", 1, 1, "be"),
130+
"CPY #x": Opcode("CPY #x", 1, 1, "c0 XX"),
131+
"CMP (x,X)": Opcode("CMP (x,X)", 1, 1, "c1 XX"),
132+
"CPY x": Opcode("CPY x", 1, 1, "c4 XX"),
133+
"CMP x": Opcode("CMP x", 1, 1, "c5 XX"),
134+
"DEC x": Opcode("DEC x", 1, 1, "c6 XX"),
135+
"INY": Opcode("INY", 1, 1, "c8"),
136+
"CMP #x": Opcode("CMP #x", 1, 1, "c9 XX"),
137+
"DEX": Opcode("DEX", 1, 1, "ca"),
138+
"CPY ?": Opcode("CPY ?", 1, 1, "cc XX XX"),
139+
"CMP ?": Opcode("CMP ?", 1, 1, "cd XX XX"),
140+
"DEC ?": Opcode("DEC ?", 1, 1, "ce XX XX"),
141+
"BNE x": Opcode("BNE x", 1, 1, "d0 XX"),
142+
"CMP (x),Y": Opcode("CMP (x),Y", 1, 1, "d1 XX"),
143+
"CMP x,X": Opcode("CMP x,X", 1, 1, "d5 XX"),
144+
"DEC x,X": Opcode("DEC x,X", 1, 1, "d6 XX"),
145+
"CLD": Opcode("CLD", 1, 1, "d8"),
146+
"CMP ?,Y": Opcode("CMP ?,Y", 1, 1, "d9"),
147+
"CMP ?,X": Opcode("CMP ?,X", 1, 1, "dd"),
148+
"DEC ?,X": Opcode("DEC ?,X", 1, 1, "de"),
149+
"CPX #x": Opcode("CPX #x", 1, 1, "e0 XX"),
150+
"SBC (x,X)": Opcode("SBC (x,X)", 1, 1, "e1 XX"),
151+
"CPX x": Opcode("CPX x", 1, 1, "e4 XX"),
152+
"SBC x": Opcode("SBC x", 1, 1, "e5 XX"),
153+
"INC x": Opcode("INC x", 1, 1, "e6 XX"),
154+
"INX": Opcode("INX", 1, 1, "e8"),
155+
"SBC #x": Opcode("SBC #x", 1, 1, "e9 XX"),
156+
"NOP": Opcode("NOP", 1, 1, "ea"),
157+
"CPX ?": Opcode("CPX ?", 1, 1, "ec XX XX"),
158+
"SBC ?": Opcode("SBC ?", 1, 1, "ed XX XX"),
159+
"INC ?": Opcode("INC ?", 1, 1, "ee XX XX"),
160+
"BEQ x": Opcode("BEQ x", 1, 1, "f0 XX"),
161+
"SBC (x),Y": Opcode("SBC (x),Y", 1, 1, "f1 XX"),
162+
"SBC x,X": Opcode("SBC x,X", 1, 1, "f5 XX"),
163+
"INC x,X": Opcode("INC x,X", 1, 1, "f6 XX"),
164+
"SED": Opcode("SED", 1, 1, "f8"),
165+
"SBC ?,Y": Opcode("SBC ?,Y", 1, 1, "f9 XX XX"),
166+
"SBC ?,X": Opcode("SBC ?,X", 1, 1, "fd XX XX"),
167+
"INC ?,X": Opcode("INC ?,X", 1, 1, "fe XX XX"),
168+
169+
}

0 commit comments

Comments
 (0)