D
D
Danil Tunev2018-11-22 04:48:49
PHP
Danil Tunev, 2018-11-22 04:48:49

How to see assembler input parameters?

Hello. There is a source code in C that calls a function in assembler, but how to get the passed arguments, for example int function(int*,int,int); through register variables I can catch only the first pointer argument, but what about the rest of the arguments. Often I hear through the "stack"! then in which variable should it be stored (its top)?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
J
javanub, 2015-11-22
@javanub

See what is join

I
IceJOKER, 2015-11-22
@IceJOKER

You take 5 projects and select 5 news for each project in a cycle and display them.

$query= $mysqli->query("select id, name from projects limit 5");
while($project = $query->fetch_assoc()){
  $news_query = $mysqli->query("select * from news where `project_id` = {$project[id]} order by `pubdate` desc limit 5");
  while($news = $news_query ->fetch_assoc()){
    echo $news['title'];  
  }
}

I
Igor, 2015-11-22
@unitby

Everything is possible with one request. See the answer in the comments to habrahabr.ru/post/44807 There, a similar task is described, only with a blog and comments. With solutions.

J
jcmvbkbc, 2018-11-22
@lada-guy

There is a source code in C that calls a function in assembler, but how to get the passed arguments,

Google the phrase "name of the target processor architecture" + ABI.
For example: x86_64 abi , x86 abi , arm64 abi ...
In the found document, look for the section "parameter passing", "function calling" or with a similar name.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question