SPARC Assembly/Synthetic Instructions

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Synthetic Instructions[edit | edit source]

The SPARC Instruction set leaves out a number of conveniences that programmers have grown accustomed to. To fill in these gaps, SPARC assemblers implement a set of Synthetic Instructions. These Synthetic Instructions use the existing SPARC instructions to perform additional tasks. Some of these Synthetic Instructions have already been listed in the sections about the instructions, but for completeness, we are going to list the operations that are Synthetic Instructions here.

  • cmp %r1, %r2 = subcc %r1, %r2, %g0
  • jmp
  • tst
  • call
  • ret
  • retl
  • set
  • not %r1 = xnor %r1, %g0, %r1
  • neg
  • inc
  • inccc
  • dec
  • deccc
  • btst
  • bset
  • bclr
  • btog
  • clr
  • clrb
  • clrh
  • mov

These operations, strictly speaking, are not part of SPARC Assembly, but are instead provided as macros to ease the task of programming. This chapter will (hopefully) address specifically how each of these instructions are implemented.