1.2.4 Types Of Programming Languages Flashcards

1
Q

What is assembly language?

A

Assembly language is the next level up from machine code and is part of a family of low level languages. This is converted to machine code using an assembler when it is executed.

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

Why is assembly langauage eaiser to use than direct machine code?

A

Assembly language uses mnemonics rather than binary, which makes it easier to use than direct machine code.

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

ADD

A

Add the value at the given memory address to the value in the Accumulator

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

SUB

A

Subtract the value at the given memory address from the value in the Accumulator

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

STA

A

Store the value in the Accumulator at the given memory address

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

LDA

A

Load the value at the given memory address into the Accumulator

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

INP

A

Allows the user to input a value which will be held in the Accumulator

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

OUT

A

Prints the value currently held in the Accumulator

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

HLT

A

Stops the program at that line, preventing the rest of the code from executing.

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

DAT

A

Creates a variable with a label at which data is stored.

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

BRZ

A

Branches to a given address if the value in the Accumulator is zero. This is a conditional branch.

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

BRP

A

Branches to a given address if the value in the Accumulator is positive. This is a conditional branch.

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

How do you open a file called sample and read a line from it in pseudocode?

A

myFile = openRead(“sample.txt”)
line = myFile.readline()
myFile.close()

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

How do you print every line of a text file called sample in psuedocode?

A

myFile = openRead(“sample.txt”)
while NOT myFile.endOfFile()
|||print(myFile.readLine()
endwhile
myFile.close

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

How do you write “Hello World” to a file called sample in psuedocode?

A

myFile = openWrite(“sample.txt”)
myFile.writeLine(“Hello world”)
myFile.close()

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

How do you create a new file called sample in pseudocode?

A

newFile(“sample.txt”)

17
Q

What are the 6 functions you can perform on a file?

A

open(…)
.close()
.readLine()
.writeLine(…)
.endOfFile()
newFile()