Recent

Author Topic: add Assembler instructions  (Read 537 times)

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
add Assembler instructions
« on: July 28, 2024, 06:32:49 pm »
The PS1 has a coprocessor 2, it has extra instructions. The SDK tells me:

Code: C  [Select][+][-]
  1. #define gte_ldv0( r0 ) __asm__ volatile (                       \
  2.         "lwc2   $0, 0( %0 );"                                   \
  3.         "lwc2   $1, 4( %0 )"                                    \
  4.         :                                                       \
  5.         : "r"( r0 ) )
  6.  

a) I'm not shure how to translate this
     the first operand is a register, the second is the parameter r0


b)
 1)
I added
Code: Pascal  [Select][+][-]
  1. A_LWC2
to ./compiler/mips/opcode.inc
and
Code: Pascal  [Select][+][-]
  1. 'lwc2'
to ./compiler/mips/strinst.inc

now he recodnizes the Instruction, is it enough? Pls help me with a) because I don't knew how to do the operands the right way and when we will see if the instruction has the correct implementation
« Last Edit: July 28, 2024, 06:41:38 pm by Key-Real »

 

TinyPortal © 2005-2018