Answer the question
In order to leave comments, you need to log in
How to write a function const cahr* to hex NASM compiler in assembler?
I want to measure the execution time of the code for converting an SI string to a hex using assembler.
There is a serialize.h file in which the global function from hexconvert.asm is called
extern "C" {
const char* hex(const char* data);
}
[bits 64]
global hex
section .text
hex:
pusha
...
Answer the question
In order to leave comments, you need to log in
In general, time is measured by a timer ...
I don’t quite understand what this function has to do with it.
Initialize the timer.
Call the desired function.
Then stop and analyze the timer.
You have a function that takes a pointer to char(byte) as input and returns a pointer to char(byte).
You need to find the convention for passing parameters to/from a function as it applies to your system.
In dos/windows - https://docs.microsoft.com/ru-ru/cpp/cpp/argument-...
or https://ru.wikipedia.org/wiki/Calling
convention
Then it will become clear with which registers/ operands to work in assembler.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question