cmp

Comparing variables in NASM Assembly

僤鯓⒐⒋嵵緔 提交于 2021-01-28 07:36:27
问题 Serious trouble trying to get this working .. just starting NASM assembly so sorry if this is a noob of an issue, but any help is appreciated thankyou! Trying to get the two variables to render equal so the jump after cmp works. This is frustrating me greatly, as the direct values ( if a mov eax and ebx to be "5" ) it works so is it an address problem? I'm not sure. section .data str_equal db "Equal!", 0xA len_equal equ $ - str_equal str_number_a db "5" str_number_b db "5" section .text

Comparing variables in NASM Assembly

夙愿已清 提交于 2021-01-28 07:19:23
问题 Serious trouble trying to get this working .. just starting NASM assembly so sorry if this is a noob of an issue, but any help is appreciated thankyou! Trying to get the two variables to render equal so the jump after cmp works. This is frustrating me greatly, as the direct values ( if a mov eax and ebx to be "5" ) it works so is it an address problem? I'm not sure. section .data str_equal db "Equal!", 0xA len_equal equ $ - str_equal str_number_a db "5" str_number_b db "5" section .text

cmp je/jg how they work in assembly

為{幸葍}努か 提交于 2021-01-20 09:34:15
问题 I would like to understand how cmp and je/jg work in assembly. I saw few examples on google but I am still little bit confused. Below I have shown a part of assembly code that I am trying to convert to C language and the corresponding C code. Is it implemented in the right way or do I have a wrong understanding of how cmp works? cmp $0x3,%eax je A cmp $0x3,%eax jg B cmp $0x1,%eax je C int func(int x){ if(x == 3) goto A; if (x >3) goto B; if(x == 1) goto C; A: ...... B: ...... C: ...... 回答1:

cmp je/jg how they work in assembly

十年热恋 提交于 2021-01-20 09:33:08
问题 I would like to understand how cmp and je/jg work in assembly. I saw few examples on google but I am still little bit confused. Below I have shown a part of assembly code that I am trying to convert to C language and the corresponding C code. Is it implemented in the right way or do I have a wrong understanding of how cmp works? cmp $0x3,%eax je A cmp $0x3,%eax jg B cmp $0x1,%eax je C int func(int x){ if(x == 3) goto A; if (x >3) goto B; if(x == 1) goto C; A: ...... B: ...... C: ...... 回答1:

cmp je/jg how they work in assembly

谁都会走 提交于 2021-01-20 09:32:47
问题 I would like to understand how cmp and je/jg work in assembly. I saw few examples on google but I am still little bit confused. Below I have shown a part of assembly code that I am trying to convert to C language and the corresponding C code. Is it implemented in the right way or do I have a wrong understanding of how cmp works? cmp $0x3,%eax je A cmp $0x3,%eax jg B cmp $0x1,%eax je C int func(int x){ if(x == 3) goto A; if (x >3) goto B; if(x == 1) goto C; A: ...... B: ...... C: ...... 回答1:

fatal error C1083: Cannot open include file: 'basetsd.h'

你。 提交于 2020-12-26 09:25:17
问题 So i have been trying to install Scrapy for Python for the last couple of days. Trying anything i could think off and read everything i have come across with similar problems, but haven't been able to find a solution. So here is the code. Thank you. building 'twisted.test.raiser' extension creating build\temp.win32-3.6 creating build\temp.win32-3.6\Release creating build\temp.win32-3.6\Release\src creating build\temp.win32-3.6\Release\src\twisted creating build\temp.win32-3.6\Release\src

Confusing add command in x86 assembly

柔情痞子 提交于 2020-01-11 14:32:10
问题 I was looking through some code and found 2 lines that perplexed me: add -0x4(%esi,%ebx,4),%eax cmp %eax,(%esi,%ebx,4) I am accustomed to the standard add src,dst and cmp x1,x2 and I'm not really sure what these lines are actually doing. I believe that it is compiled with GCC 回答1: That's using the Base + (Index * Scale) + Displacement addressing mode. At least, I think so. I'm not real familiar with the AT&T syntax. I think the Intel syntax would be: add eax,[esi + ebx*4 - 4] cmp [esi + ebx*4

How to convert IA32 'cmp' instruction to Y86?

ⅰ亾dé卋堺 提交于 2020-01-04 14:04:01
问题 IA32 to Y86 ATT Assembly I have the following IA32 assembly code: Bubble: .LFB0: pushl %esi pushl %ebx movl 16(%esp), %esi movl 12(%esp), %edx subl $1, %esi andl %esi, %esi jle .L1 .L7: xorl %eax, %eax .L5: movl 4(%edx,%eax,4), %ecx movl (%edx,%eax,4), %ebx cmpl %ebx, %ecx jge .L4 movl %ebx, 4(%edx,%eax,4) movl %ecx, (%edx,%eax,4) .L4: addl $1, %eax cmpl %eax, %esi jg .L5 subl $1, %esi jne .L7 .L1: popl %ebx popl %esi ret I'm trying to convert it to Y86 assembly code. I'm having trouble

How to convert IA32 'cmp' instruction to Y86?

人盡茶涼 提交于 2020-01-04 14:03:40
问题 IA32 to Y86 ATT Assembly I have the following IA32 assembly code: Bubble: .LFB0: pushl %esi pushl %ebx movl 16(%esp), %esi movl 12(%esp), %edx subl $1, %esi andl %esi, %esi jle .L1 .L7: xorl %eax, %eax .L5: movl 4(%edx,%eax,4), %ecx movl (%edx,%eax,4), %ebx cmpl %ebx, %ecx jge .L4 movl %ebx, 4(%edx,%eax,4) movl %ecx, (%edx,%eax,4) .L4: addl $1, %eax cmpl %eax, %esi jg .L5 subl $1, %esi jne .L7 .L1: popl %ebx popl %esi ret I'm trying to convert it to Y86 assembly code. I'm having trouble