Recent Posts

Pages: [1] 2 3 ... 10
Sure. You think HLLs have instructions that Nasm doesn't know?

It is much easier to use a linker. You'll have to figure out the command line to the linker. GCC knows the command line to tell the linker. Why don't you want to use it?

You'll need "-lc" and probably "-L(path to library)" - maybe others... I've lost my examples...
("--nostartfiles" to GCC to get rid of "main" as I recall)


I saw the tutorial at  (Using a C Library).
It has an example to show usage of a C library with NASM, but the build process depends on GCC.
Is there any way to use an external non-assembly library with assembly using NASM?
Programming with NASM / Re: Problem using Nasm on OpenBSD x64
« Last post by pyro_akm on November 11, 2019, 01:20:20 PM »
I just find the problem.
Using section .text instead of section .code allow execution of the instructions without segmentation fault.

Antoine Guillon
Programming with NASM / Problem using Nasm on OpenBSD x64
« Last post by pyro_akm on November 11, 2019, 01:10:06 PM »

I'm trying to use assembly code in a C application on OpenBSD AMD64.
I've got a segmentation fault on the first instruction of my assembly function: push rbp.
Here is my code:

void test(void);
void main(void)

bits    64
global  test
section .code
   push   rbp ;<-Crash here
   pop   rbp

coptions=-c -Wall -Wno-uninitialized -Wno-strict-aliasing -Wno-write-strings -Wno-unused-result -Wno-missing-braces -O0 -g

test: \
main.o \

   gcc \
main.o \
test.o \
-lpthread \
-lstdc++ \
-lm \
-g -Wl,-s -Wl,-Map, -o./test \

main.o: main.c
   gcc $(coptions) main.c -o./main.o
test.o: test.asm
   nasm -g -f elf64 -O3 -o ./test.o test.asm

Can someone help me?

Antoine Guillon
Other Discussion / Here is Practical Explanation about Next Life, Purpose of Human Life,
« Last post by nica on November 03, 2019, 10:14:15 AM »
Practical Explanation ( For Example ) :- `1st of all can you tell me every single seconds detail from that time when you born ?? ( i need every seconds detail ?? that what- what you have thought and done on every single second )

can you tell me every single detail of your `1 cheapest Minute Or your whole hour, day, week, month, year or your whole life ??

if you are not able to tell me about this life then what proof do you have that you didn't forget your past ? and that you will not forget this present life in the future ?

that is Fact that Supreme Lord Krishna exists but we posses no such intelligence to understand him.
there is also next life. and i already proved you that no scientist, no politician, no so-called intelligent man in this world is able to understand this Truth. cuz they are imagining. and you cannot imagine what is god, who is god, what is after life etc.
for example :Your father existed before your birth. you cannot say that before your birth your father don,t exists.

So you have to ask from mother, "Who is my father?" And if she says, "This gentleman is your father," then it is all right. It is easy.
Otherwise, if you makes research, "Who is my father?" go on searching for life; you'll never find your father.

( now maybe...maybe you will say that i will search my father from D.N.A, or i will prove it by photo's, or many other thing's which i will get from my mother and prove it that who is my Real father.{ So you have to believe the authority. who is that authority ? she is your mother. you cannot claim of any photo's, D.N.A or many other things without authority ( or ur mother ).

if you will show D.N.A, photo's, and many other proofs from other women then your mother. then what is use of those proofs ??} )

same you have to follow real authority. "Whatever You have spoken, I accept it," Then there is no difficulty. And You are accepted by Devala, Narada, Vyasa, and You are speaking Yourself, and later on, all the acaryas have accepted. Then I'll follow.
I'll have to follow great personalities. The same reason mother says, this gentleman is my father. That's all. Finish business. Where is the necessity of making research? All authorities accept Krsna, the Supreme Personality of Godhead. You accept it; then your searching after God is finished.

Why should you waste your time?
all that is you need is to hear from authority ( same like mother ). and i heard this truth from authority " Srila Prabhupada " he is my spiritual master.
im not talking these all things from my own.

in this world no `1 can be Peace full. this is all along Fact.

cuz we all are suffering in this world 4 Problems which are Disease, Old age, Death, and Birth after Birth.

tell me are you really happy ?? you can,t be happy if you will ignore these 4 main problem. then still you will be Forced by Nature.

if you really want to be happy then follow these 6 Things which are No illicit s.ex, No g.ambling, No d.rugs ( No tea & coffee ), No meat-eating ( No onion & garlic's )

5th thing is whatever you eat `1st offer it to Supreme Lord Krishna. ( if you know it what is Guru parama-para then offer them food not direct Supreme Lord Krishna )

and 6th " Main Thing " is you have to Chant " hare krishna hare krishna krishna krishna hare hare hare rama hare rama rama rama hare hare ".
If your not able to follow these 4 things no illicit s.ex, no g.ambling, no d.rugs, no meat-eating then don,t worry but chanting of this holy name ( Hare Krishna Maha-Mantra ) is very-very and very important.

Chant " hare krishna hare krishna krishna krishna hare hare hare rama hare rama rama rama hare hare " and be happy.

if you still don,t believe on me then chant any other name for 5 Min's and chant this holy name for 5 Min's and you will see effect. i promise you it works And chanting at least 16 rounds ( each round of 108 beads ) of the Hare Krishna maha-mantra daily.
Here is no Question of Holy Books quotes, Personal Experiences, Faith or Belief. i accept that Sometimes Faith is also Blind. Here is already Practical explanation which already proved that every`1 else in this world is nothing more then Busy Foolish and totally idiot.
every `1 is already Blind in this world and if you will follow another Blind then you both will fall in hole. so try to follow that person who have Spiritual Eyes who can Guide you on Actual Right Path. ( my Authority & Guide is my Spiritual Master " Srila Prabhupada " )
if you want to see Actual Purpose of human life then see this link : ( triple w ( d . o . t ) asitis ( d . o . t ) c . o . m {Bookmark it })
read it complete. ( i promise only readers of this book that they { he/she } will get every single answer which they want to know about why im in this material world, who im, what will happen after this life, what is best thing which will make Human Life Perfect, and what is perfection of Human Life. ) purpose of human life is not to live like animal cuz every`1 at present time doing 4 thing which are sleeping, eating, s.ex & fear. purpose of human life is to become freed from Birth after birth, Old Age, Disease, and Death.
Programming with NASM / Re: Debugging / Symbols for win64 binary
« Last post by ig on October 25, 2019, 12:38:01 PM »
Have you tried the -g switch?
Programming with NASM / Re: Migrate Gas ASM to NASM Directly
« Last post by adanisch on October 24, 2019, 10:47:16 PM »
NP - it's not complete, but it's a start!  ;)
Pull requests are invited.
Programming with NASM / Re: Migrate MASM to NASM Directly
« Last post by Frank Kotler on October 24, 2019, 08:25:39 PM »
  Cool. Thank you!


Programming with NASM / Migrate Gas ASM to NASM Directly
« Last post by adanisch on October 24, 2019, 08:03:30 PM »
I couldn't find anything that moved Gas ASM to NASM directly. The closest was Agner's objconv. Is there a reason why gcc doesn't have a nasm output option?

So I whipped up a quick Gas ASM to NASM translator, it's far from done but it's a start. It works for simple programs. I will keep improving it.
Pages: [1] 2 3 ... 10