Quiz
Architecture midterm
Dieses Quiz enthält Fragetypen, die sich im gewohnten Player öffnen.
Fragen in diesem Quiz (127)
1Considering its overall performance, which of the following is essential for any computer?
- Ahardware
- Bsoftware
- CHardware and software
- Dnone of these
2Which of the following processor's instruction set was the main one used in the assembly language?
- A8085
- B8051
- C8086
- Dnone of these
3Which of the following languages is closest to any processor?
- Ahigh level
- Bmachine
- Cassembly
- Dnone of these
4If the data is available as a part of the instruction itself, then the concerned addressing mode is designated as:
- Aimmediate
- Bindexed
- Cdirect
- Dnone of these
5Maximum number of bytes required for any 8085 instruction is:
- A3
- B4
- C5
- Dnone of these
6With respect to 8085 instruction groups, number of extra instruction groups offered by 8086 is:
- A1
- B2
- C3
- Dnone of these
7How many variations are there in the rst byte format of 8051 instruction set?
- A3
- B4
- C5
- Dnone of these
8A compiler's duty is to translate a program written in _______ language to ______ language
- Amachine, assembly
- Bhigh level, assembly
- Cassembly, high level
- Dnone of these
9The maximum number of fields in assembly language programming would be:
- A3
- B4
- C5
- Dnone of these
10The assembler directive ORG denotes the assembler
- Athe end of the program listing
- Borigin of a variable
- Corganization of the processor
- Dnone of these
11The first general-purpose electronic digital computer was ENIAC (1946)
- ARichtig
- BFalsch
12One of the first programmable binary digital computers was EDSAC (1949)
Was also the first computer to use machine langauge- ARichtig
- BFalsch
13In the early days, each new micro processor needed new machine code for it
- ARichtig
- BFalsch
14mnemonics refer to binary code instructions
add, sub, mov, jmp- ARichtig
- BFalsch
15A program called an assembler translates assembly language
into machine code- ARichtig
- BFalsch
16Assembly language programs cannot be run on more than 1 type of processor
- ARichtig
- BFalsch
17high-level languages typically use human words and grammer and use a complier
- ARichtig
- BFalsch
18Biggest advantage of 3rd generation languages:
you don’t need to rewrite your program to run on a different type of processor or operating system
It gets recompiled on your current processor- ARichtig
- BFalsch
19Microcode is set of detailed hardware-level instructions used to implement machine language instructions.
takes machine code, gives a signal to each binary section, sends to the physical logical gate on the board- ARichtig
- BFalsch
20Decoders are used for the purpose of
- Altering out unwanted data
- Bselect a target device
- Cdivision by two
- Dnone of these
21Which one of the following is the two's complement representation of the binary number 010000?
- A101111
- B010000
- C110000
- Dnone of these
22Multiplication of 1-bit Boolean operators may also be performed by
- AANDing
- BXORing
- CORing
- Dnone of these
23The result of multiplication of two 8-bit unsigned binary numbers would be
- A64-bit
- B8-bit
- C16-bit
- Dnone of these
24If arithmetic right-shift is performed with 10110101 then the result would be
- A01011010
- B11011010
- C11110101
- Dnone of these
25To multiply two 8-bit integers using Booth's algorithm, the counter C to be initialized as
- A8
- B32
- C16
- Dnone of these
26The result of division of two 8-bit unsigned integers would be
- A4-bit and 4-bit
- B16-bit and 16-bit
- C8-bit and 8-bit
- Dnone of these
27In scientific notation scheme, generally the base used is
- A2
- B256
- C8
- Dnone of these
28Decimal System is base [blank_start]10[blank_end]
Binary System is base [blank_start]2[blank_end]
Hexadecimal System is base [blank_start]16[blank_end]- A10
- B2
- C16
29Decimal to binary conversion:
Divide the decimal by 2, remainder is the binary
Divide next decimal from result of above, remainder is the binary
Repeat
End result binary is all the remainders from the last to the first
[blank_start]1173[blank_end] / 2 = [blank_start]586[blank_end] remain 1
586 / 2 = 293 remain 0
293 / 2 = 146 remain 1
146 / 2 = 73 remain [blank_start]0[blank_end]
73 / 2 = 36 remain 1
36 / 2 = 18 remain 0
18 / 2 = 9 remain 0
9 / 2 = 4 remain 1
4 / 2 = 2 remain 0
2 / 2 = 1 remain 0
1 / 2 = 0 remain 1
Result = [blank_start]10010010101[blank_end]- A1173
- B586
- C10010010101
- D0
30Binary to decimal
Each binary digit is ^ by its place then added
1010:
1 * 2^3 + 0 * 2^2 + 1 * 2^1 + 0 * 2^0 = 8 + 2 = 10
11010 to decimal:
1 * 2^[blank_start]4[blank_end] + 1 * 2^[blank_start]3[blank_end] + 0 + 1 * 2^1 + 0 = [blank_start]16[blank_end] + [blank_start]8[blank_end] + [blank_start]2[blank_end] = [blank_start]26[blank_end]- A4
- B3
- C16
- D8
- E2
- F26
31Decimal to hexadecimal:
Divide decimal by 16, remainder is hex value
Divide above result by 16, remainder is hex value
Repeat till result is 0
Hex value is all remainder from last to start
1173 / [blank_start]16[blank_end] = 73, remain 5
73 / 16 = 4, remain 9
4 / 16 = 0, remain 4
Hex = [blank_start]495[blank_end]
Remember hex 10-15 is A to F- A495
- B16
32Hexadecimal to decimal
Each digit of the hex is ^ by its place and added
AB5 =
10 * 16^2 + 11 * 16^1 + 5 * 16^0 = 2560 + 176 + 5 = 2741
ACF =
[blank_start]10[blank_end] * 16^[blank_start]2[blank_end] + [blank_start]12[blank_end] * 16^[blank_start]1[blank_end] + [blank_start]15[blank_end] * 16^0 = 2560 + 192 + 15 = 2767- A10
- B2
- C12
- D1
- E15
33Binary to hex / Hex to binary
Simply use the binary value: ie. 1010 = 10 = A
[blank_start]1010[blank_end] [blank_start]1011[blank_end] [blank_start]0101[blank_end] [blank_start]1100[blank_end] = AB5C
1011 1111 0101 = [blank_start]BF5[blank_end]
[blank_start]1101[blank_end] [blank_start]1100[blank_end] 0001 = CD1- A1010
- B1011
- C0101
- D1100
- EBF5
- F1101
- G1100
34Give the binary representation of the following decimal values:
38 = [blank_start]100110[blank_end]
89 = [blank_start]1011001[blank_end]
4 = [blank_start]0100[blank_end]
126 = [blank_start]01111110[blank_end]- A00100110
- B01011001
- C0100
- D01111110
35What is the decimal value of the following binary values?
1100 = [blank_start]12[blank_end]
100100 = [blank_start]36[blank_end]
11111111 = [blank_start]256[blank_end]- A12
- B36
- C256
36What are the hexadecimal representations of the following integers?
67 = [blank_start]43[blank_end]
142 = [blank_start]8E[blank_end]- A43
- B8E
37What are the decimal values of the following hexadecimal numbers?
1B = 0001 [blank_start]1011[blank_end]
A7 = [blank_start]1010[blank_end] [blank_start]0111[blank_end]
8CE = [blank_start]1111[blank_end] [blank_start]1100[blank_end] [blank_start]1110[blank_end]- A1011
- B1010
- C0111
- D1111
- E1100
- F1110
38Long division review if you forgot:
250 divides by 6
41
-------
6/250
- 24
-----
10
- 6
-----
4
Step 1:
can 6 go into 2, no.
can 6 go into 25, yes, how many times? 4
4 goes on top
Step 2:
6 * 4 = 24
Multiple 24 by step 1 result
25 – 24 = 1
Step 3:
Can 6 go into 1? No. bring down the 0 from above
Can 6 go into 10? Yes, how many times? 1
1 goes on top
10 – 6 = 4
Step 4:
Can 6 go into 4? No, any extra digits to bring down? No, then you're done
Remainder result = 41- ARichtig
- BFalsch
39Unsigned = positive real numbers (0-127)
signed = positive or negative numbers (-127 to 128)- ARichtig
- BFalsch
40One byte (8 bits) can fit 2^8 = [blank_start]256[blank_end] different integers (starts at zero, so range is 0 - [blank_start]255[blank_end])
Two bytes (16 bits) can fit the maximum integer 1111 1111 1111 1111 or in decimal 65,535; there are 2^16 = 65,536 integers- A256
- B255
41Sign-magnitude is the extra bit in front of the binary value that represents positive or negative.
1 = negative
0 = positive
1 011 = -3
0 011 = +3- ARichtig
- BFalsch
42What happens to the largest number you can represent in (signed):
8 bits = [blank_start]127[blank_end]
16 bits = [blank_start]65535[blank_end]- A127
- B65535
43# of bits:
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = [blank_start]16[blank_end]
2^5 = [blank_start]32[blank_end]
2^6 = [blank_start]64[blank_end]
2^7 = [blank_start]128[blank_end]
2^8 = [blank_start]256[blank_end]
2^9 = [blank_start]512[blank_end]
2^10 = [blank_start]1024[blank_end] or K- A16
- B32
- C64
- D128
- E256
- F512
- G1024
444K in # of bits =
2^2 = 4
2^10 = 1024 or K
2 + 10 = 12 bits
128K in # of bits =
2^[blank_start]7[blank_end] = 128
2^10 = 1024 or K
[blank_start]7[blank_end] + 10 = [blank_start]17[blank_end] bits
128M in # of bits =
2^7 = 128
2^[blank_start]20[blank_end] = M
7 + [blank_start]20[blank_end] = [blank_start]27[blank_end] bits- A7
- B7
- C17
- D20
- E20
- F27
45Two’s Complement
Negate a number by flipping all the bits and adding 1- ARichtig
- BFalsch
46Convert -73 to 8-bit two’s complement rep.
How? Calculate the 2’s complement of 73 (negate it)
1.Convert the number to binary
2.Flip (invert) all the bits
3.Add 1
73 to binary = [blank_start]1001001[blank_end]
inverted = [blank_start]0110110[blank_end]
add 1 = [blank_start]0110111[blank_end]
Convert 73 to 8-bit two’s complement rep?
Just convert to binary
only apply 2s complement to negative number- A1001001
- B0110110
- C0110111
47How many bits are needed to represent the number 600 as an unsigned binary integer?
- A8
- B10
- C14
- D16
48Images are stored in computer memory as numbers
Each number may represent a dot or pixel of the image- ARichtig
- BFalsch
49each value (R, G, B) is stored as an unsigned byte
Therefore 8+8+8=24 bits fully represent an RGB color pixel
representation in bits:
FF0000 = 800- ARichtig
- BFalsch
50How much memory is needed to store a 2400 × 1800 pixel still image?
Assume each pixel is stored as an 8+8+8 = 24 bit RGB colour- A2400 bytes
- B1800 bytes
- C4,320,000 bytes
- D12,960,000 bytes
51black and white pixels uses 1 bit
- ARichtig
- BFalsch
52Digital audio information is represented as a sequence of numbers in computer memory
- ARichtig
- BFalsch
53Sound is converted to digital audio by “sampling” the sound waveform at a high speed. Each sample is a number.
Sample rate is equal to frequency
taking more samples solves the issue of accuracy from the signal- ARichtig
- BFalsch
54How much memory is needed to store a 5-minute song using CD-quality digital audio?
Remember: Sample rate 44.1 kHz, 16-bit samples, 2 channels- A5000 bytes
- B5 Megabytes
- C16 Megabytes
- D50 Megabytes
55Lossless compression reduces the size of data without losing or changing any information (data)
Decompressing restores the original data exactly
Compression ratio: This describes the effectiveness of the compression method
A ratio of 2:1 means the compressed data is half the original size- ARichtig
- BFalsch
56Lossless compression algorithms don’t work very well on image/video or audio data
Typically the best lossless compression ratios are about 2:1
The reason? Video/audio data often appears close to random- ARichtig
- BFalsch
57Compression ratio
Suppose a file of size 32 MB is compressed using zip
resulting in a file of size 10 MB
compression ratio = 32 / 10 = 3.2 or 3.2:1- ARichtig
- BFalsch
58Typical compression ratios:
JPEG images are 10:1
MP3 music are 10:1
MPEG-4 videos can be from 100:1 to 200:1- ARichtig
- BFalsch
59An 5-minute song is 50 MB uncompressed. Roughly how large is an MP3 version of the song?
- A5 MB
- B500 KB
- C2.5 GB
- DNone of the above
60ADC is the abbreviation for
- Aadvanced digital computer
- Banalog to digital converter
- Caccurate digital computing
- Dnone of these
61Which of the following processor was used in the rst IBM PC?
- A386
- B8088
- C8086
- Dnone of these
62Which of the following is responsible for incrementing the program counter by one?
- Aprocessor clock
- Bgate
- Ctimer
- Dnone of these
63Which of the following signal is generated from program counter?
- Acontrol
- Baddress
- Cdata
- Dnone of these
64Instruction decoding is performed by the processor
- Abefore fetch
- Bafter fetch
- Cduring fetch
- Dnone of these
65A nibble is composed of
- A1-bit
- B6-bits
- C4-bits
- Dnone of these
66Which of the following modules decodes and executes the instructions?
- Aoperating system
- Binternal bus
- Cmicroarchitecture
- Dnone of these
67kilobyte (KB) = 2^10
megabyte (MB) = 2^20
gigabyte (GB) = 2^30
terabyte (TB) = 2^40- ARichtig
- BFalsch
68What is the amount of bits?
8K = [blank_start]13[blank_end] bit
8MB = [blank_start]23[blank_end] bit
2GB = [blank_start]31[blank_end] bit
4TB = [blank_start]42[blank_end] bit- A13
- B23
- C31
- D42
69A System Bus (one bit per wire ) is made up of which types:
- AThe Data Bus
- BThe Address Bus
- CThe Control Bus
- DThe System Bus
- EThe Cycle Bus
70In a system bus, the data bus is bi-directional
- ARichtig
- BFalsch
71Address Bus
Identifies which byte of RAM or I/O devices the CPU wishes to address
Size of the address bus defines the maximum of addressable RAM
ie. 2^32 size of address bus = 4 gigabyte maximum RAM- ARichtig
- BFalsch
72Data Bus
Carries the data to and from the CPU, to memory or I/O devices
The size of the data bus dictates how many bytes can be transported at one time (one clock cycle)- ARichtig
- BFalsch
73The Control Bus contains signals that control the functions of the interconnected components
- ARichtig
- BFalsch
74System Clock
One clock cycle: time from one rising edge to the next rising edge, frequency measured in Hertz (Hz)- ARichtig
- BFalsch
75Why are serial buses faster?
A parallel bus normally has one wire for the clock signal (bus clock or system clock), and many other wires
High-speed serial buses may encode all the signals, including the clock, on one logical wire ie. no clock skew!- ARichtig
- BFalsch
76Von Neumann Architecture - Steps RAM used:
Fetch-> Decode-> Execute-> Write- ARichtig
- BFalsch
77The closer to CPU the component is, the faster the speed to access it

- Athis one
- Bno
78The ways to measure a computers performance is in these ways (4):
- AExecution time
- BThroughput
- CLatency
- DSpeedup
- EClock Cycle
- FRAM size
- GCPU register speed
79Cycles per Instruction (CPI)
Average # cycles of the system clock to execute one instruction- ARichtig
- BFalsch
80 Instructions per Cycle (IPC)
Average # of instructions that can be executed in one clock cycle- ARichtig
- BFalsch
81A given program consists of a 100-instruction loop that executes 42 times. If it takes 16,000 clock cycles to execute the program on a given system, what are the system’s CPI and IPC values?
100 * 42 = [blank_start]4200[blank_end] instructions in [blank_start]16000[blank_end] cycles
CPI = [blank_start]16000[blank_end]/[blank_start]4200[blank_end] = 3.8
IPC = [blank_start]4200[blank_end]/[blank_start]16000[blank_end] = 0.26- A4200
- B16000
- C16000
- D4200
- E4200
- F16000
82Speedup is expressed as a unitless factor
ie. if a particular benchmark takes 25 seconds to run on one processor and 15 seconds to run on a new processor, then the speedup would be 25/15 =1.67- ARichtig
- BFalsch
83MTBF (Mean Time Between Failures)
The predicted average time from when a system is put into service to when it will fail- ARichtig
- BFalsch
84MTTR (Mean Time To Repair)
The average time to recover from a failure- ARichtig
- BFalsch
85An instruction cycle means
- AM1, M2, M3
- Bfetch, decode, execute
- Cget operands, add operands, store result
- Dnone of these
86For fetching an instruction byte, the processor is to provide the external memory device
- Aaddress and read signals
- Bdata and read signals
- Caddress and write signals
- Dnone of these
87The number of external hardware interrupt input pins offered by 8085 microprocessor is
- A2
- B5
- C4
- Dnone of these
88The number of bytes in the queue of instruction pipeline for 8086 is
- A8
- B1
- C6
- Dnone of these
89when packet is received from memory instruction (16 bits of memory instruction)
decode looks at the instruction, divides into 2 parts
1st: data
2nd: address- ARichtig
- BFalsch
90CPU Components
1. System Bus Interface Unit
2. Decode Unit
3. Register File
4. Executing Unit (or Arithmetic-Logic Unit)
5. Control Unit- ARichtig
- BFalsch
91Decode Unit
The Decode Unit receives machine instructions, then “decodes” them into micro instructions
In the 8086, each micro instruction is executed in one clock cycle- ARichtig
- BFalsch
92Our theoretical processor has 4 registers: each is 8 bits
Three general purpose:
AL, BL, CL - used by programmers for various purposes
One special purpose:
IP - Always contains the memory address of the instruction being executed- ARichtig
- BFalsch
93Our theoretical processor can only perform four operations
ADD
AND
OR
NOT- ARichtig
- BFalsch
94There are 8 general purpose registers
Accumulator registers:
AX
BX: Often used as a memory address ie. [BX]
CX
DX
additional general purpose registers
SP - top of stack
BP - bottom of stack
SI
DI- ARichtig
- BFalsch
95The 8086 combines two 16-bit registers together as an effective address to work with 20-bit address space
DS typically used for offset, normally as 0100h
Step 1: Shift the segment register value left 4 bits (or multiply by 16)
0B56h x 10h = 0B560h
Step 2: Add the offset register value
0B560h + 0100h = 0B660h
0B56:0100 (segment : offset)
0B660 (20-bit effective address)- ARichtig
- BFalsch
96IP stands for Instruction Pointer
Points to the next instruction to run in RAM- ARichtig
- BFalsch
97How much memory could the 8086 processor access if we add one bit to its external address bus?
- A1 MB
- B2 MB
- C4 MB
- D10 MB
98The Intel 8086 goes through six steps to carry out the four Von Neumann functions
1. CPU requests instruction from memory (RAM)
2. Sends instruction to Decode Unit
3. CPU decodes Instruction to Micro Code
4. CPU executes Micro Code
5. CPU writes result back to a register or memory
6. Instruction Pointer is updated for next instruction- ARichtig
- BFalsch
99The Status Register has 16 bits, each bit serves as a flag
- ARichtig
- BFalsch
100Carry Flag (CF): set to 1 when there is unsigned overflow
Example: 255+1, where result is not in range of (0...255)- ARichtig
- BFalsch
101Zero Flag (ZF): set to 1 when result is zero; set to 0 when result is not zero
- ARichtig
- BFalsch
102Sign Flag (SF): set to 1 when result is negative; set to 0 when positive
- ARichtig
- BFalsch
103Overflow Flag (OF): set to 1 when there is signed overflow
Example: 100 + 50, where result is not in range of (-128...127)- ARichtig
- BFalsch
104Parity Flag (PF): set to 1 when there’s an even number of one bits in result, and to 0 when there’s an odd number of one bits
- ARichtig
- BFalsch
105Interrupt (enable) Flag (IF): when set to 1, the CPU reacts to hardware interrupts from external devices
- ARichtig
- BFalsch
106Two common data ordering techniques are used for multi-byte values:
Big Endian (most significant byte is stored first)
- This is how we write numbers
ie. A341h -> A3 41
Little Endian (least significant byte is stored first)
- Used by all Intel processors
ie. A341h - > 41 A3- ARichtig
- BFalsch
107Assembly language programmers can interact with the OS and hardware devices using interrupts
There are two types of interrupts:
Software interrupts
Hardware interrupts- ARichtig
- BFalsch
108We use the INT instruction to trigger a software interrupt:
INT value
where value is from 0 to 255 (0h to FFh)
INT 10h
MOV AL,' K ' ;will display K to the console screen- ARichtig
- BFalsch
109A stack is a Last In First Out or LIFO data structure
(important to do an equal number of pushes & pops)- ARichtig
- BFalsch
110What will be on the stack after these instructions? (assume stack starts empty)
PUSH 6
PUSH 7
POP BX
PUSH 10
POP BX
PUSH 4- A6
4 - B6
7
4 - C7
10 - D4
- A6
111The 8086 uses the Stack Pointer (SP) and Base Pointer (BP) registers to determine the top and bottom of the stack
The effective address of the last value pushed on the stack (or next to be popped) is given by SS:SP- ARichtig
- BFalsch
112Exchanging (swapping) register values:
ORG100h
MOV AX, 0x1212
MOV BX, 0x343436
PUSH AX ; store value of AX in stack
PUSH BX ; store value of BX in stack
POP AX ; set AX to original value of BX
POP BX ; set BX to original value of AX- ARichtig
- BFalsch
113Saving the contents of a register:
ORG 100h
MOV AX, 0x1234
PUSH AX ; store value of AX in stack
MOV AX, 0x5678 ; modify the AX value
---- ; do some work withAX
POP AX ; restore original AX value- ARichtig
- BFalsch
114Procedure Calls (an important use of the stack)
A procedure is a group of instructions that can be called from another part of the program to perform a specific task
name PROC
; here is the code
; of the procedure
RET
name ENDP- ARichtig
- BFalsch
115Calling a Procedure
CALL pushes the current instruction pointer (IP) on the stack, then jumps to the procedure
The next RET instruction pops the saved value off the stack and assigns it to IP- ARichtig
- BFalsch
116Passing Parameters for procedures
Registers: Parameter values are put in registers before the CALL
Memory: Parameter values are placed in memory
Stack: Parameter values are pushed on the stack- ARichtig
- BFalsch
117The following algorithm evaluates RPN expressions
Step 1: Start at left and look at expression until you come to an operator
Step 2: Replace the two numbers to the left of the operator with the result of performing the operator on the two numbers
Step 3: If the formula now consists of only one number that is the result; if not continue to look for an operator and continue with step 2- ARichtig
- BFalsch
118The Reverse Polish notation expression evaluates to...
4 6 2 * + 2 /- A4
- B0
- C14
- D8
- E18
119In assembly add 2 + (7 + 3)
[blank_start]MOV[blank_end] AX, 7
[blank_start]ADD[blank_end] AX, [blank_start]3[blank_end]
ADD AX, [blank_start]2[blank_end]- AMOV
- BADD
- C3
- D2
1202 + (7 * 3)
MOV AL, 7
[blank_start]MOV[blank_end] BL, 3
[blank_start]MUL[blank_end] [blank_start]BL[blank_end]
ADD AX, 2- AMOV
- BMUL
- CBL
121swap AL (07) with BL (03)
MOV AL, 7
MOV BL, 3
MOV CL, [blank_start]AL[blank_end]
MOV AL, [blank_start]BL[blank_end]
MOV BL, [blank_start]CL[blank_end]- AAL
- BBL
- CCL
12237 - (11 + 20)
MOV AL, 11
[blank_start]ADD[blank_end] AL, 20
MOV BL, 37
[blank_start]SUB[blank_end] BX, AX- AADD
- BSUB
123MOV AX, 0x100 ;the base offset
MOV DS, AX ;setting the DS offset
MOV BX, 0x30 ;move 0x30 to BX or setting the address
MOV [BX], 0xABCD ;moves ABCD to address of BX, which is 130 (base offset + bx)
resulting address 0x0130 contains CD AB (uses little indian)- ARichtig
- BFalsch
124swapping BC and CX contents using address
MOV AX, 0x100
MOV [blank_start]DS[blank_end], AX ; setting up offset
MOV BX, 50 ; starting address for BX
MOV CX, 60 ; starting address for CX
MOV AL, [blank_start][BX][blank_end] ; move value at BX address to AL
MOV DX, [blank_start]BX[blank_end] ; copy BX to DX
MOV BX, [blank_start]CX[blank_end] ; copy CX to DX
MOV [blank_start]AH[blank_end], [BX] ; move value at BX address to AH
MOV [blank_start][BX][blank_end], AL ; move AL value back to BX address- ADS
- B[BX]
- CBX
- DCX
- EAH
- F[BX]
125example with jump not equal, simple loop, 5 times
MOV AX, 0
MOV BX, 5 ;counter
back:
ADD ax, bx
[blank_start]SUB[blank_end] bx, 1
[blank_start]CMP[blank_end] bx, 0
[blank_start]JNE[blank_end] back- ASUB
- BCMP
- CJNE
126compare value of DX to values, assigning based on conditions
MOV DX, 0x0F ; random value don't matter
CMP DX, 0x0F ; comparing DX with value 0F, if greater or equal, jump
[blank_start]JGE[blank_end] greater_1
hlt ; if compare is false, stop program
greater_1:
CMP DX, 0x3B
JGE greater_2
MOV AX, 0xFF
hlt
greater_2:
CMP DX, 0xAF
JGE greater_3
MOV BX, 0xAA
hlt
greater_3:
MOV CX, 0x55
hlt- AJGE
127copy contents of BX, to CX using address and loop
MOV DH, 06 ; counter
MOV AX, 100
MOV DS, AX ; setting offset
MOV BX, 50 ; starting value
MOV CX, 60 ; starting value
loop:
MOV AX, [BX] ;move value at BX address to AX
MOV DL, BL ; copy BL to DL
MOV BX, CX ; copy CX to BX
MOV [BX], AX ; MOV AX to address of BX
ADD CX, 01 ; increment CX address
ADD DL, 01 ; increment DL address
MOV BX, DX ; copy DX to BX
SUB DH, 01 ;subtract counter
CMP DH, 0
JNE loop- ARichtig
- BFalsch
Informationen
- Beschreibung
- Computer Science Quiz am Architecture midterm, erstellt von Duncan Levings am 12/10/2018.
- Autor
- Duncan Levings
- Sprache
- English
- Aufrufe
- 4
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz