Welcome, Guest. Please login or register.

Author Topic: getreg() SASC function under GCC ...  (Read 2005 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline CodeSmith

  • Sr. Member
  • ****
  • Join Date: Sep 2002
  • Posts: 499
    • Show all replies
Re: getreg() SASC function under GCC ...
« on: September 25, 2003, 06:44:28 PM »
I haven't used 68K gcc in a while, but I think this should work (I used a similar trick in x86 a while back):

extern inline unsigned long get_d1()
{
  unsigned long retval asm("d1");

  return retval;
}

int main()
{
  printf("the value of D1 is %ld\n",get_d1());

  return 0;
}