[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 519
  • Last Modified:

Porting GNU Assembler RISC Question

I'm trying to write an assembler function, but first I need to understand how this works.  For example

CSEM RS                  0  0  0  0  0      RS      1   1  1   1  0   0 0 1

RS may be any of the 7 general purpose registers but how can their address only be 3 bits long?

Table summarizes all XGATE instructions in the order of their machine coding.
                          Table 4-2 Instruction Set Summary
          Functionality             15 14 13 12 11 10    9  8   7   6  5   4  3   2 1 0
Return to Scheduler and others
              BRK                    0  0  0  0  0   0   0  0   0   0  0   0  0   0 0 0
              NOP                    0  0  0  0  0   0   0  1   0   0  0   0  0   0 0 0
              RTS                    0  0  0  0  0   0   1  0   0   0  0   0  0   0 0 0
               SIF                   0  0  0  0  0   0   1  1   0   0  0   0  0   0 0 0
   Semaphore Instructions
          CSEM IMM3                  0  0  0  0  0     IMM3     1   1  1   1  0   0 0 0
            CSEM RS                  0  0  0  0  0      RS      1   1  1   1  0   0 0 1
           SSEM IMM3                 0  0  0  0  0     IMM3     1   1  1   1  0   0 1 0
            SSEM RS                  0  0  0  0  0      RS      1   1  1   1  0   0 1 1
 Single Register Instructions
         ......................................
0
sean-keys
Asked:
sean-keys
  • 3
  • 3
1 Solution
 
shajithchandranCommented:
i am not sure if i understood your question properly.

>>RS may be any of the 7 general purpose registers  but how can their address only be 3 bits long?
2^3 is 8. That means 3 bits can be used to represent 8 registers.

000 - R0
001 - R1
...
110 - R6

Also in
Semaphore Instructions
          CSEM IMM3                  0  0  0  0  0     IMM3     1   1  1   1  0   0 0 0
            CSEM RS                  0  0  0  0  0      RS      1   1  1   1  0   0 0 1
           SSEM IMM3                 0  0  0  0  0     IMM3     1   1  1   1  0   0 1 0
            SSEM RS                  0  0  0  0  0      RS      1   1  1   1  0   0 1 1

IMM3 is the immediate value ... it can be just 3 bits.
RS is the register. any of the seven
0
 
sean-keysAuthor Commented:
Right, so maybe there is an alias address in the documentation? I thought I looked though....

http://powerefi.com/files/S12XGATEV2.pdf
0
 
shajithchandranCommented:
i think from sections we can conclude that the address for R1 - R7 is 001 tp 111.
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
sean-keysAuthor Commented:
Or is it high to low?
0
 
shajithchandranCommented:
Its low to high : R1 - 001 .... R7 -- 111
http://www.freescale.com/files/soft_dev_tools/doc/ref_manual/CW_Assembler_XGATE_RM.pdf
I  looked at the above doc. and decoded couple of instructions to extract the bits for the register. and is low to high.
0
 
sean-keysAuthor Commented:
I owe you one! Thanks!
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now