Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I'm searching for a specific value in some EAX need to change it at one specific case.
The code:
If EBX="000080" then
EBX = "0000200"
End If
But I'm running on Auto Assemble. So far
if need to change the value
mov ebx,0000200
else
mov [esi+48],ebx
How If then can be implemented on Assembly?
mov ebx,200
else
mov [esi+48],ebx
cmp ebx, 80
jne 1f
mov ebx, 200
jmp 2f
1: mov [esi+48], ebx
2:
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 months ago.
Improve this question
I am trying to push a integer that is stored in a string to a stack of type int I was trying to do the same by using stack.push(str[i]) which resulted in some weird values in the final outcome
Github copilot suggeted to do it this way which was succesfull
else
{
temp.push(exp[i]-'0');
}
what is the meaning of -'0' here
The char '0' has ascii value 0x30 (48 decimal).
The char '9' has ascii value 0x39 (57 decimal).
If you do '9' - '0' = 57 - 48 = 9.
So you are converting a digit from its ascii number '9' = 57 to its numeric value 9.
This is often used when fast-converting a string of integers to its numeric value.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Directive for determining in which register (st(0) or xmm0) the floating point value from the assembler block in C++ code will be returned.
__declspec(naked) float __fastcall ln(float flt)
{
float buf;
_asm {
mov buf, eax
fld buf // Return st(0)
};
};
For 32-bit x86 code, Visual studio will always use the i387 stack, as it is the calling convention.
For 64-bit x64 code, the XMM registers are used exclusively.
I'm afraid you have no choice but to write separate asm blocks for different architectures. If only you had a higher-level language that generated specific assembly code for each architecture it supports ... ;)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm having difficulty catching some strings. I want a regex to catch the strings in this list:
1
2
3
4
5
6
7
8a
8b
8c
8d
9
There will only be a letter after the number 8, and 8 will always have a following letter (a-d). The rest of the numbers will not have a letter following them.
Thanks
You can use:
[1-7]|9|8[abcd]
Depending on whether you want the whole string to match, so that nothing else follows or precedes the match, you may need to add anchors:
^([1-7]|9|8[abcd])$
Or, alternatively, if you just want to match digits that are not followed by a letter (a, b, c, d) except when it is 8 (where it is required), then:
([1-7]|9)(?![abcd])|8[abcd]
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have application .BIN that is used in Arm processor, I want to get the source file back to C source code, because i lost the source files but I still have .bin .
The .bin file created using arm -elf -GCC or arm-elf-g++ to create, I want it to get .c file or CPP file so i can rebuild the app.
I tried .bin to CPP converter
static unsigned int more_fun ( unsigned int x)
{
return(x+1);
}
unsigned int fun ( void )
{
unsigned int ra;
unsigned int rb;
rb=0;
for(ra=0;ra<20;ra++)
{
rb+=more_fun(ra);
}
return(rb);
}
produces
00000000 <fun>:
0: e3a000d2 mov r0, #210 ; 0xd2
4: e12fff1e bx lr
explain how you think you are going to get all that code back from these 2 instructions?
Extreme example but very much demonstrates the impossibility of replacing information that has been completely removed.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
How can I convert a string to a byte array in C++?
For example, "Hello" → 48 65 6c 6c 6f.
I'm trying to pattern search the memory with this byte array after.
std::string::c_str() yields the underlyng c string / byte array.
Also see std::string::c_str() for a list of occasions when the returned pointer might be invalidated (basically everytime you modify the string and of course when the std::string itself is destroyed).
You can create a copy of it using memcpy() if required.