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 Language Services Memory Managers Information Managers Scheduler Utilities Operating Systems Interpreters Assemblers Compilers Loaders Garbage Collectors Linkers File Systems Database Systems Text Editors Graphics Routines …
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.EXE ->Memory Hardware Results
The ASS in Our Simulator Let’s take a close look one by one: Load X Contents in [X] R Here X is a memory address and R is the register (implied) Example:
STORE X STORE X R [X] The content inside R memory location X Example: 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 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= – 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= – 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.