Assignment 2, due Jan 30
Part of
the homework for CS:2630, Spring 2015
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of class on the day indicated (usually Friday). Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
a) 100
b) 120
c) 140
d) 160
e) 170
a) 01100100
b) 01111000
c) 10001100
d) 10100000
e) 10101010
a) 100
b) 120
c) -115
d) -95
e) -85
a) 01100100
b) 01111000
c) 10001100
d) 10100000
e) 10101010
14 ITEM1: W TEXT1 ; pointer to text 15 H 5 ; X = 5 16 H 1 ; Y = 1 17 18 ITEM2: W TEXT2 19 H 2, 1 ; an alternative compacted form 20 21 ITEM3:W SOMETEXT 22 H 2,2; don't write code like this, it works but it's hard to read 23 SOMETEXT:ASCII"world",0 24 25 TEXT1: ASCII "lo", 0 26 TEXT2: ASCII "Hel", 0
Lines 18-19 are in a style different from that of lines 14-16. Lines 21-23 are a deliberate example of horrible abuse of programming style.
A problem: Rewrite lines 18-26 so that the style is consistent with the style used in lines 14-17. Your code need not put data into memory in the same order as the original, but it should mean the same thing in the context of machine problem 1. Legible and neat handwritten work is acceptable on this assignment. (1 point)