Andy wrote: >so if I write a program either in C/C++, assembly language or machine >language, I must have a *thorough* knowledge of the inner workings of >the OS, DOS, Windows, *nix that I am writing the program to run on, >*before* I start writing the the code (not necessarily the program) No. You need to know the language. And thereby not use functions/interupts that are OS/hardware specific (this is often stated in the help section for the function). But you are probably screwed if you think you can just recompile an assembler program for another hardware platform, and even more so with machine code. >would you write a DOS, Windows or *nix app in assembly language or machine >language? You would most definately use a language higher up for Windows, atleast at C's level but most people use an object oriented language (C++, Delphi, Java, VB etc.) to program in an object oriented environment (Windows, X etc.) > maybe assembly but does machine language "go too deep" to be >used for a windows app?? I know when writing a machine language program >one must have a thorough knowledge of the inner workings of/all the, >*CPU chip*(Not OS) calls, specifications etc. Using either ASM or machine language is of course possible, but you would need to learn EXTREME much about how Windows works internally. It would probably be much easier to learn C/C++ from scratch then to do what you suggest. Knowing a higher level leanguage will also make you more productive. (ie. someInternalWindowsFunction() instead of a whole bunch of ASM lines). >p.s. if machine language is appropriate for OS creation, what >specifically is assembly language appropriate for? Assembler is useful for TSRs, OS creation (you don't use machine language for that), and speed significant parts of a program. It can also be used for embedded devices, but it's loosing (strangely enough) that market more and more. > I am concluding that in order to succesfully write *code*, C/C++ or >otherwise, one must have a thorough knowledge of both, the CPU chip and >memory constraints(hardware) And the OS which the code is to be executed >on... alot to study for the programmer(s)!! It of course helps to make the program better. But you don't have know one thing about the OS in most cases (in a high level language). You seem to assume that all languages have the same problems as assembler/machine language has. They don't. To make a program to do something as simple as write to the screen (aka a "Hello world!" program) doesn't require any knowledge of the OS or hardware in C/C++, in ASM however you do need that. For more complex programs where you need to take advantage of the things around the program for things such as graphics, TCP/IP and files you do need to learn how to call functions/procedures to do them. But I still don't need to understand the OS to use BSD Sockets (simplification: TCP/IP in UNIX systems) since it's (almost anyway) the same functions and other things everywhere. > The hardware that your applications will be able to use >> is determined by your choice of compiler, and the way you >> choose to configure it. ^^^^^^^^^^^^^^^ > ^^^^^^^^^^^^^^^^^^^^^^\ > what does this mean? The target platform. For instance you can compile for another platform then the one you are actually on (ie. programs for palmtops) BTW: You reduced crossposting now, but it was still to two lists :( //Bernie
