Lego RCX Assembler and a Case Study Luis Paris Dept. of Computer Science University of Mississippi.

Slides:



Advertisements
Similar presentations
1chung 5 th Annual Robofest 2004 Informational Meeting Mar. 20, 2004 Chan Jin Chung Ali Khazaal Jason Lo Computer Science Lawrence Technological University.
Advertisements

Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
Lab6 – Debug Assembly Language Lab
Computer Basics. The Computer (Generic) Processor executes commands. Memory stores program and data. Input devices transfer information from outside world.
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Alternative Programming Languages Myles McNally LMICSE Workshop November , 2004 University of Mississippi.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
OGEL: LEGO Mindstorm Controller Language Michael Ching Gerardo Flores Matt Kalish Charles O’Donnell May 13, 2003.
The Analytical Engine Module 6 Program Translation.
Introduction to Lego Mindstorms LMICSE Workshop June , 2005 Alma College.
Lego.Net Bernhard Rabe. Fischertechnik.NET ? Bernhard Rabe.
Programming Languages Structure
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
WEB-BASED LEARNING TOOLS ON MICROPROCESSOR FUNDAMENTALS FOR A FIRST-YEAR ENGINEERING COURSE By Jucain Butler.
The Lego RCX is a programmable digital device equipped with sensor inputs and motor outputs. As part of the Lego Mindstorms package, it is intended for.
LEGO Mindstorms Hitachi H8-based RCX brick B.A. Juliano, R.S. Renner, F. Jauregui January 2004 California State University, Chico Intelligent Systems Laboratory.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Word Processing, Web Browsing, File Access, etc. Windows Operating System (Kernel) Window (GUI) Platform Dependent Code Virtual Memory “Swap” Block Data.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
JR3PCI by J. Norberto Pires Installation Example.
Programming a computer. What does programming a computer mean ? Programming a computer: Since a computer can only execute machine instructions (encoded.
Lego Mindstorms NXT 2.0 Presented By: Fatma Al-Qattan Haya Al-Hajri Fatma Baqer Hanan Al-Qabandi.
WEB-BASED LEARNING TOOLS ON MICROPROCESSOR FUNDAMENTALS FOR A FIRST-YEAR ENGINEERING COURSE By Jucain Butler.
[Low-level] Programming of NXT Robots Pavel Petrovič Department of Applied Informatics, Faculty of Mathematics, Physics and Informatics
Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012 Nicholas Alteen Evan McKeon Michael Humphries Computer Science Program.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
BIT 1003 – Presentation 7. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
CISC105 General Computer Science Class 1 – 6/5/2006.
CSCI 394© 2007 JW Ryder1 NXC Information  Not eXactly C  very similar to NQC  Currently has more NXT API supported than LeJOS NXJ   Uses.
Introduction to Systems Programming (CS 0449) PalmOS Tools: Developer Studio & Cygwin.
Introduction to C++ Programming Language
Python From the book “Think Python”
Lecture 8 February 29, Topics Questions about Exercise 4, due Thursday? Object Based Programming (Chapter 8) –Basic Principles –Methods –Fields.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
5-1 Chapter 5 - Languages and the Machine Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Development of a microprocessor project with LPC2388 development board.
Software Development Programming & Languages. Programming: A Five-Step Procedure Define the problem Design a solution Code the program Test the program.
How to control LEGO® Mindstorms devices Thomas Mueller thomas _ tmspecial.com.
Minds and Computers 2.1 The RCX l Hitachi H8/3297 series processor l 3 inputs/sensors (1, 2, 3) l 3 outputs/motors (A, B, C) l 32k RAM/ 16k ROM ä 12 kB.
How to Install Eclipse Click hereClick here to download Eclipse.
 Programming - the process of creating computer programs.
Software Toolchains. Instructor: G. Rudolph, Summer Motivation Desktop Programmers typically write code on the same kind of machine on which it.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Using the BlueJ IDE with Mindstorms LMICSE Workshop June , 2005 Alma College.
Chapter 1 An Overview of Computers and Programming Languages.
Copyright © 2005 – Curt Hill MicroProgramming Programming at a different level.
Software Toolchains. Motivation 2 Write Run Edit, compile, link, run, debug same platform Desktop Write Run Edit, compile, link, debug on host; run on.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.
Embedded C- Language Lets Learn fundamentals !!. An Embedded system is combination of computer hardware and software, and perhaps additional mechanical.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
機器人教學成長社群 2014/10/1 Lego EV3 Compatible Software.
Spring 2008 Mark Fontenot CSE Honors Principles of Computer Science I Note Set 11.
T.R.I.D.E Simon Overell (seo01) Supervisor: Keith Clark.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Lets Learn fundamentals !!
Downloading Arduino FOR WINDOWS.
Computational Thinking, Problem-solving and Programming: General Principals IB Computer Science.
Java on the LEGO Mindstorms EV3
Mobile Development Workshop
National Diploma in Computer Studies
4 – History of Programming Languages
CSC 142 Introduction to Java [Reading: chapters 1 & 2]
Glossary NXT-G – the graphical thing for wimps
Getting the software Install Fantom driver
LEGO Mindstorms Robot and Java
Presentation transcript:

Lego RCX Assembler and a Case Study Luis Paris Dept. of Computer Science University of Mississippi

Supported Languages/Firmwares Java C, C++, Pascal Forth MindScript, NQC, Lego ASM TinyVM, leJOS brickOS pbForth Standard Lego RCX LanguageFirmware

RCX Internals Hitachi H8 microcontroller  On-chip 16K ROM  External 32K RAM I/O devices  Three motor ports  Three sensor ports  IR communications port

RCX Virtual Machine Implemented by the Lego RCX firmware Virtual Machine CharacteristicsCharacteristics Byte Code Interpreter Sources and values Byte Code Command Set

Case Study: Lego RCX Assembler Motivation  Project for CSCI-450 Programming Languages  Lego Assembler hides output object file Result: Byte code nor object format can’t be studied  Does not support definition listdefinition list Result: Programs hard to read and maintain Project: Create a Lego RCX AssemblerLego RCX Assembler  More robust  Runs standalone

Solution Strategy Two stages:  Lexical/Syntax analysis (Parsing) Finite State Machine Library functions (scanf, string.tokenizer)  Code generation (one-to-one) No one-to-many semantic analysis (as in compilers) Mnemonic to Opcode conversion Parameters to Byte Code conversion

Which language C/C++ or Java? Java is a powerful OOP language but… not really suitable for system programming  No bit-fields support  No operator overloading Both C/C++ support bit-fields However, C++ has unnecessary, confusing features (multiple inheritance)

Bit-fields After parsing ASM command “out 6, 23”: Variables contain: instr = “out”; param1 = 6; param2 = 23 Problem: encode “out param1, param2” into above data structure C/C++ can declare P1 and P2 as bit-fields as follows: Java can NOT declare bit-fields so it must merge P1 and P2: Therefore, Java programmer must perform bit shifting and masking operations; whereas the C/C++ compiler does it for us. then do:

Part 2: A Lego RCX pathfinder in Assembler using ScriptEd

PreLab Instructions Part 1: Click Start  Run Type \\luis\lego\\\luis\lego\ Move “workshop” folder to your “desktop” Close \\luis\lego\ folder\\luis\lego\ Part 2: Open “workshop” folder in your desktop Install “LEGOMindstormsSDK25.exe” Install “bricxcc_setup_3377.exe” (if not installed) Download Lego RCX Firmware (if not installed)

Open the ScriptEd application Click Start  LEGO Software All Programs  MindStorms SDK  Tools  ScriptEd On the ScriptEd application, Click Open  Port Select your Tower Port (COM1, or USB1) On the toolbar select LASM (2 nd combo box)

Download “pathfind.asm” file to RCX Part 1: On the ScriptEd application, Click File  Open Browse to “workshop” folder In File name, type *.asm (instead of *.rcx2) Select “pathfind.asm” and open it Part 2: Click on Script  Download Test your RCX

Part 3: A Lego RCX pathfinder in NQC using BricxCC

Open the BricxCC application Click Start  All Programs  Bricx Command Center  Bricx Command Center On the “Searching for the Brick” window, Select your Tower Port (COM1, or USB1)

Compile & Download “pathfind.nqc” Part 1: On the BricxCC application, Click File  Open Browse to “workshop” folder Select “pathfind.nqc” and open it Part 2: Click on Compile  Download Test your RCX

References The Bricx Command Center (BricxCC) The Lego Mindstorms SDK 2.5 (ScriptEd) unity/resources/ unity/resources/