NXT Clumps and Shared Functions

Discussion specific to the intelligent brick, sensors, motors, and more.
Post Reply
ruinedtugboat
Posts: 1
Joined: 28 Mar 2014, 10:45

NXT Clumps and Shared Functions

Post by ruinedtugboat »

I'm hoping this is the correct board, it's somewhat related to the intelligent bricks anyway.

I'm writing my own language and compiler which targets NXT robots, and so I've been reading about how the virtual machine works. As I understand it, a program is logically divided into clumps, and these clumps can be executed concurrently. A clump is defined by a start/end address and each clump has its own program counter. I'm also aware that clumps can call other clumps (subroutines), and that the caller needs to obtain a lock before doing so. This raises a few questions:

1. Do all instructions need to be assigned to a clump?
2. Why are subroutines implemented in terms of their own clump? I cannot make sense of this, to me it seems like the subroutine should just run as part of the caller's clump and this would make locking a non-issue.
2. Can I jump a clump's execution outside of its assigned address range? I'm wanting to do this as a way of calling shared functions (which relates to part 1) without any locking.

I'm only starting to look into the NXT execution environment, so I could very well be misunderstanding something. Feel free to correct me.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests