Week 6 Flashcards

1
Q

What is goto statement equivalent to in assembly language?

A

Jump

It unconditionally transfers control to a statement other than the next one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why has goto been discouraged in modern HLL programming?

A

it can be replaced by control structures which support structured programming.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an address?

A

It’s a number giving the location of some info in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a label?

A

It’s used in assembly language as a symbolic name of an address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are conditional jumps?

A

JUMPF and JUMPT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are some common control constructs in HLLs?

A

for loops, while loops, if then else structures

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you translate the if-statement in a HLL to assembly language:
x=2;
if(y>x){a=5;}
b=6;

A

See lecture 6.3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you translate the if-then-else HLL statement to assembly language?

x=2;
if(y>x){a=5}
else{c=7}
b=6;

A

See lecture 6.3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Are while and for loops bounded or unbounded iterations?

A

In modern HLLs, while statements are unbounded. For loops are bounded.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can we turn while and for loops into assembly language?

A

By using goto statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly