In dos one was forced to use segment registers interupts and such, operating system just loaded program to memory and procesor was just reading it. But while making asm in win32 we dont use this registers, but we know that windows is using them, so (as i think) OS have to interpret our code so it can be used by procesor. Also what's the point in optimizing speed in multitasking OS since who knows wich instruction will be going next ???
Posted on 2004-03-19 06:19:28 by AceEmbler
Windows is just like any other piece of software you run on your computer.

Segment registers are no longer used, because when you change to Protected Mode (as Windows does), segment registers become Selectors.

Code is still executed by the processor as it was in DOS (well, in a way - the processor still reads memory and executes the code). The difference is, Windows can automatically switch between different programs when it feels like it.
Posted on 2004-03-19 06:32:24 by Sentient
Furthermore, a protected mode OS doesn't (well, shouldn't - there's some wacky OS ideas among some people) let you access the internal control tables, like the segment descriptors. Windows uses a 32bit flat memory model, so there's no real reason for you to mess with selectors/descriptors anyway - you can access your entire address space without having to juggle stuff around.


so (as i think) OS have to interpret our code so it can be used by procesor.

Nope, code is still run as-is. There's more information in the executable files, and things like relocations might be applied - but the code itself runs as-is. (Unless you're running 32bit x86 code on a 64bit Alpha with windows NT - but that's a rather different story ;)).




Also what's the point in optimizing speed in multitasking OS since who knows wich instruction will be going next ???

Compare optimized and unoptimized code and see for yourself ;)
In DOS, your code won't execute 100% linearly either, because of the hardware interrupts. The real-time clock will interrupt your program often, for instance, the default is 18.2 times a second. Mouse, keyboard, network card, ... - there's a lot of program flow deviations. In windows there's "a lot more" - the clock is programmed to hit more often, since it's used by the task scheduler. However, your threads are guaranteed to run for a certain "time quantum", so it's not like execution jumps around randomly and at each and every instruction.
Posted on 2004-03-19 08:03:22 by f0dder
Also what's the point in optimizing speed in multitasking OS since who knows wich instruction will be going next ???

Also remember, your program can normally run THOUSANDS of instructions between task switches. It's not like you run a few instructions from task 1, then a few from task 2.

:)
Posted on 2004-03-19 10:04:10 by S/390
How to unoptimize a programm..


What if you put add eax, 0 like 300 times in the start of a proc???



Have a nice day or night.
Posted on 2004-03-19 10:06:28 by rea
Also other thing parallel to this, is:

For what learn "classical programming", if after some time from now, will exist quantum computers, and we will be programming in a diferent way....



What you think?
Posted on 2004-03-19 10:25:42 by rea
1) It will take a while from now before Quantum computers are available, and even longer before they are available to the general population.

2) Quantum computing will probably not be applicable to all computing tasks, so traditional computers + programming will exist for a long while to come.

3) I think it makes more sense to think of it as a "Quantum computing device" than a "Quantum computer".
Posted on 2004-03-19 10:29:54 by f0dder
For one yes :D

The 2 If you can direct me to what types of computations cant be done ;) plz. Also I think now, then probably not all the problems or computations can be done with the actual types of programming (I think that is true and the probablitity is defacted.. ).



When I refer to the: For what learn..., is for show that the insecurity of "for what optimize..." is near to this, like you show, for now is not a problem think that my actuals skills at programming will not be usefull, because actually there not exist the necesity of learn that. And we will be using the programming that we know, the posibility that maybe the next generation of programmers learn other techniques, or the posibility that who know what instructions is next, is comparable.



What I whant say is that yes, for now is important to optimize, and like you know, not only optimize the code, but optimize or find the best solution to your actual problem and requeriments. Because they matter.


Have a nice day or night.
Posted on 2004-03-19 10:55:01 by rea