Difference between revisions of "Calico LC3"

From IPRE Wiki
Jump to: navigation, search
(Special Interactive Directives)
(Overview)
Line 19: Line 19:
 
* Assembler and interpreter
 
* Assembler and interpreter
 
* Counts instructions executed
 
* Counts instructions executed
* Counts machine cycles executed
+
* Counts machine cycles executed, estimates milliseconds to run
 
* Error checking and useful error messages
 
* Error checking and useful error messages
 
* menu -> View -> Tabs -> Locals - shows registers
 
* menu -> View -> Tabs -> Locals - shows registers

Revision as of 20:40, 8 December 2013

Calico LC3 is an assembly language based on the Little Computer by Patt and Patel.

Overview

Calico LC3 is an implementation of Patt and Patel's LC3 assembly language. The language is written in Calico Python, but appears as a full language in Calico.

In Calico, you need to first enable the LC3 language before using it:

  1. start Calico
  2. under menu -> Calico -> Languages
  3. make sure that "LC3" is checked
  4. Create a new LC3 script, or examine one of the Examples

Special features:

  • Tracing, breakpoints, integrated IDE
  • syntax color highlighting
  • Right-click on errors takes you to line of code
  • Assembler and interpreter
  • Counts instructions executed
  • Counts machine cycles executed, estimates milliseconds to run
  • Error checking and useful error messages
  • menu -> View -> Tabs -> Locals - shows registers

Source Materials:

Special Interactive Directives

Enter these commands in the Calico Shell entry area:

Interactive Directives: 
 .help                           - shows this info
 .assemble                       - assemble the first .asm file in Calico
 .step                           - execute the next instruction, increment PC
 .reset                          - reset LC3 to start state") 
 .raw [start [stop]]             - list meory in hex
 .list                           - list program from memory
 .dump [start [stop]]            - dump memory as program
 .regs                           - show registers
 .set pc HEXVALUE                - set PC
 .set memory HEXLOCATION HEXVALUE- set memory
 .set reg VALUE HEXVALUE         - set register
 .get pc                         - get PC
 .get memory HEXLOCATION         - get memory
 .get reg VALUE                  - get register

Examples

Here is a basic Hello World assemble program.

;; helloworld.asm
.ORIG x3000
    LEA R0, HELLO
    PUTS
    HALT
HELLO .STRINGZ "Hello, World!\n"
.END

Future Possibilities

  1. integrate with other languages
  2. create real code that could be executed on computer (maybe .NET/Mono VM code?)
  3. load/run binary-text files and obj files
  4. show dissassembled code
  5. show memory as Calico Spreadsheet