To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 1674
1673  |  1675
Subject: 
Re: Pattern in RCX opcodes.
Newsgroups: 
lugnet.robotics
Date: 
Sun, 20 Dec 1998 21:04:21 GMT
Viewed: 
1245 times
  
Vadim Strizhevsky <lego-robotics@crynwr.com> wrote:
Did anyone notice that the last hex digit of the RCX opcodes uniquely (well
almost) identifies number of bytes that the opcode takes as arguments?

0,6  ->  void
1,7  ->  1 byte
2    ->  2 bytes.
3    ->  3 bytes.
4    ->  4 bytes.
5    ->  5 bytes

I think the only exceptions are 0x95 and 0x45, but I might have missed
something.

This is probably from the ream of neat-but-useless information, but being a
number theory fan I couldn't help but notice it. It definately looks "by
design", so I wonder if this is somehow used in firmware or ROM?

This is certainly used by the ROM.

I believe Paul Haas was the first to notice this, see the comment on my web
page, http://graphics.stanford.edu/~kekoa/rcx/#Rom:

Other notes
   Paul Haas was right about messages being grouped and parsed by lower 3 bits

And lower, in the RXI handler:

   receive length remaining (efc0) = current receive byte (efc1) & 07
   if (receive length remaining (efc0) > 5)
      receive length remaining (efc0) -= 6

Good eyes, though.

0x45 is a special case, it is handled explicitly by the RXI code.

0x95 is never sent over the network, and is a hack.  It, along with 0x85
test and branch near, is parsed as 5 bytes:

byte opsrc1
byte src2
short arg1
byte art2

Then the byte or short offset that follows is special cased in the code at
9c90.  Specifically, the code looks at the program counter to find the
offset, if needed, and adjusts the program counter according to whether or
not the branch is taken.

-Kekoa



Message is in Reply To:
  Pattern in RCX opcodes.
 
Did anyone notice that the last hex digit of the RCX opcodes uniquely (well almost) identifies number of bytes that the opcode takes as arguments? 0,6 -> void 1,7 -> 1 byte 2 -> 2 bytes. 3 -> 3 bytes. 4 -> 4 bytes. 5 -> 5 bytes I think the only (...) (26 years ago, 20-Dec-98, to lugnet.robotics)

2 Messages in This Thread:

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

Custom Search

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