Low level languages Flashcards

1
Q

What is machine language?

A

The language made up of binary coded instructions that is used directly by the computer.

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

What are the characteristics of machine language?

A

– Every processor type has its own specific set
of machine instructions
– The digital logic of the CPU recognizes the binary
representations of the instructions
– Each machine-language instruction does only
one (typically) very low-level task

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

What is a virtual computer?

A

A hypothetical machine designed to contain
the important features of a real computer that
we want to illustrate

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

How many instructions does pepe/8 have?

A

39

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

What is the PC, IR and accumulator?

A

– The program counter (“PC”) (contains the address
of the next instruction to be executed)
– The instruction register (“IR”)
(contains a copy of the instruction being executed)
– The accumulator (“A”)
(used to hold data and results of operations)

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

How large is the memory unit?

A

64Kb

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

What is a register?

A

A small area of memory in the ALU that holds special data that is usually accessed instantly.

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

What are the two parts of an instruction in pep/8

A

The instructions specifier(8 bit) and the 16-bit operand specifier.
The instruction specifier indicates which operations to be carried out such as add.
The operand specifier (second and third bytes) hold either the operand itself or the address of where the operand is to be found.

the format of the instruction specifier varies depending on the no. of bits used to represent a particular operation.the first 4/5 bits are is the opcode, if the 5 bit is not used in opcode it selects the register, and the last 3 bits is the addressing mode.

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

What is the addressing mode specifier?

A

3 bits.
indicates how to interpret the operand part of the instruction.
000 - the operand is in the operand specifier of the instruction. this is called immediate (i)
001 - the operand is in the memory address named in the operand specifier. this is called direct (d)

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

What are unary instructions?

A

These are instructions that do not have an operand specifier. they are 1 byte long rather then 3.

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

What is another name for the accumulator?

A

The A register

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

How many bytes long is the:
A register?
Instruction register?
Program counter?

A

A: 2 bytes
IR: 3 bytes
PC: 2 bytes

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

What does it mean when we say that a computer is a programmable device?

A

Programmable means that data and instructions are logically the same and are stored in the same
place. The consequence of this fact is that the program the computer executes is not wired into the
hardware but entered from outside.

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

List five operations that any machine language must include.

A

There must be machine-language instructions to store, retrieve, and process data, to input data and
to output data. These instructions mirror the operations of the von Neumann machine.

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

What is a virtual machine? Discuss this definition in terms of the Pep/8 computer.

A

A virtual machine is a hypothetical machine designed to illustrate important features of a real computer. The Pep/8 computer is a virtual machine designed to illustrate the features of the von Neumann architecture. It has instructions to store, retrieve, and process data as well as instructions to input and output data.

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

Describe the features of the Pep/8 CPU that we covered in this chapter.

A

There is one register for arithmetic and logical operations: the A register (the accumulator). There
is a Program Counter that contains the address of the next instruction to be executed and the Instruction Register that contains the instruction being executed. An operand may be immediate (stored in the instruction specifier) or direct (stored in the place named in the instruction specifier).

17
Q

How many mode specifiers are there?

Which ones are relavant and what are they?

A

8

000: instant meaning the data in the instruction specifier is the data to be used.
001: st

18
Q

How many bits are required to address the Pep/8 memory?

A

The Pep/8 memory contains 65,536 bytes, so 16 bits are required to address each one.

19
Q

What is a unary instruction?

A

An instruction that do not have an operand (data to be manipulated). they are only one byte.

20
Q
What is the code for eahc of these instructions and what do they do?:
STOP
LOAD THE OPERAND INTO THE A REGISTER
STORE CONTENTS OF A INTO OPERAND
ADD OPERAND TO A
SUBTRACT OPERAND FROM A
CHARECTER INPUT TO OPERAND
CHARECTER OUTPUT FROM OPERAND
A

STOP: 0000 - one byte long, so is a unary instruction and halts the program.
LOAD OPERAND INTO A: 1100 - this loads one word (two bytes) into the A register
STORE CONTENTS OF A INTO OPERAND: 0111
ADD OPERAND TO A: 1000
SUBTRACT OPERAND FROM A: 01001
CHARECTER INPUT TO OPERAND:01001 - this allows the program to enter an ASCII charecter from the input device while the program is running. only direct addressing is allowed.
CHARECTER OUTPUT FROM OPERAND: 01010 - this instructions sends an ASCII charecter to an output device while the program is running.

21
Q
What do the following opcodes do?
0000
1100
1110
1000
0111
01001
01010
A

0000 - halt
1100 - load operand into A register
1110 - store the contents of the A register into the operand
1000 - subtract the opernad from A register
0111 - add the opernad to the a register
01001 - charecter input to the operand
01010 charecter output from the operand

22
Q

Summerise machine code

A

●Low level instructions given in binary
● Operates directly on hardware
● Very specific operations
● Not very friendly to write or read

23
Q

What is assembly language?

A

Assembly language

A language that uses mnemonic codes to represent machine-language instructions

24
Q

What is an assembler?

A

A program that reads each of the instructions in mnemonic form and translates it into the machine-language
equivalent

25
Q

in pep/8 what is a .BLOCK and a .WORD?

A

● .BLOCK – assigns one or more bytes of memory.
● .WORD – assigns memory, and initialises it to a set
value.