Code Monkey home page Code Monkey logo

geekstakulus / turbo-modula-2-reloaded Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oric4ever/turbo-modula-2-reloaded

0.0 0.0 0.0 1.55 MB

This is a Modula-2 system (operating system + compiler + editor) for tiny microcomputers with 64 KB ram : it has a 16-bit address space. Despite being issued from a reverse-engineering of Borland Turbo Modula-2 for CP/M, it has been re-engineered to be run on any platform, provided that the bytecode interpreter is ported to that platform.

C 17.64% Makefile 0.04% AMPL 0.28% Modula-2 82.04%

turbo-modula-2-reloaded's Introduction

Turbo-Modula-2-Reloaded

This is a Modula-2 system (operating system + compiler + editor) for tiny microcomputers with 64 KB ram : it has a 16-bit address space.

Despite being issued from a reverse-engineering of Borland Turbo Modula-2 for CP/M, it has been re-engineered to be run on any platform, provided that the bytecode interpreter is ported to that platform. So, the system runs in a virtual machine running MCode, and this virtual machine is available on several real hardware: the main target currently is an 8-bit AVR with external ram memory (ATmega162, see V-M8 microcomputer), but the system can also be run on nearly every modern platform (eg. Linux) thanks to a virtual machine written in standard C.

The Modula-2 system gets rid of its CP/M roots thanks to the introduction of a FAT32 filesystem, support of UTF-8 encoding and extended ANSI/Xterm terminal. As such, it becomes a pedagogical human-size system that people can understand in depth.

TRY IT:

  1. Download the virtual machine for Linux and compile it (make). It should work without modification on Linux, Android (in Termux), Windows (with Cygwin).

  2. Download the m2.dsk in the same directory as the virtual machine interpreters, it is an image of a FAT32 filesystem with Turbo Modula-2 Reloaded pre-installed in it. You can check the contents of this image:

  • file m2.dsk reveals it has 128 reserved sectors (the system image is installed in the reserved sectors), apart from this it is a normal FAT32 filesystem.
  • you can access the contents with the mtools on Linux, or mount this disk image (e.g sudo mount -o loop m2.dsk /mnt). For convenience, this repository has all the files of this disk.
  1. Start the virtual machine, telling it to boot on the disk image: ./m2_disk m2.dsk

  2. Try some examples:

  • dir
  • cd examples
  • dir
  • cd rushhour
  • rushhour <level.001 (NB: this is a RushHour puzzle solver written in Modula-2, it will surely be way too fast on your PC, so let's complicate things with the following)
  • cd ..
  • cd interp
  • mcode rushhour (mcode is a Modula-2 bytecode interpreter written in Modula-2, so you are running the rushhour solver's bytecode in an interpreter that is itself interpreted by the virtual machine)
  • cd ..
  • e hello.mod (time to write your own helloworld program: answer Y to create a new file, and type the following before saving and exiting with F10 : MODULE Hello; BEGIN WRITELN("Hello world!") END Hello.
  • c hello.mod
  • hello

or have a look at a small demonstration video: https://youtu.be/2DDvGZ8hrq8

STATUS: This is not the publicly released version yet, it lacks documentation and I intend to deliver a new shell with the spirit of Midnight Commander. It's not finished also because there are a few modules from the original Turbo Modula-2 that I haven't decompiled yet (it's a lengthy manual process), and I would like to give all modules in source form so that people can change or recompile them. However it's already fully functional, I am currently enjoying solving the Advent of Code puzzles with it. LONGREAL support has just been added in the VM for Linux (not in the AVR version though), so only IOTRANSFER is unimplemented now.

turbo-modula-2-reloaded's People

Contributors

oric4ever avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.