🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #18738

Re: LightSpeedC and assembler

#18738
From: Andrew Singer
Date: Fri, 04 Sep 1987 12:42
29 lines
1594 bytes
In article <3770004@hpvcla.HP.COM> stevem@hpvcla.HP.COM (Steve Miller) writes:
>I'm not familiar with in-line assembly so I am curious:  Does the programmer
>know what registers have what values (epsecially when using register 
>variables) or does the programmer just save all registers that are to be
>used by the assembly code and restore them at the end?
>
>Steven Miller

I'll give you a quick example:

foo()
  {
    register char *p;

    asm {
      move.b (p)+, d0
    }
  }

Here, p would be assigned to an address register, the entry code to foo will
save the contents of that register, and the exit code will restore the
register. Note that this has nothing to do with inline assembler. This is
the way LSC normally works. What's unique about LSC's inline assembler here
is that, being integrated into the compiler, it knows that p is a register
variable and you can use p in any assembler context where a register name
is required.

   Jon Hueras
   THINK Technologies, Inc.
Technical Details
Message-ID: <2798@husc6.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!endor!singer
References: <418@aucs.UUCP> <3770004@hpvcla.HP.COM>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!endor!singer
From: singer@endor.harvard.edu (Andrew Singer)
Newsgroups: comp.sys.mac
Subject: Re: LightSpeedC and assembler
Message-ID: <2798@husc6.UUCP>
Date: Fri, 4-Sep-87 08:42:44 EDT
Article-I.D.: husc6.2798
Posted: Fri Sep  4 08:42:44 1987
Date-Received: Sat, 5-Sep-87 17:07:03 EDT
References: <418@aucs.UUCP> <3770004@hpvcla.HP.COM>
Sender: news@husc6.UUCP
Reply-To: singer@endor.UUCP (Andrew Singer)
Organization: Aiken Computation Lab Harvard, Cambridge, MA
Lines: 29