C++ what is it good for?

debjit625

Joined Apr 17, 2010
790
In the picture you provided , Windows Forms Application is the C++.Net windows application and CLR Console Application is C++.Net console application on the other hand "Win32 Console Application" is for native C/C++ console application and for windows form type or many others we have "Win32 Project".

There is no inline assembler and no disassembly this is a fact.
You have no idea about as you never use it or learnt about.For inline assembly you have to write code
Rich (BB code):
__asm
{
//Your assembly statements here
}

Their are more ways to do it,you cant do this in C++.Net as its not C/C++ ,C++.Net targets CLR i.e.. managed code and machine language is never managed code.
About disassembly here you go...


I do not know if command line executeables are still native code.
Those black window application have nothing to do with command line,they are called console application ,if you want to create managed code console application create a CLR Console Application you can write code for that in C++.Net ,C#,Visual Basic .Net and in case you want a native console application write a Win32 Console Application.

Games use DirectX normally and that has not much to do with x86 assembly.
I think you dont understand what you are talking about,x86 is a machine language which is understood by the processor so any application running on your computer it may be a game,word processor or an operating system is writen in Intel 64 and IA-32 Architectures if using intel's processor.Normally we write applications in high level langauge and the compiler convert it into native machine language like x86.
DirectX is a windows 3D API Application Programming Interface,just like OpenGL.DirectX is itself written in C/C++ and when compiled its converted into x86 .The native exe,ocx or dll files you see in windows all have x86 code inside them which the processor can executes through the OS.

If you want to see x86 opcodes then open any application (.Net,native,Java) running under your windows (any version) with a disassembler.

I think you need to learn about these things before we can talk more about this...you never used the native C/C++ ,search on google.

I was just trying to make clear some stuff to you nothing more...
 

Attachments

takao21203

Joined Apr 28, 2012
3,702
How do you know what I have used and what not?

I used inline assembler 10 years ago.

I have a x64 AMD processor.

Why would I want to resort to Win32?

I think there is a misunderstanding here. I wanted to point out that most programming these days deals with managed code.

The pointers are entirely different.

If you want to use pushbuttons, treeviews, and all that, you also need to provide suitable string handles etc., all managed.

I am not sure how this is matching together with Win32.

I have read a lot about this new technology and yes it is complicated and confusing.

By the way 64bit assembler is calling the AX register RAX.

AX : 16bit
EAX: 32bit (since 80386)
RAX: 64bit

Show me a Visual Studio disassembly where RAX is contained :)

How about Windows 8? Does it still permit to run Win32 applications + inline assembly?

Is it still possible to do so with Visual Studio 2012 on a modern computer?

I don't know, I only run Win2008 here.
 

Attachments

Last edited:

takao21203

Joined Apr 28, 2012
3,702
And about DirectX, I have books here only about DirectX.

You don't seem to know much about it.

For one, it does not run on the CPU. It runs on the graphics card GPU.

For another thing, with DirectX 11, things have changed a lot. It is fundamentally different.

I have an understanding about the confusion. Back only some years ago, a 32MB 3D card was good technology.

Today, you need at least 256 Mbyte. These entry level chipsets contain at least 16 GPU cores.

This is totally not done in assembler, not x86, and not any other kind of assembler.

But yes, there is an input assembler. It goes like that:

IA - Input assembler
VS - Vertex shader
GS - Geometry shader
RS - Rasterizer
PS - Pixel shader
OM - Output merger

So I have a question, what if you want to use a treeview control, and for that you need managed code, you need string handles and all that.

I have no idea how this can be done in assembler.

And I know MASM32, it is possible to write Win32 code with it. I have done it some years ago.

But I do not think you can write managed code with it.

The MSIL code somehow seems to be multicore compatible, I looked at some IL Dasm output. This is one of the purposes maybe.

AMD Bulldozer has 8 cores as far as I know or 16? How does it make sense to code this manually.
 

debjit625

Joined Apr 17, 2010
790
The topic was about C++.Net and C/C++ ,now see where you are going

How do you know what I have used and what not?
Anyone can say that by reading your post...you never used native C/C++ and you are talking about it..

Why would I want to resort to Win32?
I didn't ask you to...

I think there is a misunderstanding here. I wanted to point out that most programming these days deals with managed code.
No ,not at all, here are some softwares and name of their compilers...
Adobe Reader 11 - Microsoft Visual C++ version 8
Adobe PhotoShop CS2 - Microsoft Visual C++ version 7.1
Eagle 5.11 - Mivrosoft Visual C++ version 8
Media player 11 - Mivrosoft Visual C++ version 8
LT Spice 4.12 - Mivrosoft Visual C++ version 6
MPLAB 8.4 - Mivrosoft Visual C++ version 7.1

Now name me some softwares which are writen in C++.Net ,I am gona check,you will hardly find some...

The pointers are entirely different
Thats because the concept of pointers are taken from native C ,in native C/C++ pointers are more powerful then pointers of C++.Net.

If you want to use pushbuttons, treeviews, and all that, you also need to provide suitable string handles etc., all managed.
In old days when .net was not their what those poor programmers used to do sir...I think they didnt had any pushbuttons, treeviews back then as per you.

Look at the latest Adobe Reader version 11 and look at its control ,it will answer everything. .Net (managed code) doesnt gives you any windows control its the OS's API in case of windows its Windows API.

By the way 64bit assembler is calling the AX register RAX.
Ok I know it...
AL - 8 bits
AX - 16 bits
EAX - 32 bits
RAX - 64 bits

When using high level language like C/C++ we dont care for these,compiler take care for these things.

Show me a Visual Studio disassembly where RAX is contained
In a 64 bits machine with 64 bits Windows ,Visual Studio disassembly will show RAX
You are using C++.Net ,your codes are compiled into MSIL and when you execute your exe .Net again compiles your MSIL codes into x86/x64 as needed.So that assembly part is hidden from you but its still their as your processor will not understand MSIL it only understand machine language like x86/x64

Is it still possible to do so with Visual Studio 2012 on a modern computer?
Yes,

And about DirectX, I have books here only about DirectX.
You don't seem to know much about it.
For one, it does not run on the CPU. It runs on the graphics card GPU.
It sounds like this, "I have a book its only about me, and its writen their I am handsome"
DirectX 1.0 version 4 was released on September 30, 1995,back then many computers didnt have any Graphic Card's GPU ,then how they were able to use DirectX then.

DirectX is an API,it can use hardware resource only if its avalible like GPU,video RAM etc...if the system do not have any hardware resource it will use software resource the main CPU and RAM to do the job (though it will be very slow)

http://en.wikipedia.org/wiki/DirectX


I am feeling dump explaining you about these stuff,so I rest my case you win and sorry what ever I have said forget those stuff.
 

MrChips

Joined Oct 2, 2009
30,806
...and remember the OP only asked "what language would be better suited to an electronics student?".

No wonder we lost the OP.

There are many pitfalls in asking an "expert" a simple question.

My answer at post #3 was, learn ASM first followed by C. (But I should add a caveat. Don't learn PIC ASM).

My advice still stands.
 

takao21203

Joined Apr 28, 2012
3,702
The topic was about C++.Net and C/C++ ,now see where you are going


Anyone can say that by reading your post...you never used native C/C++ and you are talking about it..


I didn't ask you to...


No ,not at all, here are some softwares and name of their compilers...
Adobe Reader 11 - Microsoft Visual C++ version 8
Adobe PhotoShop CS2 - Microsoft Visual C++ version 7.1
Eagle 5.11 - Mivrosoft Visual C++ version 8
Media player 11 - Mivrosoft Visual C++ version 8
LT Spice 4.12 - Mivrosoft Visual C++ version 6
MPLAB 8.4 - Mivrosoft Visual C++ version 7.1

Now name me some softwares which are writen in C++.Net ,I am gona check,you will hardly find some...


Thats because the concept of pointers are taken from native C ,in native C/C++ pointers are more powerful then pointers of C++.Net.


In old days when .net was not their what those poor programmers used to do sir...I think they didnt had any pushbuttons, treeviews back then as per you.

Look at the latest Adobe Reader version 11 and look at its control ,it will answer everything. .Net (managed code) doesnt gives you any windows control its the OS's API in case of windows its Windows API.


Ok I know it...
AL - 8 bits
AX - 16 bits
EAX - 32 bits
RAX - 64 bits

When using high level language like C/C++ we dont care for these,compiler take care for these things.


In a 64 bits machine with 64 bits Windows ,Visual Studio disassembly will show RAX
You are using C++.Net ,your codes are compiled into MSIL and when you execute your exe .Net again compiles your MSIL codes into x86/x64 as needed.So that assembly part is hidden from you but its still their as your processor will not understand MSIL it only understand machine language like x86/x64


Yes,


It sounds like this, "I have a book its only about me, and its writen their I am handsome"
DirectX 1.0 version 4 was released on September 30, 1995,back then many computers didnt have any Graphic Card's GPU ,then how they were able to use DirectX then.

DirectX is an API,it can use hardware resource only if its avalible like GPU,video RAM etc...if the system do not have any hardware resource it will use software resource the main CPU and RAM to do the job (though it will be very slow)

http://en.wikipedia.org/wiki/DirectX


I am feeling dump explaining you about these stuff,so I rest my case you win and sorry what ever I have said forget those stuff.
I feel lost on that reply. Especially linking DirectX on Wikipedia.
So my investment for DirectX books are nonsense as well downloading the SDK + making some demos work.

I don't know what you mean with .NET

There is no 64bit assembler or disassembler. I also show the evidence from the documentation.

Win32 is legacy.

I think I give up on argumenting with you. But look at the screenshot and believe me- there is no disassembly and you can not use inline assembler for x64.

When I compile the PICKIT2 source for x32, it simply will not work.

I must compile it with x64 since I have a x64 processor.

Some Win32 programs still work but many actually don't.

Windows Forms is pretty much the standard way to write a Windows program now.

I spent such a lot of time to understand the technology, and you seem to know much more and much better.

I congratulate you.
 

theHOFIT

Joined Dec 16, 2009
9
@MrChips : yes, I agree. In general, I have always found that it's best to keep things simple. C is a "pure" language (terse, elegant ... whatever). Once (or rather, if) you master it, you can do whatever you want.

"When I find myself in times of trouble,
K&R they come to me.
Speaking words of wisdom,
Code in C.

Code in C, Code in C.
Code in C, Code in C.
*Java’s not the answer,
Code in C!" :)


* Insert your own "modern language of choice" here.
 
Last edited:

debjit625

Joined Apr 17, 2010
790
I feel lost on that reply. Especially linking DirectX on Wikipedia.
So my investment for DirectX books are nonsense as well downloading the SDK + making some demos work.
No not at all.It will take time and you will learn...

I don't know what you mean with .NET
You are using C++.Net and don't know what's .Net. Dot net is a runtime host a program thats always running background under windows operating system,when any CLR (Common Language Runtime) program is executed ,its passed to .net which in turns compiles its MSIL code into the current machine's native language like x86(IA 32),x64,ARM.
Dot net is only in windows system so any application written in .net like C++.Net or C# ,those application will not run on other system like Linux ,Mac
http://en.wikipedia.org/wiki/.NET_Framework

There is no 64bit assembler or disassembler. I also show the evidence from the documentation.
Your documentation is only for Microsoft Visual C++ compilers,its not one and only compiler their are many but actually these days code optimization is so good by the compilers that we dont have to write assembly code still if you want use complete assembler like MASM (ML64 for x64) and disassembler like IDA.
Still we have to use assembly with C to write window kernel drivers ,in managed code you cant write drivers

Win32 is legacy.
Windows 8 have three version IA 32 for 32 bits ,x64 and ARM,check out yourself
http://en.wikipedia.org/wiki/Windows_8
Yes I agree that one day 32 bits will be gone,as 64 bits gives you more memory access but that day is far.

I think I give up on argumenting with you. But look at the screenshot and believe me- there is no disassembly and you can not use inline assembler for x64.
Because you are not writing a native C/C++ applications,you are writing .net application which are in MSIL and you dont need disassembler in .net because most of the source codes are avalible to you and the rest unmanaged part you are not allowed to work with it in .net but in native we can work in those part and thats why its powerful ,yes .net have its own disassembler to see MSIL ,you will find it in .net's directory

When I compile the PICKIT2 source for x32, it simply will not work.
What PICKIT2? Microchip's PICKIT2? What you want to compile Microchip's mcu's code in visual studio ? I didnt understand anything
Some Win32 programs still work but many actually don't.
Which dont, name them

Let me be clear I am not saying .net programs are not useful or we shouldnt use it to program.I am just saying the difference between .net and native applications.
.Net is useful in many places,the biggest advantage in .net is grabage cleaner /memory releasing ,sometimes in native it becomes a big pain.
 

takao21203

Joined Apr 28, 2012
3,702
Thank you for taking the efforts to explain.

And yes it's the Microchip PICKIT2. I used it some years ago.
The purpose to recompile was to make it work at all.

I used regular C++ about 10 years ago. I don't use it now.

So is there still IA32 Windows 8?

When I saw Microsoft people speaking, nobody ever mentioned assembler, or demonstrated disassembly in any kind. For them it almost does not exist now. They do not want to touch it.

Assembler for drivers is needed in a few cases, not always.

No of course Visual Studio is not the only C++.

But there are not so many good compilers. Intel has one. Then there is Apple. And Linux distributions.

I have a problem with Dungeon Siege 1 particulary. I tried to search online but no solution. I want to try it on a WinXP laptop...maybe it works.
 

kubeek

Joined Sep 20, 2005
5,795
And yes it's the Microchip PICKIT2. I used it some years ago.
The purpose to recompile was to make it work at all.
I don´t understand this. Do you mean you tried to compile the firmware for PICKIT2 in visual studio? That makes no sense, as visual studio compiles for x86/x64 procesors, and I doubt those are inside the PICKIT2.
Or you tried to make programs for PIC chips that will be burned by the PICKIT2? Please explain.
 

takao21203

Joined Apr 28, 2012
3,702
I don´t understand this. Do you mean you tried to compile the firmware for PICKIT2 in visual studio? That makes no sense, as visual studio compiles for x86/x64 procesors, and I doubt those are inside the PICKIT2.
Or you tried to make programs for PIC chips that will be burned by the PICKIT2? Please explain.
The standalone software for the PICKIT2.
 

debjit625

Joined Apr 17, 2010
790
The standalone software for the PICKIT2.
That didnt explain anything... PICKIT2 is a programmer/debugger hardware unit,you connect it to your computer and using MPLAB you download your PIC code to your mcu.Are you are trying to compile PIC's mcu code in visual studio C++ compiler, then forget it.

So is there still IA32 Windows 8?
Check my earlier post I posted a link their about this,and the answer is yes

When I saw Microsoft people speaking, nobody ever mentioned assembler, or demonstrated disassembly in any kind. For them it almost does not exist now. They do not want to touch it.
They are doing business ,they want .net to be all over and get the whole market, they them self use native to built their softwares Microsoft Visual Studio is itself built in native and Windows 8 and other windows operating systems too.But again .NET is not that bad its good but you can't run it on other platform like Linux,Mac(Apple's OS),I like it

Assembler for drivers is needed in a few cases, not always.
They are built using a mix of assembly and native C,we debug them is assembly most of the time.

But there are not so many good compilers
That depends on person to person,which compiler is good ,as per me any C/C++ compiler is good which is using ISO standards.

Then there is Apple. And Linux distributions.
I think you meant OS not compilers ?

I have a problem with Dungeon Siege 1 particulary
Well you can count games as softwares but they are bit different ,because the resources they need to run is quite big and sometimes programmers use some so platform dependent stuff in it to make it fast,that they are unable to run on other platforms, normally games are built for a specific platform you play it at that time and in future you get new games to play. Check out the system requirements and if its a new version of windows where you are trying to run it use "Compatibility mode" to run it.
But if the game is using some specific platform dependent stuff ,then it will not run.

Good Luck
 

takao21203

Joined Apr 28, 2012
3,702
That didnt explain anything... PICKIT2 is a programmer/debugger hardware unit,you connect it to your computer and using MPLAB you download your PIC code to your mcu.Are you are trying to compile PIC's mcu code in visual studio C++ compiler, then forget it.
This ^^

It's hilarious reply.

Which MPLAB? It has changed a lot.

How do you know if and how well MPLAB works with PICKIT2 on a particular machine?

NOT ^^

That is.

So, one is forced to use the standalone software.

To me it's obvious you never used PICKIT2.

May I ask whay region or country you are from?

Here in Europe inline assembler is quite dead for a number of years now.

And yes there is disassembly for x64:
 

Attachments

Last edited:

debjit625

Joined Apr 17, 2010
790
takao21203 said:
This ^^

It's hilarious reply.

Which MPLAB? It has changed a lot.

How do you know if and how well MPLAB works with PICKIT2 on a particular machine?

NOT ^^

That is.

So, one is forced to use the standalone software.

To me it's obvious you never used PICKIT2.
Actually when all this started you just made up your mind ,that some how you have to get me.

For the first time I thought, you wanted to learn something but you proved me wrong, here I am not fighting with you buddy I was just trying to share my knowledge with you but it seems you don't need it at all. I will not gain anything by lying to you.I may be 24 and a bit younger programmer but I know what I know ,I just dont make up things ,thats not my nature


PICKIT2 is old so you need old versions of MPLAB to work with it. If you are using newer version of MPLAB then use newer hardware too like PICKIT3 (I use ICD2)

This file explains how to debug using PicKit2 in MPLAB
http://ww1.microchip.com/downloads/en/devicedoc/51553e.pdf
 

Attachments

MrChips

Joined Oct 2, 2009
30,806
Will you two please go discuss your differences someplace else?
You've hijacked this thread and scared away the poor OP.
 

takao21203

Joined Apr 28, 2012
3,702
Will you two please go discuss your differences someplace else?
You've hijacked this thread and scared away the poor OP.
Well as for my part I definitively don't talk about technology I don't use or don't understand at all.

Misunderstandings, maybe due to language, and maybe ethical. Nothing serious. I have other things to do, and I do these things.

I am not offended. OPs questions were actually answered.
So a little thread hijacking, yes.

Maybe our english grammars sound a bit offensive to each other, while indeed, there is not really a problem.
 
Top