A project to implement a console using the Mbed using VGA for video output and a PS/2 keyboard for the input. The eventual goal is to also include tools for managing SD cards, and a semi-self-hosting programming environment.
Dependencies: PS2_MbedConsole fastlib SDFileSystem vga640x480g_mbedconsole lightvm mbed
MbedConsole is a cool little project to have a self-contained computer all on an Mbed. So far it has VGA and PS/2 support and can stand alone without a computer powering it. Next planned features are SD card support and a lightweight programmable VM complete with a file editor and self-hosted assembler.
You can view additional details about it at http://earlz.net/tags/mbedconsole
documentation.c@16:370b9e559f92, 2012-09-30 (annotated)
- Committer:
- earlz
- Date:
- Sun Sep 30 16:48:41 2012 +0000
- Revision:
- 16:370b9e559f92
- Parent:
- 5:367397a82ddc
Added BSD license notice
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
earlz | 16:370b9e559f92 | 1 | /* |
earlz | 16:370b9e559f92 | 2 | <Copyright Header> |
earlz | 16:370b9e559f92 | 3 | Copyright (c) 2012 Jordan "Earlz" Earls <http://lastyearswishes.com> |
earlz | 16:370b9e559f92 | 4 | All rights reserved. |
earlz | 16:370b9e559f92 | 5 | |
earlz | 16:370b9e559f92 | 6 | Redistribution and use in source and binary forms, with or without |
earlz | 16:370b9e559f92 | 7 | modification, are permitted provided that the following conditions |
earlz | 16:370b9e559f92 | 8 | are met: |
earlz | 16:370b9e559f92 | 9 | |
earlz | 16:370b9e559f92 | 10 | 1. Redistributions of source code must retain the above copyright |
earlz | 16:370b9e559f92 | 11 | notice, this list of conditions and the following disclaimer. |
earlz | 16:370b9e559f92 | 12 | 2. Redistributions in binary form must reproduce the above copyright |
earlz | 16:370b9e559f92 | 13 | notice, this list of conditions and the following disclaimer in the |
earlz | 16:370b9e559f92 | 14 | documentation and/or other materials provided with the distribution. |
earlz | 16:370b9e559f92 | 15 | 3. The name of the author may not be used to endorse or promote products |
earlz | 16:370b9e559f92 | 16 | derived from this software without specific prior written permission. |
earlz | 16:370b9e559f92 | 17 | |
earlz | 16:370b9e559f92 | 18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
earlz | 16:370b9e559f92 | 19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
earlz | 16:370b9e559f92 | 20 | AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
earlz | 16:370b9e559f92 | 21 | THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
earlz | 16:370b9e559f92 | 22 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
earlz | 16:370b9e559f92 | 23 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
earlz | 16:370b9e559f92 | 24 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
earlz | 16:370b9e559f92 | 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
earlz | 16:370b9e559f92 | 26 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
earlz | 16:370b9e559f92 | 27 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
earlz | 16:370b9e559f92 | 28 | |
earlz | 16:370b9e559f92 | 29 | This file is part of the MbedConsole project |
earlz | 16:370b9e559f92 | 30 | */ |
earlz | 16:370b9e559f92 | 31 | |
earlz | 5:367397a82ddc | 32 | /** This is just a documentation thing. There is no code here! |
earlz | 5:367397a82ddc | 33 | This is like this because mbed's online compiler doesn't like regular textfiles apparently. |
earlz | 5:367397a82ddc | 34 | |
earlz | 5:367397a82ddc | 35 | Built in word list: |
earlz | 5:367397a82ddc | 36 | * |
earlz | 5:367397a82ddc | 37 | + |
earlz | 5:367397a82ddc | 38 | - |
earlz | 5:367397a82ddc | 39 | / |
earlz | 5:367397a82ddc | 40 | ` -- >0 |
earlz | 5:367397a82ddc | 41 | ! -- (value address) *address <- value |
earlz | 5:367397a82ddc | 42 | ? -- (address) push *address |
earlz | 5:367397a82ddc | 43 | = -- (val1, val2) push val1==val2 |
earlz | 5:367397a82ddc | 44 | |
earlz | 5:367397a82ddc | 45 | |
earlz | 5:367397a82ddc | 46 | Variables are implemented basically as constants.. sorta |
earlz | 5:367397a82ddc | 47 | Variable FOO |
earlz | 5:367397a82ddc | 48 | makes variable foo |
earlz | 5:367397a82ddc | 49 | 10 FOO !; \in reality, FOO is just a constant to a place in memory. |
earlz | 5:367397a82ddc | 50 | FOO ? |
earlz | 5:367397a82ddc | 51 | |
earlz | 5:367397a82ddc | 52 | In this way, everything stays stack based and easy to implement, but there are still variables. |
earlz | 5:367397a82ddc | 53 | |
earlz | 5:367397a82ddc | 54 | |
earlz | 5:367397a82ddc | 55 | |
earlz | 5:367397a82ddc | 56 | **/ |