To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3356
3355  |  3357
Subject: 
Re: Programming in Assembly
Newsgroups: 
lugnet.robotics.rcx, lugnet.robotics.rcx.legos
Date: 
Thu, 17 Jul 2003 02:49:44 GMT
Viewed: 
137 times
  
"Aaron Goodman" wrote:

I was able to find the doc here:
http://www.renesas.com/avs/resource/japan/eng/pdf/mpumcu/e602025_h8300.pdf

Yep, but you will also need the User's Manual (at the URL I
mentioned previously) that describes the on chip I/O features
of the H8 if you plan on doing any work with the sensors.

your post about the motor seems helpful, so if I understand right the way • to
run motor A forward would be
"mov 0x030003,r0h
mov 0x80,r0h"
and for the motor C the same except 0x06?
How does the instruction get to the motors? is there a sepearte routine • that
needs to be run to do this or is it taken care of by the ROM?

To turn on motor C forward you would do this:

  mov #0x02,r0h
  mov r0h,@0x80:8

The second instruction writes the value to the motor control
register (described at Kekoa's RCX Internals).  Here's
another example:

  ; A: reverse, B: float, C: forward
  mov #0x42,r0h
  mov r0h,@0x80:8

also I was a little confused by the @ signs in the c code of legos can • someone
explain these to me?

Do you mean in the asm code?  The @ signs are used in
the source or destination operand of an instruction to refer
to a memory location.  I think this is probably covered in
the Programmer's Manual you mentioned above.

When I was looking at the brickOS code for dsensor.h I noticed a command • "beq"
which I coudn't find in the documentation for the chip. What is this?

Look under the instruction group labeled "Bcc" in the Programmer's
Manual.  This is a conditional branch instruction (in this case, branch
if the zero flag is set).

Cheers,

Mark



Message has 1 Reply:
  Re: Programming in Assembly
 
Ok, the motor stuff makes sense, I got a little confused with the shift thing. I looked at the proggamming manual some more and it explaned the @ (Register inderect) but I don't see why it is needed, also in you example you specify the data as (...) (21 years ago, 18-Jul-03, to lugnet.robotics.rcx, lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: Programming in Assembly
 
Cool, thanks I was able to find the doc here: (URL) post about the motor seems helpful, so if I understand right the way to run motor A forward would be "mov 0x030003,r0h mov 0x80,r0h" and for the motor C the same except 0x06? How does the (...) (21 years ago, 17-Jul-03, to lugnet.robotics.rcx, lugnet.robotics.rcx.legos)

9 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR