SFU - CMPT 150 - Solutions - Assignments - 5

SFU - CMPT 150 - Solutions - Assignments - 5 - c A.H.Dixon...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
c ± A.H.Dixon CMPT 150 : Assignment 5 SOLUTION 1 Due 23:59 Monday, April 7, 2008 For the following programming exercises, you are to use only the instructions provided on the “HC-12 ASSEMBLY LANGUAGE SUBSET for Assignment 5”. This can be down- loaded from the link below the assignment link. 1. In HC-12 assembly language, write and test a program that will convert a small letter to a capital letter but leave unchanged any letter that is already capitalized or any character that is not a letter. SUGGESTION: Before you start writing the program, examine a table of the ASCII character codes and compare the codes for capital letters and small letters. Such a table can be found in many references including the textbook (page 27). SOLUTION: ; Program to covert small letters to capital letters ; Author: A.H.Dixon ; Date: April 1, 2008 ; Method: If the ASCII code is less than that for ‘a’, or greater than or equal ; that for ‘ { ’ (the character following ‘z’), then no conversion is required. ;otherwise subtract 32 from the ASCII code of the small letter to obtain
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/20/2010 for the course CMPT 150 taught by Professor Dr.anthonydixon during the Spring '08 term at Simon Fraser.

Page1 / 3

SFU - CMPT 150 - Solutions - Assignments - 5 - c A.H.Dixon...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online