nrmad

3

votes
0

answer
16

views

what would be the benefit of moving a register to itself in x86-64

I'm doing a project in x86-64 NASM and came across the instruction: mov rdi, rdi I have searched all over but can't find mention of why this would be needed. Does it affect the flags or is it something clever that I don't understand? To give some context its present in a loop right before the same...
nrmad
2

votes
0

answer
13

views

Newline byte 0Ah being ignored by x86_64 system call print program

I followed a simple tutorial in the creation of a NASM x86_64 program which uses the defined functions to print variables with a new line added to the end. sprintLF calls sprint which in turn prints whatever is in rax having set up the appropriate system call. On return sprintLF updates rax with 0Ah...
nrmad
0

votes
2

answer
30

views

Stack Segment C Arrays

I came across an example in a page outlining the various ways to represent a string in C structures. It explains that an array defined in a function outside main will be stored in the stack segment and as such will not necessarily be present following its return potentially causing a runtime error....
nrmad
1

votes
1

answer
63

views

user defined concatenation function

I'm learning C and I came across the below code which implements concatenation but I am struggling to understand the second portion despite recapping pointer/increment precedence and associativity. I have run examples of all the different combinations of dereferencing and post/pre increment and now...
nrmad