Tom Kelliher, CS 220
Sept. 17, 1997
Advice on using HLL and converting to SAL.
Friday will be a lab session to write and run a SAL program. Here's the description:
Write a SAL program to read an integer, n, then read n integers and output the sum of the positive integers read.Come to class with HLL pseudocode to solve the problem.
b target
beqz divisor, error
beq i, j, endif
if (i >= 0) j = 1; else j = -1;
if (i <= -2 || i >= 2) i *= i; else if (i == 0) i = i / j; else j = i;
for (i = 1, sum = 0; i < 1025; i *= 2) sum += i;
while (i < 1000) { if (i % j == 0) break; i += k; }
get input
--- Input operation. input can be a
.word, .float, or a .byte. Entire line read for the former
two.
put output
--- Output operation. output can be a
.word, .float, or a .byte. No newline added. (So, how do we
get a newline?)
puts string
--- Output a string.