x86_64 systems maintain full 16-bit compatibility, it's just that 64-bit Windows (since Vista) dropped the compatibility layer allowing it to run DOS programs. It's understandable, since that would require allowing random programs in DOS mode to do whatever they wanted to the hardware, which is a gigantic security risk.

If you wanted to run straight DOS on the hardware, it would work fine. All modern x86 processors boot into real mode (8086) then work up the mode stack until they're running in long mode (x64) with software.
Tari, fascinating, that's all news to me; I didn't think modern x64 processors had 8086 mode still. Thanks for the info!
That makes sense, but is still disappointing.

On an unrelated note, is anyone else as creeped out as I am by Tari's avatar?
KermMartian wrote:
DShiznit wrote:
harold wrote:
They're practically the same language, x64 has some new stuff and drops some old stuff though.
x64 is usually not significantly faster by itself (the extra registers don't matter much, L1 cache is fast), but x64 support implies SSE2 support so you can use that without checking for support and you can use more than 2GB (3GB if booted with /3GB option or 4GB on 64bit OS and LargeAddressspaceAware bit set) RAM without having to use Address Windowing Extensions.


Is that why Vista/7 64 boots faster on 3 or more gigs of RAM than XP?
I wouldn't say that that is quantitatively true; as harold implies, it depends a lot on the software and hardware configuration. I'd say Vista/7 are just faster than XP in general, although that could be biased by having running Vista/7 on faster hardware.

Scout, as stated by others, the main difference in 64-bit x86 is that you have 64-bit registers, and more of them. 64-bit x86 CPUs can operate in 32-bit emulation mode, hence why 32-bit programs can still be run on them.


As in Z80 Asm I have like 10 registers or something, in x86-32bits I have x register and in x86-64bits I have x+b registers? So it's easier to code?

Thanks
Rather more hideous than that, unfortunately, since the system has been revised so much:

8086
4 16-bit GPRs: ax, bx, cx, dx, each also usable in 8-bit halves (ah, al, etc)
4 segment registers: cs, ds, ss, es
2 index registers, si and di
Various other special registers: sp, bp (stack and frame pointers), ip (instruction pointer)...
80386
Expands the GPRs to 32bits wide, as eax, ebx, ecx and edx. All other registers become 32 bits wide as well, but with the same names.
Two more segment registers, fs and gs.
AMD64
All registers are further expanded to 64 bits wide (rax, rbx...). Eight more GPRs added (r8-r15), and old registers may also be referred to as r0-r7 (rax-rdx, rsi, rdi, rsp, rbp).

There are a number of other registers that you'll rarely need, as well, although the 128-bit-wide XMM (XMM0-7) registers are important if using SSE instructions (and those are expanded to 256 bits with AVX), and you have the x87 stack (ST0-7).
Thanks Tari, I also think I got another OS thing. ASM coders can use BCalls which are the pre-included routines (a library of them!).

What do you call them in, for example, x86?
Kerm, a reference for Tari's statement: http://en.wikipedia.org/wiki/X86-64#Operating_modes
Scout, I think they're just called "system calls". I might be wrong, though.
Yeah, I think BCall is short for Banked Call (because it has to swap in the correct page into the bank to run the routine). I could be wrong though. But yeah, I think syscalls is the general term.
KermMartian wrote:
Tari, fascinating, that's all news to me; I didn't think modern x64 processors had 8086 mode still. Thanks for the info!


All BIOS based PCs still *boot* in 16-bit real mode, including the legacy direct access to GPU memory. You can install DOS 1.0 on an Intel i7 - and it'll work.

Quote:
Thanks Tari, I also think I got another OS thing. ASM coders can use BCalls which are the pre-included routines (a library of them!).

What do you call them in, for example, x86?


You don't call them anything in x86, because that is not an assembly-level construct. Razz

Nitpick aside, for a desktop OS you will need to link against various libraries and call functions in them. System calls are calls to the kernel itself - you don't want to be making any of those.

Also, here is an Intel white paper introduction to x64 assembly: http://software.intel.com/en-us/articles/introduction-to-x64-assembly/?wapkw=%28video%20encode%20white%20paper%29

But let me be clear, you really, REALLY do not want to work in just assembly on a desktop OS. Coding various routines in assembly inside a C program is fine and reasonably well documented on how to do that. Coding a pure assembly program is going to be a hellish experience. It is not well documented at all (if you can even find any documentation whatsoever).
Quote:
But let me be clear, you really, REALLY do not want to work in just assembly on a desktop OS. Coding various routines in assembly inside a C program is fine and reasonably well documented on how to do that. Coding a pure assembly program is going to be a hellish experience. It is not well documented at all (if you can even find any documentation whatsoever).


I guess I'll really try that, I know we can use stuff like __asm__ right?

I'll really do that.
ScoutDavid wrote:
I guess I'll really try that, I know we can use stuff like __asm__ right?

I'll really do that.


VC: http://msdn.microsoft.com/en-us/library/4ks26t93.aspx

GCC: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html

VC has the far nicer inline assembly support tbh. It is easy to call other C functions with it, access data from C, etc... GCC is kind of a PIA. I tended to resort to just putting all my assembly in a different file and calling it from C when working with GCC.
ScoutDavid wrote:
Thanks Tari, I also think I got another OS thing. ASM coders can use BCalls which are the pre-included routines (a library of them!).

What do you call them in, for example, x86?


"Syscall" is the term for a general system call. Bcall is a specific term that has to do with paging, as Calc84 said. However, you generally won't be making many system calls in x86 ASM.

If you're serious about learning x86 (or x64, although almost all of the necessary information is essentially undocumented for that), then my advice would be to forget basically everything you know about z80 ASM. Computer Assembly is vastly different. The best advice I can give you is to find a 32 bit computer running something like Windows 2000 and then join a dedicated forum and start asking questions.

If you want a documented Assembly language that's in the same general style of computer programming (stack based/register based architecture implementation differences aside), then I highly recommend Java Bytecode (Jasmin is my favorite Java assembler). Java bytecode is well documented and it's essentially impossible to screw up your computer with it, although it's not exactly easy to do that with how regular computer ASM works anyway.
I have a new question:

What are partitions and how do they work together with hard drives and OSs?
I know a bit about partitions, but don't know how they relate to hard drives (C:/ and D:/, etc.) and OSs. Thanks!
ScoutDavid wrote:
I have a new question:

What are partitions and how do they work together with hard drives and OSs?
I know a bit about partitions, but don't know how they relate to hard drives (C:/ and D:/, etc.) and OSs. Thanks!
A hard drive is a physical object that's in your computer. A hard drive must contain one or more partitions in order to be used. For example, if you have a 150 GB hard drive, you can create one partition that's 150 GB large. It'll show up as C:\ (if you use Windows). You can also create multiple partitions. For example, you can have one that's 100 GB and one that's 50 GB, for a total of 150 GB space. The first partition will show up as C:\ and the second one will show up as D:\. Installing multiple OSes to one partition is incredibly complex, and in most cases impossible. Because of this, you need at least one partition for each OS.
Can I have files like folders and documents in partitions or only in FAT32 stuff?

Thanks JosJuice, that was really helpful.
ScoutDavid wrote:
Can I have files like folders and documents in partitions or only in FAT32 stuff?
I'm not sure what you mean... A partition can be formatted in a few different ways. Most of the formats, such as NTFS and FAT32, will allow you to store files and folders just like you normally do.
Does the 83+ use partitions?
ScoutDavid wrote:
Does the 83+ use partitions?
No.
ScoutDavid wrote:
Can I have files like folders and documents in partitions or only in FAT32 stuff?

Thanks JosJuice, that was really helpful.
Can you explain what exactly you're asking there? Partitions are just a way to divide up the space on a hard drive or other storage device into sections; it's up to the file system defined in each partition to decide how to organize the space or what to do with it.
Let's say I wanted to install a Linux distro, Mint for example on my USB drive. Could I still use it as FAT32? I don't think so, it'd have to be ext4.

So is FAT32 for files and such?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 5
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement