انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية العلوم للبنات
القسم قسم الحاسبات
المرحلة 3
أستاذ المادة اسراء هادي عبيد السلطاني
04/06/2018 08:32:13
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
Addresses and Instructions Three-address code is built from two concepts: addresses and instructions. An address can be one of the following • A name: In an implementation, a source name is replaced by a pointer to its symbol-table entry, where all information about the name is kept. • A constant: In practice, a compiler must deal with many different types of constants and variables. • A compiler-generated temporary: It is useful, especially in optimizing compilers, to create a distinct name each time a temporary is needed. We now consider the common three-address instructions and below is a list of this instructions forms: 1. Assignment instructions of the form x = y op z, where op is a binary arithmetic or logical operation, and x, y, and z are addresses. 2. Assignments of the form x = op y, where op is a unary operation. 3. Copy instructions of the form x = y, where x is assigned the value of y. 4. An unconditional jump goto L. The three-address instruction with label L is the next to be executed. 5. Conditional jumps of the form if x goto L and if False x goto L. These instructions execute the instruction with label L next if x is true and false, respectively. 6. Conditional jumps such as if x relop y goto L, which apply a relational operator (<, ==, >=, etc.) to x and y, and execute the instruction with label L next if x stands in relation relop to y. If not, the three-address instruction following i f x relop y goto L is executed next, in sequence. 7. Procedure calls and returns are implemented using the following instructions: Func begin Func end Param T … Call P,n Return p Param p (place value parameter p on the stack) Refparam p ( place refrence parameter p on the stack) 8. Indexed copy instructions of the form x = y[i] and x[i] = y. The instruction x = y[i] sets x to the value in the location i memory units beyond location y . 9. Address and pointer assignments of the form x = & y, x = * y, and * x = y. The instruction x = & y sets the r-value of x to be the location (l-value) of y.
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
الرجوع الى لوحة التحكم
|