Operating System - HP-UX
1752555 Members
4767 Online
108788 Solutions
New Discussion юеВ

Re: Problem with Label in Assembly language

 
Sacha Hnatiuk
Occasional Contributor

Problem with Label in Assembly language

I wrote a very long assembly code that is call by c procedure and go after to another c procedure. Inside, there is a lot of call to an internal label and after there is only one call to the external label.

When i make the project, i need to use directly in my makefile cc instead of aCC that's calling ansic cc who doesn't exist on my hp server. I must use ansic because the linker need an object file compiling with +z or +Z option; but my cc doesn't support this options...

To correct the problem, i change all call routine to a very, very,very long method to call that recalculates the space.

But one problem exist always: in my first method, i want to jump in my assembly code at an address+offset: the address is the start of a list of fixed routine length and the offset is a multiple of this routine. When i jump to the first label, it's ok, when i jump to another, the mecanism between my c procedure and my assembly code crash.

Anybody have an idea to correct this problem?
2 REPLIES 2
Rainer_1
Honored Contributor

Re: Problem with Label in Assembly language

i have no solution for your current problem but to have an ansi cc compiler you could download and install gnu compiler

http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-2.95.2/
http://hpux.cs.utah.edu/hppd/hpux/Gnu/binutils-2.9.1/
Andy Bennett
Valued Contributor

Re: Problem with Label in Assembly language

It isn't very clear from your description what isn't working. You indicate that the mechanism between C procedure and your assembly code is crashing in some way. It may be that your assembly code is not correctly setting every register it needs to; particularly if shared shared-library calls are involved there are extra considerations. If you haven't already, it would be worth your looking at the "32-bit PA-RISC Run-Time Architecture" documents available at http://devresource.hp.com -> "document library" -> "architecture" (in the "references and manuals" section). In particular the "Conventions for Calling Procedures" may help, if that is what is failing.