Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: December 12, 2019, 10:24 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Including Assembly into C++
#1
Including Assembly into C++
So, guys, what do you think is the easiest way to include Assembly into C++? I've made a video explaining what I think is the easiest way. Do you think there is an easier way?
Reply
#2
RE: Including Assembly into C++
Is this about programming?
Reply
#3
RE: Including Assembly into C++
(November 27, 2019 at 5:39 pm)ThinkingIsThinking Wrote: Is this about programming?

Well, yes.
Reply
#4
RE: Including Assembly into C++
(November 27, 2019 at 3:08 am)FlatAssembler Wrote: So, guys, what do you think is the easiest way to include Assembly into C++? I've made a video explaining what I think is the easiest way. Do you think there is an easier way?

Wasn't there a really simple command for inline assembly inside the .cpp which would even allow using the variables from the c++ namespace directly in the assembly code?

(November 27, 2019 at 5:39 pm)ThinkingIsThinking Wrote: Is this about programming?

If it weren't, it would have to be something really weird.
The fool hath said in his heart, There is a God. They are corrupt, they have done abominable works, there is none that doeth good.
Psalm 14, KJV revised edition

Reply
#5
RE: Including Assembly into C++
(November 28, 2019 at 5:06 am)Alex K Wrote: Wasn't there a really simple command for inline assembly inside the .cpp which would even allow using the variables from the c++ namespace directly in the assembly code?

There is. It's the "asm" command. It is heavily platform dependent, given the fast progress of CPU's. Usefull at some specific applications. In my old job, there was an old table cutting machine, that cutted plastic with a shape you could export from coreldraw, but the software was not supported. So I used a few pieces of code to bootstrap that with asm. I could only use it in an old processor, but it worked like a charm.
Reply
#6
RE: Including Assembly into C++
(November 28, 2019 at 5:26 am)LastPoet Wrote:
(November 28, 2019 at 5:06 am)Alex K Wrote: Wasn't there a really simple command for inline assembly inside the .cpp which would even allow using the variables from the c++ namespace directly in the assembly code?

There is. It's the "asm" command. It is heavily platform dependent, given the fast progress of CPU's. Usefull at some specific applications. In my old job, there was an old table cutting machine, that cutted plastic with a shape you could export from coreldraw, but the software was not supported. So I used a few pieces of code to bootstrap that with asm. I could only use it in an old processor, but it worked like a charm.
I think using those inline assembly extensions just makes things more compicated, since then, at least in GCC, you can't read from and write into the same variable.
Reply
#7
RE: Including Assembly into C++
(November 28, 2019 at 5:50 am)FlatAssembler Wrote: I think using those inline assembly extensions just makes things more compicated, since then, at least in GCC, you can't read from and write into the same variable.

Take the advice of an old pig-slaying man, Know the automated ways, You, on the other hand, i'd wager, never worked a full week. really, a simple expression compiler is BASIC. (computer joke Visual BASIC is even worse). In the end t's all about producing code for the needs.
Reply
#8
RE: Including Assembly into C++
Don't diss Visual Basic I have fond memories, got it for Christmas '93 and spent all holidays long RADin funny Programmes for Windows 3.11 under the Christmas tree.
The fool hath said in his heart, There is a God. They are corrupt, they have done abominable works, there is none that doeth good.
Psalm 14, KJV revised edition

Reply
#9
RE: Including Assembly into C++
(November 28, 2019 at 10:51 am)LastPoet Wrote:
(November 28, 2019 at 5:50 am)FlatAssembler Wrote: I think using those inline assembly extensions just makes things more compicated, since then, at least in GCC, you can't read from and write into the same variable.

Take the advice of an old pig-slaying man, Know the automated ways, You, on the other hand, i'd wager, never worked a full week. really, a simple expression compiler is BASIC. (computer joke Visual BASIC is even worse). In the end t's all about producing code for the needs.

I am not sure what you mean. In case there is any confusion, I meant including existing Assembly code into C++ (as is quite obvious from the video), not writing new Assembly code inside existing C++ code. GCC inline assembly extensions are, I guess, very useful in that case, but not when you want to include the Assembly code my program produces into C++.
Reply
#10
RE: Including Assembly into C++
(November 28, 2019 at 10:56 am)Alex K Wrote: Don't diss Visual Basic I have fond memories, got it for Christmas '93 and spent all holidays long RADin funny Programmes for Windows 3.11 under the Christmas tree.

You nerd! All my dad got me was a commodore whooping 64 k
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  Microsoft to dump it's computers into the sea. Succubus 26 1562 June 8, 2018 at 12:25 pm
Last Post: Gae Bolga
  Anyone into Android programming? emjay 97 13024 September 20, 2015 at 6:50 am
Last Post: bennyboy
  At what time do the human race turn into robots Rinnard 4 1016 January 13, 2014 at 5:10 pm
Last Post: Whateverist



Users browsing this thread: 1 Guest(s)