150 likes | 320 Views
Computer Platforms. Week 4: Assembly Language & Operating Systems. Assembly Language. Is at a level below programming languages Eg.- C++, Java, Pascal Assembly language is converted into machine code Machine code is raw data that would take ages for a human to decipher
E N D
Computer Platforms Week 4: Assembly Language & Operating Systems
Assembly Language • Is at a level below programming languages • Eg.- C++, Java, Pascal • Assembly language is converted into machine code • Machine code is raw data that would take ages for a human to decipher • This is the data and instructions which is used by the Fetch Execute Cycle
Assembly Language • Programs or sequences can be written in assembly language • Which is what is effectively done when we compile a C++ program • Why write in assembly language? • Faster (direct) access to CPU • Some programs need to be written to operate at a lower level • E.g.- Device Drivers
A simple Assembly program (Honest!) org 100h mov dx,msg mov ah,9 int 21h mov ah,4Ch int 21h msg db 'Hello, World!',0Dh,0Ah,'$'
A simple Assembly program (Honest!) org 100h mov dx,msg mov ah,9 int 21h Tells the compiler (NASM) the program will be loaded at memory address 100h Moves the address of our message (msg) into a register which is known as the DX Register (Data Register) Moves the value 9 into a register called the AH Register ‘int’ calls an ISR (interrupt service routine) “DOS Services” this is correlated with contents of AH (9) to determine that we want to output a message– contents of DX (msg)
A simple Assembly program (Honest!) mov ah,4Ch int 21h msg db 'Hello, World!',0Dh,0Ah,'$' Effectively tells the processor to stop. Otherwise it will try to fetch and execute the next instructions it comes to msg is a variable name (the name of out message string) db is an instruction to the compiler to use the information the follows as data Then out message ‘Hello, World!’ (note: ‘ ‘ marks) 0Dh, 0Ah – performs carriage return and line feed $ terminate string output – (int 21h & 9 in ah requirement)
A simple Assembly program (Honest!) • OK, so what does it actually do? • Output “Hello, World!” to the screen • How? • Type the program into a text document and call it ‘hello.asm’ • Use the NASM program • This is used to compile assembly language programs • Rename the produced file as type COM • ren hello hello.com • Run the program • hello
A simple Assembly program (Honest!) • Step by Step:
Operating Systems • The main piece of software you interact with • Application run ‘on top’ of the OS • Is started up with the computer • Boot process • Also deals with organising files and directories on storage media • How physical data on the disk is organised logically in the OS
Windows Boot Process • What happens when a Windows PC is kicked into life? • System goes through low-level boot procedure • POST • Device / system initialisation • Warm boot stage initialises • Search for boot record • IBMBIO.COM then IBMDOS.COM (booting DOS) • COMMAND.COM then AUTOEXEC.BAT loaded • This starts the Windows programs running
Windows Boot Process • Getting things to load at start-up • Start-up Folder • Easy to configure • Useful for application loading • System Files • AUTOEXEC.BAT • CONFIG.SYS • WIN.INI • SYSTEM.INI • Historically used for DOS tweaks • Harder to configure
Windows Boot Process • Getting things to load at start-up • Windows Registry • Contains system & essential information for software and hardware on the PC • Stores many settings • Hard to configure (?) • Easy for an amateur to screw up! • Can point to application (EXE) files to run on start-up or on certain actions • Common place for viruses to hide!!!
File Systems • FAT 16 • Or just ‘FAT’ • Used by DOS and Windows 95 backwards • FAT 32 • Used in Windows 95 (B) – current • NTFS • New Technology File System (MS) • 32-bit • Secure • Used in Windows NT/2000/XP
File Systems • HPFS • High Performance File System • 32-bit • Used in OS/2 (remember that?) • ISO 9660 • CD-ROM • ISO 13346 • DVD