CS2011, A Term 1999
Prof. Sergio A. Alvarez
HW2 (due Friday Sept. 10)

Instructions

Write an 80X86 assembly language program that accepts an ASCII
input string - all characters assumed to be UPPERCASE letters - 
and outputs the corresponding string in lowercase letters, for
example: "HELLO HOW ARE YOU" becomes "hello how are you". Refer 
to the ASCII table on the course homepage. For simplicity, if 
you wish you may ignore the fact that blanks, parentheses, etc
would need to be processed differently than letter characters 
in order for them not to be changed by the translation process.

An outline of the program appears below. Place the program 
outline in a text file named uptolow.asm. Next, fill in the 
missing program statements (directives and instructions). 
Then assemble your program using tasm, link it using tlink, 
and trace its execution using td. Try it out on several input 
strings. Notice that no console input/output is required for 
this assignment. Both input and output strings will be stored 
directly in memory, in the variables allocated by the db directives
near the beginning of the assembly source code given below.

Your program must assemble and link correctly when your own 
instructions are followed (see below). The executable must 
correctly transform any legal input string containing fewer 
than 100 uppercase characters into the appropriate string 
of lowercase characters.

Deliverables

Submit a floppy disk containing a copy of your assembly source 
code (uptolow.asm), the corresponding object file (uptolow.obj), 
and executable file (uptolow.exe). Also include the map file 
(uptolow.map) created by the linker (make sure to generate one).

Include a file named README that contains detailed instructions 
explaining any assembler and linker options used to generate 
the files you're submitting. For example, if you linked using 
the command line tlink/m/v uptolow.obj, then say so. 

Include another file named MAP that explains how to interpret
the information in the map file uptolow.map. Specifically, in
MAP you should calculate the absolute memory addresses for the 
starting points of your program's code, data, and stack segments, 
assuming that your program is loaded into memory starting at the 
location with absolute address 0FA00h. You should also give the
contents of the segment registers ES, CS, DS, SS after your
program has been loaded and registers have been initialized.
A detailed explanation of your answers should be included.

title Uppercase-to-lowercase Program
; build your own HW2 program on top of the skeleton given below

; fill in ...

instring  db "ANY OLD INPUT STRING (TRY YOUR OWN)" ; parentheses?
inlength = $-instring    ; length of input string
outstring db 100 dup(?)  ; this area will hold the output

.code
.startup
   ; fill in ...
   capsloop:
      mov al,instring[di]
      ; fill in ...
      mov outstring[di],al
      ; fill in ...
   loop capsloop
.exit

end

