Chris Fenton’s DIY Laptop Page
*note*: I am now employed, but if you have questions feel free to email me at: cfenton (AT) usc.edu
Ever thought to yourself, “Hey, I could probably build my own computer if I really tried.” Or maybe, “Man, I really need a laptop with an embarrassingly low-resolution display, a processor that goes at 256 Instructions/sec, and I’ve only got $50 to spend!” Well, that’s how I got here! It took me about 4 months to complete, with a number of pauses when school and life intervened, but I’m now mostly finished with my first real DIY project.
Specs:
-Processor: PICAXE 18X Microcontroller
-User Memory: 96 Bytes of RAM (with plans to upgrade to 8K later)
-User Program storage: 10 Compiled Programs, 4 editable programs
-Display: 20x4 blue & white, backlit LCD serial character display
-Interface: Full-sized laptop keyboard (12” across)
-On-board software (all written by me, of course!):
· Compiled-Chris++ interpreter (my own language! ~256 Instructions/sec)
· Text Editor with the ability to actively work on 4 different programs at a time
· Chris++ Compiler to convert text files to executable programs
· Program Manager – Launch or delete executable programs
(原文件名:image001.jpg)
(原文件名:image002.jpg)
(原文件名:image003.jpg)
(原文件名:image004.jpg)
(原文件名:image005.jpg)
(原文件名:image006.jpg) For those of you wondering why I used a high-level language like BASIC to, in essence, write an assembly language interpreter, I’ve decided to provide a little background information. This project started out as an attempt to write a single-chip “emulator” for a small processor I had designed to run inside an FPGA (AKA the “Fentium”). The Fentium was designed as a “minimal instruction-set” computer (MISC?), so it initially only had 8 total instructions (the least number possible, as far as I can tell). Hence, “Chris++” was born, as the assembly language for the Fentium processor. That project turned out to be much less ambitious than I had initially thought, and I was able to make a full-fledged, single-chip “Fentium” emulator in only a few hours. At that point, I realized that if I added a couple more instructions it might actually be useful for something. Then I realized I would need a compiler so I could actually write Chris++ in a semi-readable way, and I thought, “hey, why not add in a text editor so I can just do it all on the same chip!” Toss in a file manager, some user-interfaces, a bus protocol to make it expandable . . . You can obviously see where this line of thought brought me.
For now, here is a brief description of Chris++ language that it runs:
========================================================================================================
=================================Chris++ Interpreter==========================================================
========================================================================================================
CMD Hex ASM Length Operand
opload 00 LOD 2-bytes Indirect -> Place (RAM) in accumulator
opadd 01 ADD 2-bytes Indirect -> Add (RAM) to accumulator
opcomp 02 CMP 2-bytes Immediate -> Compare #imm to accumulator, place result in accumulator
opsub 03 SUB 2-bytes Indirect -> Subtract (RAM) from accumulator
opjmp 04 JMP 4-bytes Immediate -> Jump to #Location
opcjmpeq 05 JEQ 4-bytes Immediate -> Gosub to #Location if accumulator = 255
opstor 06 STR 2-bytes Immediate -> Store accumulator in #RAM
oploadimm 07 LDI 2-bytes Immediate -> Load #imm into accumulator
sertoslave 08 SND 4-bytes Immediate -> Send 3 bytes to (current ShortBus ID)
opmult 09 MLT 2-bytes Indirect -> Multiply accumulator by (RAM)
opdiv 0A DIV 2-bytes Indirect -> Divide accumulator by (RAM)
opcjmpnq 0B JNQ 4-bytes Immediate -> Gosub to #Location if accumulator != 255
opgetkey 0C KEY 2-bytes ACC -> Place keyboard input into accumulator
waitforslave 0D GET 2-bytes ACC -> Receive one byte from slave, set SBID to slave value
opsetSBID 0E SSB 2-bytes Immediate -> Set ShortBus ID value to accumulator value
opadc 0F ADC 2-bytes ACC -> Read ADC and place it in accumulator
opgetSBID 10 GSB 2-bytes ACC -> Place ShortBus ID value in accumulator
opdisp 11 DSP 2-bytes ACC -> Send accumulator value to display
opAND 12 AND 2-bytes Immediate -> Logical AND of accumulator and #imm, place in ACC
opOR 13 ORX 2-bytes Immediate -> Logical OR of accumulator and #imm, place in ACC
opXOR 14 XOR 2-bytes Immediate -> Logical XOR of accumulator and #imm, place in ACC
opANDNOT 15 ADT 2-bytes Immediate -> Logical ANDNOT of accumulator and #imm, place in ACC
opORNOT 16 ONT 2-bytes Immediate -> Logical ORNOT of accumulator and #imm, place in ACC
opXNOR 17 XNR 2-bytes Immediate -> Logical XNOR of accumulator and #imm, place in ACC
opEnd 18 END 2-bytes Immediate -> End Program and return to main menu
opRTN 19 RTN 2-bytes Immediate -> Return to location after last Gosub
===========================================================================================================
The code and a slightly better explanation of Chris++ has been posted! The beautiful wood-working was all done using 3/16” bass wood acquired from my university bookstore, and lovingly assembled using epoxy and my shiny new dremel (thanks Dad!).
原贴:http://www-scf.usc.edu/~cfenton/laptop.htm
jizzll_617398179 2008-8-21 13:16