flat assembler
Message board for the users of flat assembler.
Index
> Main > 32bit/64bit Goto page 1, 2, 3 Next |
Author |
|
LocoDelAssembly 22 Apr 2009, 18:46
There is no such thing as an instruction to switch, there is a procedure required to do such a switch and in general no OS allows you to do it.
As for the PD: what about cmp dword [esi], "ABCD"? |
|||
22 Apr 2009, 18:46 |
|
Azu 22 Apr 2009, 18:50
LocoDelAssembly wrote: There is no such thing as an instruction to switch, there is a procedure required to do such a switch and in general no OS allows you to do it. LocoDelAssembly wrote: As for the PD: what about cmp dword [esi], "dcba"? Won't work for newline/carriage return/null/etc characters.. |
|||
22 Apr 2009, 18:50 |
|
LocoDelAssembly 22 Apr 2009, 18:58
Quote:
OK, no way then... Quote:
Because privileged instructions are required to do that and normally the OSes are protected mode, not real mode (like DOS). |
|||
22 Apr 2009, 18:58 |
|
Azu 22 Apr 2009, 19:05
LocoDelAssembly wrote:
Thanks anyways. LocoDelAssembly wrote:
|
|||
22 Apr 2009, 19:05 |
|
MazeGen 22 Apr 2009, 19:54
"64-bit execution" requires new 64-bit mode. Your question is similar to "why can't I use paging in real mode?". You can't because the feature is not there.
|
|||
22 Apr 2009, 19:54 |
|
Azu 22 Apr 2009, 19:57
So processes in protected mode can't be 64bit? They have to be real mode to?
Why? |
|||
22 Apr 2009, 19:57 |
|
revolution 23 Apr 2009, 01:31
64bit is a whole different world from 32bit. Everything from the OS and drivers down to the apps have to know about it before you can start using 64bit code. The x86 architecture does not support on-the-fly instruction level selection of 64bit versions. It just doesn't work that way.
|
|||
23 Apr 2009, 01:31 |
|
Azu 23 Apr 2009, 01:34
revolution wrote: 64bit is a whole different world from 32bit. Everything from the OS and drivers down to the apps have to know about it before you can start using 64bit code. The x86 architecture does not support on-the-fly instruction level selection of 64bit versions. It just doesn't work that way. Why would you need different drivers just to use it in some tight internal loop in your program for the extra registers? From what the LocoDelAssembly said.. the instruction is there to do it? But user mode processes aren't allowed to use it? Why??? I don't want 100% 32bit program because the lack of registers makes it slow.. but I don't want 100% 64bit program because the 64bit addressing makes it big.. I know the OS and drivers can handle either one.. so I really don't see what the problem is with switching between? |
|||
23 Apr 2009, 01:34 |
|
revolution 23 Apr 2009, 01:44
Azu wrote: Isn't it just more/bigger registers and longer addressing? Azu wrote: Why would you need different drivers just to use it in some tight internal loop in your program for the extra registers? Azu wrote: From what the other guy said.. the instruction is there to do it? But user mode programs are blocked from this? Why?? |
|||
23 Apr 2009, 01:44 |
|
Azu 23 Apr 2009, 01:47
revolution wrote:
revolution wrote:
revolution wrote:
LocoDelAssembly wrote: Because privileged instructions are required to do that and normally the OSes are protected mode, not real mode (like DOS). I understand switching from protected mode to real mode is blocked because you can do things in real mode you aren't supposed to.. but you can make your program be 32bit or 64bit using normal OS executable formats. You aren't gaining additional access by switching between them. So why is it restricted? |
|||
23 Apr 2009, 01:47 |
|
revolution 23 Apr 2009, 01:54
Azu wrote: What else? o_o Azu wrote: But.. I can make a 32bit OR a 64bit version of my program.. and either of them run right without changing anything else on my computer! I can even run both versions at the same time. Azu wrote: I thought that meant there are instructions for it, but my program is just blocked from using them for some reason? |
|||
23 Apr 2009, 01:54 |
|
Azu 23 Apr 2009, 01:59
revolution wrote:
revolution wrote:
Lots have. Firefox for example. Go download the 32bit and 64bit versions and install them both. You can run them at the same time and visit the same website and nothing bad happens. Quote:
I haven't used any in over half a decade... |
|||
23 Apr 2009, 01:59 |
|
revolution 23 Apr 2009, 02:05
My mistake above, since most people are running 32bit OSes my natural assumption was that you are also. But never mind, since you are running a 64bit OS then you have noticed that you can run older 32bit apps. This is because in 64bit mode there are two sub modes, "native 64bit" and "compatibility". The OS will set everything up for 32bit apps to run in compatibility mode so that all the common apps still run. But you can't do that setup as a user space program.
|
|||
23 Apr 2009, 02:05 |
|
Azu 23 Apr 2009, 02:21
revolution wrote: My mistake above, since most people are running 32bit OSes my natural assumption was that you are also. But never mind, since you are running a 64bit OS then you have noticed that you can run older 32bit apps. This is because in 64bit mode there are two sub modes, "native 64bit" and "compatibility". The OS will set everything up for 32bit apps to run in compatibility mode so that all the common apps still run. But you can't do that setup as a user space program. I'll go read through the 1000 page manual now and try to figure out how the OS does it. Maybe there is some trick to do it in user mode (even if for some reason I'm technically not supposed to) at least for raw ASM? Like if I change it back to 32bit mode before calling any APIs? Haven't found anything useful so far though ;/ |
|||
23 Apr 2009, 02:21 |
|
revolution 23 Apr 2009, 03:45
Code must be running in ring0 to change modes. It is not possible for a user space (ring3) program to do it. This is by design, not some arbitrary limitation. Your search for a "trick" will be in vain.
|
|||
23 Apr 2009, 03:45 |
|
Azu 23 Apr 2009, 03:50
revolution wrote: Code must be running in ring0 to change modes. It is not possible for a user space (ring3) program to do it. This is by design, not some arbitrary limitation. Your search for a "trick" will be in vain. If it's by design there IS a reason, right? And if not, there must be some way around it.. |
|||
23 Apr 2009, 03:50 |
|
revolution 23 Apr 2009, 04:04
Hmm, well the OS and drivers is supposed to be trusted code so we don't expect any "evil" code to be there. In a perfect world all "evil" code should be run in ring3 where no damage would be possible. Anyhow it is not really about "evil" code, it is more about reliability. Apps can crash and generally not run well and the OS can still survive without issue due to the ring0/ring3 separation mechanism. Changing modes is an OS function, user apps have no business in there due to the potential reliability issues.
Read some more about OSes in general and learn about kernels and drivers. When you add that knowledge to the x86 mode changing mechanism then you will see why this is necessary. But it is too much to explain here in a forum posting. |
|||
23 Apr 2009, 04:04 |
|
Azu 23 Apr 2009, 04:07
revolution wrote: Hmm, well the OS and drivers is supposed to be trusted code so we don't expect any "evil" code to be there. In a perfect world all "evil" code should be run in ring3 where no damage would be possible. Anyhow it is not really about "evil" code, it is more about reliability. Apps can crash and generally not run well and the OS can still survive without issue due to the ring0/ring3 separation mechanism. Changing modes is an OS function, user apps have no business in there due to the potential reliability issues. |
|||
23 Apr 2009, 04:07 |
|
revolution 23 Apr 2009, 04:17
Azu wrote: Or am I misunderstanding something again (wouldn't be the first time lol)? |
|||
23 Apr 2009, 04:17 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.