Description
Question 1
is NOT a good reason to include BCD arithmetic in an instruction set?
0Is minimimes conversion errors0
0It is faster than binary arithmetic0
0Converting to and from decimal can be slow0
0It is required by some language standards0
Question 2 10/ 1 pts
If a language standard does not specify a maximum precision for floating point data types:
0It can be assumed the the precision is as great as needed.0
It can be assumed that the maximum precision is the same as the minimum precision.
There is a risk of portability issues from proggrams that depend on a higher-than-specified precision.
Floating point arithmetic must be implemented in software rather than hardware.
Correct!
Question 3 10/ 1 pts
The 8-bit Extended ASCII standard:
0Is a set of standards that support several European character sets.0
0Supports 137,994 glyphs and control characters.0
0Allows programs to use the 8th bit however they wish.0
0Is based on the EBCDIC character set.0
Question 4
Using informal pseudocode write an algorithm for the 1st pass of an assembler.
Assume someone has provided subroutines which you can call to:
SCANLINE: Scan a line and return the tokens for $label, $opcode, $argument, and $comment – or an error
LOOKUPOPCODE: Look up the $opcode and return the instruction length – or an error
Your algorithm should assume that the first instruction is at memory location 1000.
Your algorithm should assume that instructions have zero or one argument, and if the instruction has one argument, it may be an address (corresponding to a label), or an integer value referring to the number of bytes to reserve for a declaration. In other words, you don’t need to handle statements like:
BYTE C‘widget’
Your algorithm will need to track the $currentaddress as you process lines of the program. The $currentaddress will be affected by the instruction length returned by LOOKUPOPCODE, or the number of bytes specified in declarations.
Your algorithm should build a symbol table and a reference table.
The goal of this assignment is to be sure you understand the concepts of how a two-pass assembler is written (though this assignment is only for the 1st pass). Make your pseudocode clear and specific enough for me to understand what you are doing – but I am not trying to trip you up over specific syntax.
If you make simplifying assumptions, include those as comments in your response.
2/13/23, 6:14 PM
Assignment 2 – Assembly Language: SP23: CMPE – 220 Sec 01 – System Software
Here is an algorithm for the first pass of an assembler.
//Start of the algorithm
//Set the current address to 10000
currAddr = 1000;
//Initialize the symbol table and reference table0
symbolTable = {};0
referenceTable = {};
//Repeat the below steps for all the lines0
while there is a line in the program0
{0
//Call the SCANLINE subroutine to get the tokens for label, opcode, argument, and comment0
tokens = SCANLINE();0
label = tokens[0];0
opcode = tokens[1];0
argument = tokens[2];0
comment = tokens[3];0
0
//If the label is not empty, add it to the symbol table with the current address as its value
if label is not empty0
{0
symbolTable[label] = currAddr;0
}0
0
//If the opcode is not an error, call the LOOKUPOPCODE subroutine to get the instruction length0
if opcode is not an error0
{0
instrLen = LOOKUPOPCODE(opcode);0
0
//If the argument is not an error0
if argument is not an error0
{0
//If it is also not a number, it is a reference to a label0 if argument is not a member0 {0
//Add the reference to the reference table0
referenceTale[currAddr] = argument;0
}0
//If the argument is a number, it represents the # of bytes to reserve0
else0
{0
//Update the current address with the number of bytes to
reserve0
}0
}0
currAddr = currAddr + instrLen;0
}0
}0
//End of the algorithm
Question 5 pts
Write a SIC/XE program to computer the first 15 terms of a Fibonacci sequence, and store them in an array at the top of your program.
Fibonacci Sequence:
Each term is the sum of the previous two terms
0, 1, 1, 2, 3, 5, 8, 13, 21, 34…
Upload your program as a text file
0Fibonacci15Q5.txt
(https://sjsu.instructure.com/files/71844173/download)