Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sahar Mosleh California State University San MarcosPage 1 Assembly language and Digital Circuit By Sahar Mosleh California State University San Marcos.

Similar presentations


Presentation on theme: "Sahar Mosleh California State University San MarcosPage 1 Assembly language and Digital Circuit By Sahar Mosleh California State University San Marcos."— Presentation transcript:

1 Sahar Mosleh California State University San MarcosPage 1 Assembly language and Digital Circuit By Sahar Mosleh California State University San Marcos smosleh@csusm.edu

2 Sahar Mosleh California State University San MarcosPage 2 The Goal In this course, we are learning Some basic principals of computer architecture applied to Intel IA-32 Basic Boolean logic and how it applies to programming and computer hardware. Memory management of IA-32 using real mode, protected mode and virtual mode. How a compiler translate High level language statement to assembly. How implement arithmetic expressions, loops, and logical structures with assembly. You may also learn about data representation, including signed and unsigned integers, real numbers, and character.

3 Sahar Mosleh California State University San MarcosPage 3 Programming Languages Overview A program is written in a high level programming language - not English or other natural languages. Different levels of languages are: Machine Language: Operates data in terms of 0's and 1's. Lowest level commands understood by a particular machine. Assembly Language: it consist of operation names and data address. It works as middle ware between machine language and high level language. High-level language: higher level readable statements that can be translated into various Machine Languages. If a program written in a high level language, and can be understood by various compilers without modification, then it is PORTABLE. An organization called ANSI contributes to standardizing languages and thus making them more portable.

4 Sahar Mosleh California State University San MarcosPage 4 Below Your Program To speak to your machine, you need to send electronic signals. The easiest signal is on/off The two symbols for these two signals are 0 and 1. We commonly think of machine language as binary numbers which are base 2. Example of binary number 1000110010100000 The above binary code tells the computer to add two numbers

5 Sahar Mosleh California State University San MarcosPage 5 Any digit of this binary number is called bit 1000110010100000 Each byte is 8 bits Any collection of 0 and 1 which can make a binary number is a command or instruction that your computer understands The system program that translates a command such as add eax, 10 To machine language ( binary code ) 1000110010100000 Is called an Assembler One bit One Byte = 8 bits

6 Sahar Mosleh California State University San MarcosPage 6 An example of a high level language in C/C++ for adding two numbers is: void main() { C = ( Y + 4 ) * 3 ; } Another system program called Compiler will compile these high level language to assembly language statement which is mov eax, Y add eax, 4 mov ebx, 3 imul ebx mov C, eax Then assembler will translate this statement into binary instruction

7 Sahar Mosleh California State University San MarcosPage 7 void main() { C = ( Y + 4 ) * 3 ; } mov eax, Y add eax, 4 mov ebx, 3 imul ebx mov C, eax 00000000100011100001100000100001 10001100011000100000000000000000 10001100111100100000000000000100 10101100111100100000000000000000 00000011111000000000000000001000 C Compiler Assembler High-level language program (in C) Assembly language program Binary machine language program

8 Sahar Mosleh California State University San MarcosPage 8 Execution Cycle Obtain instruction from program Determine what the instruction is Deposit result in storage for later use Perform the Execution Locate and obtain operand data Determine successor instruction Instruction Fetch Instruction Decode Operand Fetch Execute Result Store Next Instruction


Download ppt "Sahar Mosleh California State University San MarcosPage 1 Assembly language and Digital Circuit By Sahar Mosleh California State University San Marcos."

Similar presentations


Ads by Google