elias001 said:
@FactChecker if someone learns to understand assembly language through looking understand the hood of a C program, then take away their C programming, can they write a program from scratch in assembly? There are heaps of books on assembly for the ibm pc family of computers even before x86 architecture arrived on the scene. Can they program in assembly and know assembly better than someone who is learning it through how assembly language codes the syntax of a C program?
This is a confusing statement. The very first IBM PC used an Intel 8088 microprocessor, which is essentially the same instruction set as x86 except that it had 8-bit registers instead of 16 on an 8-bit duplexing bus, and so it ran a bit slower than an 8086. For many years thereafter, IBM compatible PC's ran the x86 instruction set (and some). Even as the Windows operating system evolved, command line programs written in the 1980s continued to execute adequately. Which is really remarkable, considering how much worse the Mac community has fared in terms of old software compatibility.
What made a PC compatible with the original IBM PC was also its boot ROM, the so-called BIOS, which was basically an API for the hardware. You could use a call to the BIOS, for example, to disable interrupts on the hardware, if you intended to poll the I/O ports directly. The BIOS was extended with some rewriteable memory at the beginning of its boot disk, so you could also tell the PC at boot time what kind of disk drives and other peripherals were attached. This had the useful effect to making it possible to buy a different hard drive for your PC from almost any vendor. You just had to format and low-level write the extended part of the BIOS "firmware" onto boot sectors of the new drive.
But the BIOS had disk drive size limitations, and in the late 1990s-2005, new Windows PCs replaced the BIOS with EUFI, and it was then not so possible for consumers to swap out disks. It was a needful change, but marked the end of cheap Windows PCs and easy at home tinkering for IBM compatible PCs.
So, you can learn the x86 instruction set using some kind of simulator. You can also run the instruction set on newer Intel based Windows PCs. But when talking about computer architecture, be sure to specify whether you mean "instruction set" architecture, or something like the IBM-compatible PC, which requires an instruction set architecture (either x86 based, which as in the CISC category, or ARM based, which is in the RISC category) as well as BIOS boot technology or EUFI boot technology. The latter determines how the computer loads it's operating system. Both the ISA and the boot method are required to make a machine IBM PC compatible.
Also, I wish to say I am happy to see anyone eager to learn assembler level programming. It becomes essential, not only to understand OS internals, but for topics such as dynamic vs static software libraries. At assembler level, you see how dynamic binding of a subroutine really works. You see how interrupt service routines work (and it's alternate I /O method, polling). If someone is going to code in robotics only using some high level language, they may never understand performance issues unless they learn assembler. This kind of theoretical understanding can also be useful in performance engineering using VM based programming languages such as Java- or .NET based programming.