|    |  
      In lugnet.robotics.rcx.legos, Michael Purvis wrote: 
> In lugnet.robotics.rcx.legos, Iain McInnes wrote: 
> > 1) Pass the variable to a function - the first function argument seems to be r0. 
>  
> I need to access elements of a 2d array. I don't think this is an option for 
> that. Nevertheless, could you post code that demonstrates this? 
>  
> > You can easily experiment with this by inspecting the assembler output from gcc. 
>  
> How do I do that? 
>  
> > 2) Figure out the assembler idiom for referring to symbols and use that. 
>  
> ??? 
>  
> > 3) I spent a bit of time surfing around the existing code, and there seems to be 
> > an assembler macro idiom where variables can be pasted directly into the 
> > assembler.  I was too lazy to find the documentation on how to use it, but 
> > someone might post here to tell you ;) 
>  
> Hmm... this sounds more like what I'm trying to do. Someone? 
 
Hi Mike, 
 
Check out the source for memcpy.c in the C library. It's not immediately clear, 
but the directives at the end of the __asm__ section beginning with "r" 
associate the %n macros with the given variables. I'm not sure of the exact 
syntax of these, it appears the 3 lines may be necessary, I never really 
experimented with it. 
 
http://cvs.sourceforge.net/viewcvs.py/*checkout*/brickos/brickos/lib/c/memcpy.c?content-type=text%2Fplain&rev=1.2 
 
HTH 
 
ROSCO 
 |  
       |  
           
   
        Message is in Reply To:
             |    | Re: BrickOS Assembler
  |  
  |  (...) I need to access elements of a 2d array. I don't think this is an option for that. Nevertheless, could you post code that demonstrates this? (...) How do I do that? (...) ??? (...) Hmm... this sounds more like what I'm trying to do. Someone? (...)   (22 years ago, 18-Jan-04, to lugnet.robotics.rcx.legos)   
   |         
      11 Messages in This Thread:         
     
     
              
 
      - Entire Thread on One Page:
      
        
- Nested: 
        All | Brief | Compact | Dots
        
 Linear: 
        All | Brief | Compact
           
         | 
        
  | 
      
 
   | 
           |