Sponsored Content
Full Discussion: c calling conventions
Top Forums Programming c calling conventions Post 302432044 by jim mcnamara on Wednesday 23rd of June 2010 04:17:37 PM
Old 06-23-2010
only when you are porting C code between windows (x86) and unix
This User Gave Thanks to jim mcnamara For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling a script from another

Hi, I have 2 scripts, one is the .profile and the other is a SID selector for Oracle Databases. But when I call one from the other, even though it seems to have worked, it doesn't. Can anyone help?? ******************* .profile********************** #!/bin/ksh .... (5 Replies)
Discussion started by: dnkansah
5 Replies

2. Shell Programming and Scripting

Get Calling File

OK, I'm very new to shell scripting, and I'm trying to write a (very) simple wrapper for sendmail that outputs all the arguments as well as the file that called sendmail to an output file which can later be looked over. Is it possible to get a file's name and path that called a script? (0 Replies)
Discussion started by: ghstber
0 Replies

3. UNIX for Advanced & Expert Users

Naming conventions for shared libraries in Linux

Hello, I'm wondering what is the naming conventions for *.so shared libraries in linux. For example, a library in /lib, say libcrypt-2.7.so has a symbolic link called libcrypt.so.1 pointing to it, yet libncursesw.so.5.6 has a symbolic link called libncursesw.so.5 pointing to it. What is the... (2 Replies)
Discussion started by: neked
2 Replies

4. Solaris

A query on Disk naming conventions in Solaris.

These are findings by me with my little experience with Solaris 10. Please correct me if wrong.. In x86 systems with ide hard disk: c= controller d=disk s=slice 1.Here controller c0 means the primary ide controller ide0. controller c1 means the secondary ide controller ide1. ... (5 Replies)
Discussion started by: saagar
5 Replies

5. UNIX for Dummies Questions & Answers

CSS coding conventions checker

I would like to use an automated checker for adherence to CSS coding conventions. I have browsed the web, but no tool I came across checks for coding conventions, only syntax. Here is a general list of requirements: - Style definitions should be separated by one blank line - Indentation is 2... (0 Replies)
Discussion started by: figaro
0 Replies

6. UNIX for Dummies Questions & Answers

question about man font conventions

i was viewing the gawk's man file,checked the man faqs,didnt find anything about the char "e" meaning .TP .B \e` matches the empty string at the beginning of a buffer (string). .TP .B \e' matches the empty string at the end of a buffer.after convention,it should looks like thie \` ... (2 Replies)
Discussion started by: b33713
2 Replies

7. UNIX for Dummies Questions & Answers

Typographic conventions in bash 4.2

is there a typographic convention that is followed in the man pages. where could a description be found. at this time i am in man stty and the author uses upper case in some places. and my brain is just burning to a fizzle while studying a book on bash and trying to stay in scope of the... (1 Reply)
Discussion started by: cowLips
1 Replies

8. Shell Programming and Scripting

How does calling it .sh help?

Hi. I have been running some scripts ok with no extension on the name, and they work fine. What difference does it make if I call them whatever.sh? And I have some scripts starting #!/bin/bash - which debian recognises as shell scritps, even without the .sh ending - and some which don't. I'm sure... (8 Replies)
Discussion started by: triplemaya
8 Replies

9. Cybersecurity

Proper naming conventions

Hey guys, not sure should I post it here or in 'What is on Your Mind?' I'm discussing usage of DSL (domain specific language) in security tools with my colleagues. We haven't been able to reach an agreement over naming conventions. There are many tools using DSL: splunk, sumologic,... (2 Replies)
Discussion started by: Tobby P
2 Replies

10. Linux

UNIX Utility Development Conventions?

I'm slowly hacking away at a zsh script that shows some promise as a command line tool. I want to learn more about the conventions regarding command line tool development in Unix (and/or macOS), but don't really know where to look for this information. What is the correct way, or convention, to... (2 Replies)
Discussion started by: MonilGomes
2 Replies
STACK(5)							File Formats Manual							  STACK(5)

NAME
stack - 2.10BSD PDP-11 C stack frame conventions DESCRIPTION
The standard C stack frame layout: ------------------ |...nth argument | push arguments in reverse order ------------------ |second argument | ------------------ | first argument | ------------------ JSR PC,*$_FOO | return address | ------------------ JSR R5,CSV | old R5 value | <----- ------------------ | |previous overlay| | | number | | ------------------ | | r4 | | ------------------ | | r3 | | ------------------ | | r2 | | ------------------ | | first local var| | This is the top of the stack ------------------ | when the called routine ``starts'' | routine | | | allocates | | | storage | | SUB $n,SP | temporary | | ------------------ | | push arguments | | | of next routine| | ------------------ | JSR PC,*$_BAR | return address | | ------------------ | JSR R5,CSV | old R5 value---+------- ------------------ ^ |previous overlay| | | number | | ------------------ | | r4/43/r2/... | | ------------------ | and so on..... | The stack pushes downward through memory addresses. Overlay numbers saved in non-overlaid objects are always zero, but the simplification of not having to maintain two different stack frame formats more than outweighs the extra few micro seconds (less than four) necessary to save the zero ... Functions returning integers leave their return value in R0; functions returning floating constants use FR0; functions returning longs leave return values in R1/R0 (R0 high word, R1 low); functions returning structures leave a pointer to bss storage (one chunk of which is allocated for each such routine) in R0, and the caller will copy from that bss storage to the local destination. Local variables are allocated in such a way that they are referred to as ``-N(R5)'', arguments are referred to as ``+N(R5)''; arguments start at 4(R5), the first integer local declared will be at -10(R5). The SP normally points at the first word available for parameter pushing. A function taking only single word as a parameter can be called simply by moving the parameter into (SP) and calling the function, without having to clean the parameter off the stack on return. Any parameters passed after the first (actually "Nth") must be pushed before the call and cleaned off afterwards. If the function has no local variables and calls no functions, it will allocate no stack and the word labelled ``first local var'' will be unused. It is important to note that routines know how many arguments they pass to a function, and will adjust the stack accordingly after a func- tion returns. NOTE
This stack frame format is the same as that used by overlaid objects in 2.9BSD. AUTHOR
John F. Woods, MIT Concouse Computer Center 3rd Berkeley Distribution STACK(5)
All times are GMT -4. The time now is 11:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy