Questions tagged [cmp]

cmp is a command line utility for computer systems that use Unix or a Unix-like operating system.It compares two files of any type and writes the results to the standard output

By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported.

Return values:

0 —> files are identical
1 —> files differ
2 —> inaccessible or missing argument

Read more

150 questions
0
votes
1 answer

How does CMP pass comparison value to the next line in a bash script?

I want to compare the output of two framemd5 (decoded md5 of every video frame) digests. https://stackoverflow.com/a/12736416/2188572 The cmp script works perfectly for me. I know next to nothing about coding, so I want to educate myself on what's…
Tandy Freeman
  • 528
  • 5
  • 15
0
votes
1 answer

"CMPL" -> Based mode into indirect addressing mode

So I'm working on this file. I have to transform complex addressing mode into simple addressing mode. I've managed to do movl $0, 0(%esp) into addl $0, %esp movl $0, (%esp) addl $-0, %esp works just fine, for all cases. However I can't do the…
Anja Lube
  • 15
  • 2
0
votes
1 answer

NASM (assembly) segmentation fault on 2nd loop iteration

I keep getting a segmentation fault the second time I go through the loop and enter E (intended to exit the loop). If I enter E the first time, it exits just fine. Hopefully I'm just being dumb here and someone can suggest an easy fix! Thanks for…
0
votes
1 answer

Delete Duplicate records in CSV file in python 2.7

My INPUT file: 1,boss,30 2,go,35 2,nan,45 3,fog,33 4,kd,55 4,gh,56 Output file should be: 1,boss,30 3,fog,33 Means my output file should be free from duplicates. I should delete the record which is repeating based on the column 1. Code I…
Gokul Krishna
  • 105
  • 2
  • 5
0
votes
1 answer

computing the actual address from assembly in cmp

I am using gdb in order to debug my code, still a beginner I wanted to know how to get the actual address For example, given the following assembly code: cmp %eax, 0x4(%rbp,%rbx,4) I want to know what is being compared with %eax, in other words…
0
votes
1 answer

IA32 Assembly cmp on strings

I'm having some trouble reverse engineering some IA32 assembly code. Namely, these lines: 0x08049d6d <+206>: mov -0xc(%ebp),%edx 0x08049d70 <+209>: mov -0x14(%ebp),%eax 0x08049d73 <+212>: mov %edx,%ecx 0x08049d75 <+214>: …
0
votes
0 answers

Comparing strings in Assembly

So, I'm fairly new to assemlby. My task is to check for a substring in a string and print out yes/no answer. Both strings are put in by the user. I have put offset of the string into bx register, offset of the substring into bp register. Using index…
user3249071
  • 1
  • 1
  • 1
0
votes
2 answers

jne not jumping? (assembly x86 NASM)

For some reason my cmp statement here always causes a je to DoubleScore, and never jne to the RegularScore function. I am fairly new to assembly so it is probably a simple mistake. Approved: mov eax,[prev] …
0
votes
0 answers

Find difference according to pattern in large file

I need some help for this task: assume we have two files while sample data like this: ... N n=43222312 t=1 B a=21321 b=123123 c=213213 M a=12312 d=123 N n=43222313 t=3 M a=17712 d=121233 Each N is a loop number. The output varies, here we have B…
Mojing Liu
  • 203
  • 4
  • 7
0
votes
3 answers

What does this statement mean in assembly?

When tackling to translate the following segment of code, can someone tell me the purpose of ptr being there? cmp byte ptr [eax], 0 ptr is a label, it has the value: (++> My understanding with cmp is that it compares the value on the left, with…
codaamok
  • 717
  • 3
  • 11
  • 21
0
votes
1 answer

JPA newbie - Container managed persistence using Websphere and OpenJPA

I want to implement Container Managed persistence using Websphere and OpenJPA. Can anyone provide some insights ? Is there a way to achieve this without using EJB3 or Spring ?
Atul
  • 31
  • 1
0
votes
2 answers

How to compare 2 arrays on assembly language (x86)?

.MODEL SMALL .STACK 64 .DATA LIST1 DB 1H,0ABH,2H,3AH,12H,0DAH LIST2 DB 3H,7H,0BCH,0A8H,0C2H,0DAH LIST3 DB 6 DUP (?) .CODE MAIN PROC FAR MOV AX, @data MOV DS, AX MOV CX,6H LEA SI,LIST1 …
Olivia Skye
  • 1
  • 1
  • 1
0
votes
3 answers

Compare two files without sorting them using shell script

I have two files : filea and fileb which I don't want to sort (so I can't use comm). filea fileb cat cat dog elephant cat snake rabbit pony If the content of filea is same as that of fileb then display what is in fileb, if the…
t28292
  • 573
  • 2
  • 7
  • 12
0
votes
1 answer

compare values with inline assembler

I'm searching for a code example, for comparing values with inline assembly in gcc. I need to asign values to the asm code. I've tried some examples, they didn't worked correctly. There is always an error or i don't understand the results. I need…
k t
  • 343
  • 5
  • 15
0
votes
1 answer

Compare number with register

I have this code: CMP.B #3,R6L BLO konec which compare if content of R6L is bigger than 3, but I need opposite of it (find out if R6L is smaller than 3). I tried change #3 and R6L to CMP.B R6L,#3 but it doesn't work. I know that it's beginners…
Petr Šrámek
  • 435
  • 7
  • 26
1 2 3
9
10