170 likes | 307 Views
Chapter 6. In introduction to System Software and Virtual Machine ***Assembly Language. Operating System. OS – is the program that control the overall operation of the computer, and it is the single most important piece of system software on a computer.
E N D
Chapter 6 In introduction to System Software and Virtual Machine ***Assembly Language
Operating System • OS – is the program that control the overall operation of the computer, and it is the single most important piece of system software on a computer. • It is the interface between the users and the all other hardware and software resources in a computer system.
Different OS in Different Systems • There are many different OS which operating on different computer systems. • For the beginners, the GUI (graphical user interface), such as Windows, is a typical OS. • The other OS examples are UNIX, DOS, the OS for IBM mainframe computers,…
The main Function of an OS Operating Systems Utilities Language Services Memory Managers Information Managers Scheduler Loaders Garbage Collectors Linkers Text Editors Graphics Routines … … Interpreters Assemblers Compilers File Systems Database Systems
What kind of language to write OS? • It depends on different systems and application’s preference. • Open system versus Non-open Systems
Assembly Language • ? Assembly Language Program assembler Machine Language Program Loader Results .EXE ->Memory Hardware
The ASS in Our Simulator • Let’s take a close look one by one: • 1. 0000 --- Load X Contents in [X] R • Here X is a memory address and R is the register (implied) • Example: 0000 0000 0000 0101
STORE X • 0001 --- STORE X R [X] • The content inside R memory location X • Example: 0001 0000 0000 0111 • However, in most situations, we use a symbol to represent X.
CLEAR X and ADD X • 0010 – CLEAR X 0 [X] • 0011 – ADD X ---------------- R+[X] R
INCREMENT X and SUBTRACT X • 0100 – INCREMENT X ---[X]+1 [X] • 0101 – SUBTRACT X --- R-[X] R
DECREMENT X and COMPARE X • 0110 – DECREMENT X -----[X] – 1 [X] • 0111 – COMPARE X • 1. if [X] > R then GT=1, else GT=0 • 2. if [X] = R then EQ=1, else EQ=0 • 3. if [X]<R then LT=0, else LT = 0
JUMP X and JUMPGT X • 1000 – JUMP X -Get the instruction from address X unconditionally. • 1001 JUMPGT X Get the next Instruction from X only if GT=1 • **** X could be a symbol to represent any legal address
JUMPEQ X and JUMPLT X • 1010 – JUMPEQ X Get the next instruction from X only if EQ=1 • 1011 – JUMPLT X Get the next instruction from X only if LT=1
JUMPNEQ X and IN X • 1100 – JUMPNEQ X Get the next instruction from X only if EQ=0 • 1101 – IN X Input a integer value from the standard input device and store it into X. • The standard input device is the Keyboard.
OUT X and HALT • 1110 – OUT X Output the number stored in X to display in decimal form. • HALT – Stop Program Execution.
.BEGIN and .END • To indicate the beginning and the end of the program.
*** Separate Code and DATA • Always put the DATA after the HALT Instruction to prevent the wrong action from the program.