├── DISCLAIMER.txt ├── Min Language ├── LICENSE ├── Pre-studies │ └── Simple Interpreter │ │ ├── demo.txt │ │ ├── inter.py │ │ └── test.txt ├── README.md ├── blocks.min ├── ebnf_py.txt ├── min.py └── tests │ ├── test0.min │ ├── test1.min │ ├── test10.min │ ├── test11.min │ ├── test12.min │ ├── test13.min │ ├── test14.min │ ├── test15.min │ ├── test16.min │ ├── test17.min │ ├── test18.min │ ├── test19.min │ ├── test2.min │ ├── test20.min │ ├── test21.min │ ├── test22.min │ ├── test23.min │ ├── test24.min │ ├── test25.min │ ├── test26.min │ ├── test3.min │ ├── test4.min │ ├── test5.min │ ├── test6.min │ ├── test7.min │ ├── test8.min │ └── test9.min ├── README.md ├── Revisions 0.9 - 1.2 (EEPROM) ├── Revision 0.9 (Prototype) │ ├── KiCAD Schematics Update 1.01 │ │ ├── 8-Bit CPU 32k-cache.lib │ │ ├── 8-Bit CPU 32k-rescue.dcm │ │ ├── 8-Bit CPU 32k-rescue.lib │ │ ├── 8-Bit CPU 32k.bck │ │ ├── 8-Bit CPU 32k.dcm │ │ ├── 8-Bit CPU 32k.kicad_pcb │ │ ├── 8-Bit CPU 32k.lib │ │ ├── 8-Bit CPU 32k.pro │ │ ├── 8-Bit CPU 32k.sch │ │ ├── 8-Bit CPU 32k.sch-bak │ │ ├── ALU.sch │ │ ├── ALU.sch-bak │ │ ├── IR.sch │ │ ├── IR.sch-bak │ │ ├── Logic.sch │ │ ├── PC.sch │ │ ├── PC.sch-bak │ │ ├── RAM.sch │ │ ├── RAM.sch-bak │ │ ├── RegA.sch │ │ ├── RegA.sch-bak │ │ ├── RegB.sch │ │ ├── RegB.sch-bak │ │ ├── VGA.sch │ │ ├── VGA.sch-bak │ │ ├── _autosave-Logic.sch │ │ ├── busleds.sch │ │ ├── busleds.sch-bak │ │ ├── cassette.sch │ │ ├── cassette.sch-bak │ │ └── sym-lib-table │ ├── LICENSE.txt │ ├── Microcode_v1.29_MINIMAL_8-BIT_CPU.txt │ ├── Minimal 8-Bit CPU Emulator.exe │ ├── Opcode_Table_Minimal_8-Bit_CPU.pdf │ ├── README 8-Bit-Minimal-CPU.txt │ ├── README.md │ ├── Support │ │ └── Assembler (Win64) │ │ │ └── asm.exe │ ├── block.txt │ ├── chars.txt │ ├── cursor.txt │ ├── hello.txt │ └── hi.txt └── Revision 1.2 (EEPROMs) │ ├── Bill of Materials.ods │ ├── DISCLAIMER.txt │ ├── Gerbers.zip │ ├── Instruction Set.ods │ ├── KiCAD │ ├── 8-Bit CPU 32k │ ├── 8-Bit CPU 32k-cache.lib │ ├── 8-Bit CPU 32k-rescue.dcm │ ├── 8-Bit CPU 32k-rescue.lib │ ├── 8-Bit CPU 32k.bin │ ├── 8-Bit CPU 32k.dcm │ ├── 8-Bit CPU 32k.dsn │ ├── 8-Bit CPU 32k.kicad_pcb │ ├── 8-Bit CPU 32k.lib │ ├── 8-Bit CPU 32k.net │ ├── 8-Bit CPU 32k.pro │ ├── 8-Bit CPU 32k.rules │ ├── 8-Bit CPU 32k.sch │ ├── 8-Bit CPU 32k.ses │ ├── 8-Bit CPU 32k.xml │ ├── ALU.sch │ ├── Gerbers │ │ ├── 8-Bit CPU 32k-B_Cu.gbl │ │ ├── 8-Bit CPU 32k-B_Mask.gbs │ │ ├── 8-Bit CPU 32k-B_SilkS.gbo │ │ ├── 8-Bit CPU 32k-Edge_Cuts.gm1 │ │ ├── 8-Bit CPU 32k-F_Cu.gtl │ │ ├── 8-Bit CPU 32k-F_Mask.gts │ │ ├── 8-Bit CPU 32k-F_SilkS.gto │ │ ├── 8-Bit CPU 32k-NPTH.drl │ │ └── 8-Bit CPU 32k-PTH.drl │ ├── IR.sch │ ├── PC.sch │ ├── RAM.sch │ ├── RegA.sch │ ├── RegB.sch │ ├── UART_RX.sch │ ├── UART_TX.sch │ ├── fp-info-cache │ └── sym-lib-table │ ├── Microcode.txt │ ├── Overview.pdf │ ├── Programs │ ├── demos │ │ ├── blocks.txt │ │ ├── calculator.txt │ │ └── pong.txt │ ├── examples │ │ ├── chars.txt │ │ └── hello.txt │ ├── readme.txt │ └── rom.txt │ ├── README.md │ ├── ROM Images │ ├── CTRL_LSB.bin │ ├── CTRL_MSB.bin │ ├── ROM.bin │ └── version.txt │ ├── Schematics_Revision_1.2.pdf │ └── Support │ ├── Assembler (Win64) │ └── asm.exe │ └── Emulator (Win64) │ ├── CTRL_LSB.bin │ ├── CTRL_MSB.bin │ ├── README.md │ ├── ROM.bin │ ├── asm.exe │ ├── hello.txt │ ├── main.cpp │ └── main.exe ├── Revisions 1.3 - 1.6 (FLASH) ├── Expansions │ ├── GPIO Card │ │ ├── README.md │ │ ├── gpioread.txt │ │ └── gpiowrite.txt │ └── VGA Card │ │ ├── Gerbers_Minimal_UART_VGA_Card.zip │ │ ├── KiCAD │ │ ├── 8-Bit CPU 32k.lib │ │ ├── ArduinoPC.lib │ │ ├── ArduinoPC.pretty │ │ │ ├── FP_MINI_DIN_6_PS2.kicad_mod │ │ │ ├── PinHeader_2x02_P2.54mm_Vertical_Jumper.kicad_mod │ │ │ ├── VGA DSUB15HD_female.kicad_mod │ │ │ └── logo.kicad_mod │ │ ├── Minimal Expansion.lib │ │ ├── VideoRAM-cache.lib │ │ ├── VideoRAM-rescue.dcm │ │ ├── VideoRAM-rescue.lib │ │ ├── VideoRAM.bin │ │ ├── VideoRAM.dcm │ │ ├── VideoRAM.dsn │ │ ├── VideoRAM.kicad_pcb │ │ ├── VideoRAM.lib │ │ ├── VideoRAM.net │ │ ├── VideoRAM.pro │ │ ├── VideoRAM.rules │ │ ├── VideoRAM.sch │ │ ├── VideoRAM.ses │ │ ├── VideoRAM2.rules │ │ ├── arduino.sch │ │ ├── fp-info-cache │ │ ├── fp-lib-table │ │ └── sym-lib-table │ │ ├── Minimal_UART_VGA_Extension_Card.pdf │ │ └── vga.txt ├── Programs │ ├── README.md │ ├── asm.txt │ ├── blocks.txt │ ├── chars.txt │ ├── editor.txt │ ├── hello.txt │ ├── min.txt │ ├── min │ │ ├── blocks.min │ │ ├── std.min │ │ ├── test0.min │ │ ├── test1.min │ │ ├── test10.min │ │ ├── test11.min │ │ ├── test12.min │ │ ├── test13.min │ │ ├── test14.min │ │ ├── test15.min │ │ ├── test16.min │ │ ├── test17.min │ │ ├── test18.min │ │ ├── test19.min │ │ ├── test2.min │ │ ├── test20.min │ │ ├── test21.min │ │ ├── test22.min │ │ ├── test23.min │ │ ├── test24.min │ │ ├── test3.min │ │ ├── test4.min │ │ ├── test5.min │ │ ├── test6.min │ │ ├── test7.min │ │ ├── test8.min │ │ └── test9.min │ ├── os.txt │ ├── pictures.txt │ ├── pong.txt │ ├── prom.txt │ ├── rand.txt │ └── textloader.txt ├── Revision 1.3 (FLASH Edition) │ ├── KiCAD │ │ ├── 8-Bit CPU 32k-cache.lib │ │ ├── 8-Bit CPU 32k-rescue.dcm │ │ ├── 8-Bit CPU 32k-rescue.lib │ │ ├── 8-Bit CPU 32k.bin │ │ ├── 8-Bit CPU 32k.dcm │ │ ├── 8-Bit CPU 32k.dsn │ │ ├── 8-Bit CPU 32k.kicad_pcb │ │ ├── 8-Bit CPU 32k.kicad_pcb-bak │ │ ├── 8-Bit CPU 32k.lib │ │ ├── 8-Bit CPU 32k.net │ │ ├── 8-Bit CPU 32k.pro │ │ ├── 8-Bit CPU 32k.rules │ │ ├── 8-Bit CPU 32k.sch │ │ ├── 8-Bit CPU 32k.sch-bak │ │ ├── 8-Bit CPU 32k.ses │ │ ├── 8-Bit CPU 32k.xml │ │ ├── ALU.sch │ │ ├── ALU.sch-bak │ │ ├── IR.sch │ │ ├── IR.sch-bak │ │ ├── PC.sch │ │ ├── PC.sch-bak │ │ ├── RAM.sch │ │ ├── RAM.sch-bak │ │ ├── RegA.sch │ │ ├── RegA.sch-bak │ │ ├── RegB.sch │ │ ├── RegB.sch-bak │ │ ├── UART_RX.sch │ │ ├── UART_RX.sch-bak │ │ ├── UART_TX.sch │ │ ├── UART_TX.sch-bak │ │ ├── fp-info-cache │ │ ├── gui_defaults.par │ │ └── sym-lib-table │ ├── Minimal 1.3 BOM.ods │ ├── Minimal 1.3 Gerbers.zip │ ├── Minimal 1.3 Layout.jpg │ ├── Minimal 1.3 Overview.pdf │ ├── Minimal 1.3 Schematics.pdf │ ├── README.md │ └── ROM Images │ │ └── README.md ├── Revision 1.5 (Expanded) │ ├── KiCAD │ │ ├── 8-Bit CPU 32k │ │ ├── 8-Bit CPU 32k-cache.lib │ │ ├── 8-Bit CPU 32k-rescue.dcm │ │ ├── 8-Bit CPU 32k-rescue.lib │ │ ├── 8-Bit CPU 32k.bck │ │ ├── 8-Bit CPU 32k.bin │ │ ├── 8-Bit CPU 32k.dcm │ │ ├── 8-Bit CPU 32k.dsn │ │ ├── 8-Bit CPU 32k.kicad_pcb │ │ ├── 8-Bit CPU 32k.kicad_pcb-bak │ │ ├── 8-Bit CPU 32k.lib │ │ ├── 8-Bit CPU 32k.net │ │ ├── 8-Bit CPU 32k.pro │ │ ├── 8-Bit CPU 32k.rules │ │ ├── 8-Bit CPU 32k.sch │ │ ├── 8-Bit CPU 32k.sch-bak │ │ ├── 8-Bit CPU 32k.ses │ │ ├── 8-Bit CPU 32k.xml │ │ ├── ALU.sch │ │ ├── ALU.sch-bak │ │ ├── ClockAndReset.sch │ │ ├── ClockAndReset.sch-bak │ │ ├── IR.sch │ │ ├── IR.sch-bak │ │ ├── Minimal Expansion.bck │ │ ├── Minimal Expansion.dcm │ │ ├── Minimal Expansion.lib │ │ ├── PC.sch │ │ ├── PC.sch-bak │ │ ├── RAM.sch │ │ ├── RAM.sch-bak │ │ ├── RegA.sch │ │ ├── RegA.sch-bak │ │ ├── RegB.sch │ │ ├── RegB.sch-bak │ │ ├── UART_RX.sch │ │ ├── UART_RX.sch-bak │ │ ├── UART_TX.sch │ │ ├── UART_TX.sch-bak │ │ ├── fp-info-cache │ │ ├── fp-lib-table │ │ ├── gui_defaults.par │ │ ├── logo.pretty │ │ │ └── logo.kicad_mod │ │ └── sym-lib-table │ ├── Minimal 1.5 BOM.ods │ ├── Minimal 1.5 Gerbers.zip │ ├── Minimal 1.5 Layout.jpg │ ├── Minimal 1.5 Schematics.pdf │ └── ROM Images │ │ ├── ctrl_lsb.bin │ │ ├── ctrl_msb.bin │ │ ├── flash.bin │ │ └── rom.bin ├── Revision 1.6 (Redux) │ ├── KiCAD │ │ ├── 74hc4078.kicad_sym │ │ ├── 8-Bit CPU 32k │ │ ├── 8-Bit CPU 32k-backups │ │ │ └── 8-Bit CPU 32k-2022-07-19_185207.zip │ │ ├── 8-Bit CPU 32k-cache.kicad_sym │ │ ├── 8-Bit CPU 32k-cache.lib │ │ ├── 8-Bit CPU 32k-rescue.dcm │ │ ├── 8-Bit CPU 32k-rescue.kicad_sym │ │ ├── 8-Bit CPU 32k-rescue.lib │ │ ├── 8-Bit CPU 32k.bin │ │ ├── 8-Bit CPU 32k.dcm │ │ ├── 8-Bit CPU 32k.dsn │ │ ├── 8-Bit CPU 32k.kicad_pcb │ │ ├── 8-Bit CPU 32k.kicad_prl │ │ ├── 8-Bit CPU 32k.kicad_pro │ │ ├── 8-Bit CPU 32k.kicad_sch │ │ ├── 8-Bit CPU 32k.kicad_sym │ │ ├── 8-Bit CPU 32k.lib │ │ ├── 8-Bit CPU 32k.net │ │ ├── 8-Bit CPU 32k.pro │ │ ├── 8-Bit CPU 32k.rules │ │ ├── 8-Bit CPU 32k.sch │ │ ├── 8-Bit CPU 32k.ses │ │ ├── 8-Bit CPU 32k.xml │ │ ├── ALU.kicad_sch │ │ ├── ALU.sch │ │ ├── IR.kicad_sch │ │ ├── IR.sch │ │ ├── Minimal Expansion.dcm │ │ ├── Minimal Expansion.kicad_sym │ │ ├── Minimal Expansion.lib │ │ ├── PC.kicad_sch │ │ ├── PC.sch │ │ ├── RAM.kicad_sch │ │ ├── RAM.sch │ │ ├── RegA.kicad_sch │ │ ├── RegA.sch │ │ ├── RegB.kicad_sch │ │ ├── RegB.sch │ │ ├── UART_RX.kicad_sch │ │ ├── UART_RX.sch │ │ ├── UART_TX.kicad_sch │ │ ├── UART_TX.sch │ │ ├── fp-info-cache │ │ ├── fp-lib-table │ │ ├── gui_defaults.par │ │ ├── logo.pretty │ │ │ └── logo.kicad_mod │ │ └── sym-lib-table │ ├── Layout.jpg │ ├── Overview.pdf │ ├── ROM Images │ │ ├── ctrl_hsb.bin │ │ ├── ctrl_lsb.bin │ │ ├── ctrl_msb.bin │ │ ├── flash.bin │ │ └── rom.bin │ ├── Schematics.pdf │ └── readme.txt └── Support │ ├── Assembler (Python) │ ├── README.md │ ├── asm.py │ └── hello.txt │ ├── Assembler (Win64) │ └── asm.exe │ └── Emulator (Win64) │ ├── Minimal CPU System.exe │ └── flash.bin └── Revisions 2.x (ULTRA) ├── Programs ├── asm.asm ├── blocks.asm ├── chars.asm ├── edit.asm ├── mandel.asm ├── min.asm ├── min │ ├── blocks.min │ └── std.min └── os.asm ├── README.md ├── Revision 2.0 ├── KiCAD │ ├── 74hc4078.kicad_sym │ ├── 8-Bit CPU 32k │ ├── 8-Bit CPU 32k-backups │ │ ├── 8-Bit CPU 32k-2023-09-24_192154.zip │ │ ├── 8-Bit CPU 32k-2023-09-24_193215.zip │ │ ├── 8-Bit CPU 32k-2023-09-24_205147.zip │ │ ├── 8-Bit CPU 32k-2023-09-27_182427.zip │ │ ├── 8-Bit CPU 32k-2023-09-27_191756.zip │ │ ├── 8-Bit CPU 32k-2023-09-30_164740.zip │ │ ├── 8-Bit CPU 32k-2023-09-30_175359.zip │ │ ├── 8-Bit CPU 32k-2023-09-30_190115.zip │ │ ├── 8-Bit CPU 32k-2023-09-30_205439.zip │ │ ├── 8-Bit CPU 32k-2023-09-30_215825.zip │ │ ├── 8-Bit CPU 32k-2023-10-01_205741.zip │ │ ├── 8-Bit CPU 32k-2023-10-01_210716.zip │ │ ├── 8-Bit CPU 32k-2023-10-01_211253.zip │ │ ├── 8-Bit CPU 32k-2023-10-01_213641.zip │ │ ├── 8-Bit CPU 32k-2023-10-01_233504.zip │ │ ├── 8-Bit CPU 32k-2023-10-02_122550.zip │ │ ├── 8-Bit CPU 32k-2023-10-02_123207.zip │ │ ├── 8-Bit CPU 32k-2023-10-02_124026.zip │ │ ├── 8-Bit CPU 32k-2023-10-02_202432.zip │ │ ├── 8-Bit CPU 32k-2023-10-02_213939.zip │ │ ├── 8-Bit CPU 32k-2023-10-14_173521.zip │ │ ├── 8-Bit CPU 32k-2023-10-14_193926.zip │ │ ├── 8-Bit CPU 32k-2023-10-23_101159.zip │ │ ├── 8-Bit CPU 32k-2023-10-23_211603.zip │ │ ├── 8-Bit CPU 32k-2023-10-27_104228.zip │ │ └── 8-Bit CPU 32k-2023-10-27_104938.zip │ ├── 8-Bit CPU 32k-cache.kicad_sym │ ├── 8-Bit CPU 32k-cache.lib │ ├── 8-Bit CPU 32k-rescue.dcm │ ├── 8-Bit CPU 32k-rescue.kicad_sym │ ├── 8-Bit CPU 32k-rescue.lib │ ├── 8-Bit CPU 32k.bin │ ├── 8-Bit CPU 32k.dcm │ ├── 8-Bit CPU 32k.dsn │ ├── 8-Bit CPU 32k.kicad_pcb │ ├── 8-Bit CPU 32k.kicad_prl │ ├── 8-Bit CPU 32k.kicad_pro │ ├── 8-Bit CPU 32k.kicad_sch │ ├── 8-Bit CPU 32k.kicad_sym │ ├── 8-Bit CPU 32k.lib │ ├── 8-Bit CPU 32k.net │ ├── 8-Bit CPU 32k.pro │ ├── 8-Bit CPU 32k.rules │ ├── 8-Bit CPU 32k.sch │ ├── 8-Bit CPU 32k.ses │ ├── ALU.kicad_sch │ ├── ALU.sch │ ├── ArduinoPC.pretty │ │ ├── FP_MINI_DIN_6_PS2.kicad_mod │ │ └── VGA DSUB15HD_female.kicad_mod │ ├── IR.kicad_sch │ ├── IR.sch │ ├── PC.kicad_sch │ ├── PC.sch │ ├── RAM.kicad_sch │ ├── RAM.sch │ ├── RegA.kicad_sch │ ├── RegA.sch │ ├── RegB.kicad_sch │ ├── RegB.sch │ ├── UART_RX.kicad_sch │ ├── UART_RX.sch │ ├── UART_TX.kicad_sch │ ├── UART_TX.sch │ ├── clock.kicad_sch │ ├── fp-info-cache │ ├── fp-lib-table │ ├── gui_defaults.par │ ├── logo.pretty │ │ └── logo.kicad_mod │ ├── ps2.kicad_sch │ └── sym-lib-table ├── ROM Images │ ├── ctrl_hsb.bin │ ├── ctrl_lsb.bin │ ├── ctrl_msb.bin │ └── flash.bin └── Schematics.pdf └── Support ├── Assembler (Win64) └── asm.exe └── Emulator (Win64) ├── Minimal.exe └── flash.bin /DISCLAIMER.txt: -------------------------------------------------------------------------------- 1 | IN THE FOLLOWING, ALL INFORMATION MADE AVAILABLE IN THIS REPOSITORY 2 | 'Minimal-UART-CPU-System' IS SUMMARIZED UNDER THE TERM "SOFTWARE". 3 | 4 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 5 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 6 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 7 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 8 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 9 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Min Language/Pre-studies/Simple Interpreter/demo.txt: -------------------------------------------------------------------------------- 1 | # ******************************************************************* 2 | # ***** This is an interpreter study for the Minimal CPU System ***** 3 | # ******************************************************************* 4 | 5 | sub printdemo # demonstrating the print statement and mathmatical terms 6 | { 7 | print "MATH DEMO: (10+20)*3 + 1 = ", (10+20)*3 + 1, "\n" 8 | } 9 | 10 | sub whiledemo # demonstrating the while, break and if statements 11 | { 12 | print "WHILE DEMO:\n" 13 | a=0 14 | while a<20 15 | { 16 | if !a<10 break 17 | print "a=", a, ":" 18 | b=0 while b<((2+3)*a) { print "." b=b+1 } 19 | if a<5 print "a<5\n" else print "a>=5\n" 20 | a=a+1 21 | } 22 | } 23 | 24 | sub logicdemo 25 | { 26 | print "LOGIC DEMO: " 27 | if 0 | 0>-1 | 0 | 0 print "True! " else print "False! " 28 | if 1 & 1 & 1 & 1 print "True!\n" else print "False!\n" 29 | } 30 | 31 | sub inputdemo 32 | { 33 | print "INPUT DEMO: " 34 | while 1 35 | { 36 | print "Type in a number > 0: " 37 | in = input() 38 | num = val(in) 39 | if num > 0 40 | { 41 | a = 0 42 | while a -2 | 0 print "True" else print "False" 7 | x=0 8 | while x<20 9 | { 10 | if !x<10 break 11 | print "." x=x+1 12 | } 13 | } 14 | 15 | print "Hello, World!\n" # program entry point 16 | gosub demo 17 | -------------------------------------------------------------------------------- /Min Language/README.md: -------------------------------------------------------------------------------- 1 | # Min Is Not Python... 2 | ... but an interpreted computer language I develop for fun and as a learning experience, mainly to deploy it on my DIY 'Minimal UART CPU' project and also on my latest 'Minimal 64 Home Computer'. 3 | 4 | This educational version of Min is written in 230 lines of Python code. Visit my YouTube channel for more information: https://www.youtube.com/channel/UCXYQcMpUBT3aaQKfmAVJNow 5 | 6 | USAGE: python min.py blocks.min 7 | 8 | What you get: 9 | 10 | o Python-style indentation 11 | 12 | o if-elif-else, while-break, print, def-return 13 | 14 | o str(), input(), int(), len(), key(), random() 15 | 16 | o string and integer data types 17 | 18 | o local and global variables and 1-dimensional arrays 19 | 20 | o functions with parameters and C-style referencing 21 | 22 | o optional : and ; syntax sugar 23 | 24 | o .. slicing operator replacing : 25 | 26 | o 'A' replacing ord("A") 27 | 28 | 29 | Have fun! 30 | 31 | -------------------------------------------------------------------------------- /Min Language/tests/test0.min: -------------------------------------------------------------------------------- 1 | print "SPEED TEST\n" 2 | x=0 3 | while x<5000 4 | x=x+1 5 | if x==5 break 6 | print x, "\n" 7 | y=0 8 | while y<5000 9 | y=y+1 10 | if y==20 break # with 200: Python 11.30s, C++: 0.162s (70x faster) 11 | z=0 12 | while z<5000 13 | z=z+1 14 | if z==20 break # 200 speed test 15 | 16 | print "END\n" 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Min Language/tests/test1.min: -------------------------------------------------------------------------------- 1 | print "IF LEVEL TEST\n" 2 | if 1 > 0 3 | print "If level 1 True\n" 4 | if -2 > 1 5 | print "If level 2a True should not be visible\n" 6 | if -3 < 1 7 | print "If level 3 True should not be visible\n" 8 | else print "If level 2a False is okay\n" 9 | if 2 > 1 10 | print "If level 2b True\n" 11 | 12 | a = -1 13 | if a != -2 14 | while a < 7 15 | if a>3 print a,">3\n" 16 | elif a>2 17 | print a,">2\n" 18 | elif a>1 print a,">1\n" 19 | else 20 | print a,"<= 1\n" 21 | a=a+1 22 | print "END\n" -------------------------------------------------------------------------------- /Min Language/tests/test10.min: -------------------------------------------------------------------------------- 1 | print "ELEMENT ACCESS MATH\n" 2 | 3 | a = [10, 20, 30, 40] 4 | 5 | if 5+a[1] == 25 print "WORKS\n" 6 | else print "PROBLEM\n" 7 | 8 | if a[2]+5 == 35 print "WORKS\n" 9 | else print "PROBLEM\n" 10 | -------------------------------------------------------------------------------- /Min Language/tests/test11.min: -------------------------------------------------------------------------------- 1 | a = [ 10, 11, 20 ,22 , 30, 33 , 0 , 44, 50 , 55 ] 2 | 3 | print "CONCATENATION TEST\n" 4 | a = a + a 5 | i=0 6 | while i < len(a) print a[ i ] , " " i=i+1 7 | 8 | -------------------------------------------------------------------------------- /Min Language/tests/test12.min: -------------------------------------------------------------------------------- 1 | def change(&a) 2 | a = a + 2 3 | meine(a) 4 | 5 | def meine(&b) 6 | b = b + 1 7 | 8 | z = 10 print z 9 | change(z) print z 10 | 11 | # Ausdruck: 10, 13 12 | -------------------------------------------------------------------------------- /Min Language/tests/test13.min: -------------------------------------------------------------------------------- 1 | def test( & a , & b ) # a und b sind Referenzen 2 | a = b # b wird als Expression evaluiert (20) und in der Referenz a auf x gespeichert 3 | b = b + 1 # 21 wird in der Refernz b auf y gespeichert 4 | 5 | x = 10; y = 20 6 | test( x , y ) 7 | print x , y # 20, 21 8 | -------------------------------------------------------------------------------- /Min Language/tests/test14.min: -------------------------------------------------------------------------------- 1 | print "SLICING TEST\n" 2 | 3 | a = "Hello, slu4" 4 | c = a[0..8][0..4][2..4] 5 | print a, " -> ", c, "\n" 6 | -------------------------------------------------------------------------------- /Min Language/tests/test15.min: -------------------------------------------------------------------------------- 1 | print "RANDOM TEST\n" 2 | 3 | r = 0 4 | while r != 255 r = rnd() print r, " " 5 | -------------------------------------------------------------------------------- /Min Language/tests/test16.min: -------------------------------------------------------------------------------- 1 | print "PRESS ANY KEY: " 2 | 3 | s = "_" 4 | while 1 5 | i = key() 6 | if i!=255: s[0] = i; print s 7 | -------------------------------------------------------------------------------- /Min Language/tests/test17.min: -------------------------------------------------------------------------------- 1 | def add_one(& s) # try to pass without & 2 | s = s + 1 3 | return s 4 | 5 | def add_hi(& s) # try to pass without & 6 | s = s + " Hi!" 7 | return s 8 | 9 | z = 0 10 | a = "Hallo" 11 | 12 | print z, a, "\n" 13 | 14 | add_hi(a) 15 | add_one(z) 16 | 17 | print z, a, "\n" 18 | -------------------------------------------------------------------------------- /Min Language/tests/test18.min: -------------------------------------------------------------------------------- 1 | a = "Hallo " 2 | b = "slu4 " 3 | c = b # arrays are passed by copy 4 | 5 | print a, b, c, "\n" 6 | c = c + "test" # does not change b 7 | print a, b, c, "\n" 8 | 9 | k = 1 10 | l = 2 11 | m = k # primitives are passer by copy 12 | 13 | print k, l, m, "\n" 14 | m = m + 10 # does not change k 15 | print k, l, m, "\n" 16 | -------------------------------------------------------------------------------- /Min Language/tests/test19.min: -------------------------------------------------------------------------------- 1 | z = "Hello" 2 | 3 | a = z[0] 4 | print a, "\n" 5 | 6 | z[0] = 66 7 | print z, "\n" 8 | 9 | y = [10, 20, 30, 40, 50, 60] 10 | y[3] = 999 11 | print y, "\n" 12 | 13 | -------------------------------------------------------------------------------- /Min Language/tests/test2.min: -------------------------------------------------------------------------------- 1 | def text() 2 | print "Okay!" 3 | return 4 | print "What!??" 5 | 6 | def demo() # do some commenting 7 | 8 | a = "MATH Expressions " 9 | b = (10 + 1*2 + (4 + 5)*2 )*3 - int("111") 10 | print "Test " + a + str(b), "\n" 11 | 12 | if 0 or 5 > -2 or 0 print "True\n" 13 | else print "False\n" 14 | 15 | x=0 16 | while x<20 x=x+1 print ":" 17 | 18 | x=0 19 | while x < 20 20 | 21 | x=x+1 22 | 23 | if x == 5 text() 24 | if x == 7 print "Ready." return 25 | if not x <15 break 26 | print "." 27 | 28 | print "Hello, World!\n" # program entry point 29 | 30 | demo() 31 | text() 32 | 33 | print "END\n" 34 | 35 | -------------------------------------------------------------------------------- /Min Language/tests/test20.min: -------------------------------------------------------------------------------- 1 | def cls() print "\e[H\e[J" 2 | def pos(x, y) print "\e[" + str(x) + "G\e[" + str(y) + "d" 3 | 4 | cls() 5 | pos(10, 10) 6 | print "Hello, World!" 7 | -------------------------------------------------------------------------------- /Min Language/tests/test21.min: -------------------------------------------------------------------------------- 1 | def cursor(x) 2 | print x, " should be 11\n" 3 | 4 | def shape(x) 5 | print x, " should be 10\n" 6 | cursor(x+1) 7 | print x, " should still be 10\n" 8 | 9 | shape(10) -------------------------------------------------------------------------------- /Min Language/tests/test22.min: -------------------------------------------------------------------------------- 1 | while 1 2 | print rnd(), " " 3 | -------------------------------------------------------------------------------- /Min Language/tests/test23.min: -------------------------------------------------------------------------------- 1 | test() 2 | print "Hello World!" 3 | 4 | test() 5 | -------------------------------------------------------------------------------- /Min Language/tests/test24.min: -------------------------------------------------------------------------------- 1 | # LOCAL AND GLOBAL VARIABLES 2 | 3 | def test() 4 | y = 100 # local variable stored as y@1 5 | print x # global variable 6 | 7 | def increment(&r) 8 | r=r+1 # reference variable stored as r@1 9 | 10 | x = 1 # global variable stored as 'x' 11 | if x == 1 12 | y = 0 # local variable stored as y@0 13 | while y<10 14 | y = y + 1 15 | increment(y) 16 | a = 10 # local variable stored as a@0 only inside while 17 | test() 18 | print "." 19 | 20 | # print a # ERROR: a is undefined! -------------------------------------------------------------------------------- /Min Language/tests/test25.min: -------------------------------------------------------------------------------- 1 | def add_this(a, b, &c) 2 | r = a + b + c 3 | return r 4 | 5 | x = 100 6 | print add_this(1, 10, x) -------------------------------------------------------------------------------- /Min Language/tests/test26.min: -------------------------------------------------------------------------------- 1 | def test() 2 | y = 100 # local variable stored as y@1 3 | print x # global variable 4 | 5 | x = 1 # global variable stored as x 6 | if x == 1 7 | y = 0 # local variable stored as y@0 8 | while y<10 9 | y = y + 1 10 | a = 10 # local variable stored as a@0 only inside while 11 | test() 12 | print y 13 | 14 | print a # a is undefined! -------------------------------------------------------------------------------- /Min Language/tests/test3.min: -------------------------------------------------------------------------------- 1 | def sub0() 2 | x = 100 3 | 4 | def sub1() 5 | print "sub1\n" 6 | y=0 7 | while y<10 8 | y=y+1 9 | if y==5 break 10 | x=0 11 | while x<10 12 | x=x+1 13 | sub0( ) 14 | if x==5 break 15 | z=0 16 | while z<10 17 | z=z+1 18 | if z==5 break 19 | if z==5 return 20 | print x*y*z, " " 21 | print "\n" 22 | 23 | def sub2( ) 24 | print "sub2\n" 25 | sub1() 26 | # print x, y, z 27 | 28 | def sub3() 29 | print "sub3\n" 30 | sub2() 31 | 32 | print "SUB TEST\n" 33 | sub3() 34 | # print x, y, z 35 | print "END\n" 36 | -------------------------------------------------------------------------------- /Min Language/tests/test4.min: -------------------------------------------------------------------------------- 1 | def test() 2 | print "global inside test():", a, "\n" 3 | a = "slu4" 4 | print "global changed inside test():", a, "\n" 5 | 6 | print "GLOBAL TEST\n" 7 | a = "Hello" 8 | print "global: ", a, "\n" 9 | 10 | test() 11 | print "global:", a, "\n" -------------------------------------------------------------------------------- /Min Language/tests/test5.min: -------------------------------------------------------------------------------- 1 | def square(num) 2 | return num * num 3 | 4 | x=1 5 | while x <= 256 6 | print x, ":", square(x), " " 7 | x=x+1 8 | -------------------------------------------------------------------------------- /Min Language/tests/test6.min: -------------------------------------------------------------------------------- 1 | def test() 2 | print "a=", a, "\n" 3 | # print b # should produce an error 4 | 5 | print "LOCAL TEST\n" 6 | a = 10 # global variable 7 | 8 | if 1>0 9 | b = 20 # local variable inside 'if' 10 | test() 11 | if 1>0 12 | c = 5 13 | print "b=", b, "\n" 14 | print "c=", c, "\n" 15 | print "b=", b, "\n" 16 | 17 | # print b # should produce an error 18 | print "END\n" 19 | -------------------------------------------------------------------------------- /Min Language/tests/test7.min: -------------------------------------------------------------------------------- 1 | def print_demo() # demonstrating the print statement and mathmatical terms 2 | print "\# MATH DEMO (10+20)*3 + 1 = ", (10+20)*3 + 1, "\n" 3 | 4 | def whiledemo() # demonstrating the while, break and if statements 5 | print "\# WHILE DEMO\n" 6 | a=0 7 | while a<20 8 | if not a<10 break 9 | print "a=", a, "" 10 | b=0 11 | while b<((2+3)*a) print "." b=b+1 12 | if a<5 print "a<5\n" 13 | else print "a>=5\n" 14 | a=a+1 15 | 16 | def logicdemo() 17 | print "\# LOGIC DEMO " 18 | if 0 or 0>-1 or 0 or 0 print "True! " 19 | else print "False! " 20 | if 1 and 1 and 1 and 1 print "True!\n" 21 | else print "False!\n" 22 | 23 | def inputdemo() 24 | print "\# INPUT DEMO " 25 | while 1 26 | print "Type in a number > 0 " 27 | i = input() 28 | num = int(i) 29 | if num > 0 30 | a = 0 31 | while a Sets the program counter to . Example: ESCp0800 sets the PC to 0x0800 17 | ESC r Resets the 8-Bit CPU 18 | ESC l Assembles the text file and uploads the corresponding machine code to RAM 19 | ESC 0 Halts the clock 20 | ESC 1 Sets clock speed to 10Hz 21 | ESC 2 Sets clock speed to 100Hz 22 | ESC 3 Sets clock speed to 1kHz 23 | ESC 4 Sets clock speed to 10kHz 24 | ESC 5 Sets clock speed to 100kHZ 25 | ESC 6 Sets clock speed to 1MHz 26 | ESC s Performs a single clock cycle 27 | ESC h Performs a half single clock cycle 28 | ESC x Executes instruction until next 'II' control signal (fetch) is hit 29 | ESC i Reads in the content of file as direct keyboard/Datasette input 30 | ESC # Writes the specified hex data into RAM starting at PC (ESC#cafe writes 0xca 0xfe) 31 | Ctrl+V Pastes clipboard as 'keyboard input' into the emulator. You can copy the output of the 32 | stand-alone assembler asm.exe and paste it like this. 33 | 34 | 2) Loading, assembling and running the example program 'chars.txt' 35 | ------------------------------------------------------------------ 36 | - Launch the emulator 37 | - type ESC l chars.txt ENTER 38 | - type ESC 2 39 | - Press F1 to see the program in memory and the blinkenlights control signals. 40 | Change the clock speed to your liking. 41 | 42 | 3) Some Assembler syntax (also take a look at the example programs) 43 | ------------------------------------------------------------------- 44 | *=$xxxx sets the program counter address to hex address xxxx 45 | label: defines a label 46 | JPA label uses that label 47 | $xxxx 16-bit hex word 48 | $xx 8-bit hex byte 49 | 123 8-bit dec byte 50 | 'a' equivalent to 65 or $41 51 | "hello" defines a byte string in memory 52 | 1, 2, 3 defines a byte string in memory 53 |