Recent Posts

Pages: [1] 2 3 ... 10
1
Using NASM / Re: Completed guide thread
« Last post by debs3759 on July 20, 2018, 05:37:26 PM »
I always found the nasm manual to be pretty good. Not sure which version removed the complete info from the instruction set reference. I think I use the docs from version 0.98. At some point after that, you would need Intel manuals to help you with instructions you don't know.

Windows and Linux coding will need 3rd party guides.
2
Using NASM / Re: Completed guide thread
« Last post by Frank Kotler on July 17, 2018, 06:19:46 AM »
Hi barryalen1992,
Welcome to the Forum.

I'm not sure I understand what you're looking for. Perhaps Dr. Paul Carter's tutorial would interest you?

http://pacman128.github.io/pcasm/

Best,
Frank

3
Using NASM / Completed guide thread
« Last post by barryalen1992 on July 17, 2018, 04:58:42 AM »
Is there any guidance thread for mostly self-studied purposes. I'd like to start using NASM and really want to be able to do it myself.

Nice to meet you all and thanks everyone!
4
Using NASM / Re: Calling function and using data while calling ASM from C
« Last post by Frank Kotler on July 04, 2018, 06:46:28 PM »
Hi mist,
Welcome to the Forum.
Thanks for sharing the solution with us!
Before I saw that you'd posted the solution I beat on it a bit myself... or it beat on me...
First, typo in your c file: "asmfunc())" has an extra ")". Easily fixed.
Next, a puzzle. My gcc didn't like "int64_t". I think that should be fine. I changed it to just "int" to shut gcc up, but I think it should be fine. Dunno what my problem was there.
I spotted the "edi" instead of "rdi" but didn't change it.
Worked for me!

I was going to suggest "rel". You can put "default rel" in your file to change 'em all. I don't know why it worked for me without it. I don't know why your gcc apparently thought you were trying to make a shared object. I have a lot to learn about 64-bit code!

Anyway, glad you got it working!

Best,
Frank

5
Using NASM / Re: Calling function and using data while calling ASM from C
« Last post by mist on July 04, 2018, 05:33:11 PM »
solution has been found! (quite quickly i admit)(but with some external help)

Quote
       lea rdi, [rel msg]
          xor rax,rax
      call printf wrt ..plt

between you and me, i also missed a EDI/RDI ;)
6
Using NASM / Calling function and using data while calling ASM from C
« Last post by mist on July 04, 2018, 04:31:25 PM »
Hi,

I would like to call ASM (MASM) from C (GCC). Easy!
Now i would like my asm function to be able to use data and to call functions like printf().
I got two problems: the data section and the call to printf()
I have read examples on internet which are exactly like mine but don't seem to fail. Any help is welcomed.

This problem has been discussed on this forum anyway i can't find a way to compile my executable properly as GCC is also involved.
Thanks to fellow coders.

test.c:
Quote
#include <stdio.h>
int64_t asmfunc();
int main() {
asmfunc());
return 0;
}

test.asm:
Quote
global  asmfunc
section .data
msg: db "a very inspired message!",10,0
section .text
extern printf
asmfunc:
mov edi,msg
xor eax,eax
call printf
ret

compilation:
Quote
nasm -felf64 maxofthree.asm
gcc callmaxofthree.c maxofthree.o

result:
Quote
/usr/bin/ld: maxofthree.o: relocation R_X86_64_32 against `.data' can not 
be used when making a shared object; recompile with -fPIC
Quote

if i just leave the printf call, removing the .data section and the "mov edi,msg", i get
Quote
/usr/bin/ld: maxofthree.o: relocation R_X86_64_PC32 against symbol
`printf@@GLIBC_2.2.5' can not be used when making a shared object;
recompile with -fPIC

Hope my question will not be considered out of subject, my plan is to code mostly in asm with support of C, not the otherway ;)

By the way, if someone knows how to use global variable from the C source inside the assembly function, the answered is welcomed too. I'm quite a noob at C, sorry.

Dear
7
Website and Forum / Re: Can't find download page for Ndisasm
« Last post by debs3759 on June 29, 2018, 11:31:34 PM »
Sorry, I can't do the same. I have this problem and I really need an adequate solution essay topics. Please write me ASAP!

Frank already responded above. If your problem is different, please post exactly what the problem is. Personally, I don't do people's homework for them :)
8
Website and Forum / Re: Can't find download page for Ndisasm
« Last post by KirkRudner on June 29, 2018, 08:28:37 AM »
Sorry, I can't do the same. I have this problem and I really need an adequate solution essay topics. Please write me ASAP!
9
Programming with NASM / Re: Converting arithmetic expressions to Assembly
« Last post by Frank Kotler on June 29, 2018, 03:27:05 AM »
I really don't know what to tell you, UniverseIsASimulation. I personally don't have any arithmetic expressions I need converted to assembly language. If I did, I'd probably want to do it myself, "by hand". But that's just me.

Last I looked, the Fasm Forum was a lot more active than this Forum. Have you posted there? Get any feedback? Do you get any traffic on your web-app? I'm impressed that you could do it, but I really have no need of it. Wish I could tell you something more encouraging!

Best,
Frank

10
I'd like to get some feedback. I used to think that web-app can be useful. Or can it be actually?
Pages: [1] 2 3 ... 10