counter=++counter++b
; is an invalid C expression.
For
any error, it would print a meaningful error message. All variables and
literals follow rules of C for naming with maximum length 256.
-
Compute the values of the following expressions:-
(a)
A=X +Y –Z (unsigned calculation)
(b)
A= X + 3 * (Y-Z) (unsigned calculation)
(c)
A= X + (- 3) * (Y-Z) (signed calculation)
(d)
A= X/(Y-Z) (unsigned calculation)
(e)
A= 5 * (X+Y) /Z (signed calculation)
(f)
A = (B+C) /(X+1) (signed calculation)
(g)
A = 3*C – 14 * B (signed calculation)
(h)
A= (B/C) * (D+1) (signed calculation)
(i)
A = (-B) * (D-1)
(j)
Hours = Minutes /60; Minutes = Minutes %60 (unsigned
calculation)
(k)
Area = 22 * R * R /7 (unsigned calculation)
(l)
Fact = N * (N-1) * … 2 *1 (unsigned calculation)
-
Translate the following high-level pseudo-code
fragments into assembly language program fragments.
(a)
IF A>=0 THEN X=A ELSE X= - A
(b)
IF (X>0) THEN SIGNX = 1 ELSE IF (X<0) THEN SIGNX = -1
ELSE SIGNX=0
(c)
(IF (X>5) AND (Y<0) ) OR (Z<=13) THEN A = 0 ELSE A = 2
-
Write
an assembly program to check whether a number is a prime number and
print prompt "PRIME" or "NOT PRIME"
accordingly.
-
Print
a BYTE value entered through keyboard on the monitor. For example, if
one enters 52, the program prints 52 on monitor (NOT its ASCII
equivalent).
-
Write
a program of matrix addition. The two matrices are given as a list of
BYTE numbers and the program produces a third matrix as a list of
another WORD numbers. Print the final matrix on monitor.
-
Write
an assembly program to reverse a character string which is inputted
through keyboard. The program should print the reversed string on
monitor.
-
Write
a program to convert all characters of an inputted string to uppercase
and print the final string on monitor.
-
Implement
the division through repeated subtraction algorithm to divide a word
number by a byte number.
-
Implement
"bubble sort" in assembly program. The program should have a
list of unordered unsigned BYTE numbers as input and it should sort
the same list and print the sorted list on monitor. DO NOT USE A SEPARATE
ARRAY or ANOTHER LIST.