From owner-freebsd-questions Wed May 8 6:20:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from otter.mills-atl.com (dsl-64-192-140-77.telocity.com [64.192.140.77]) by hub.freebsd.org (Postfix) with ESMTP id D6F9737B405 for ; Wed, 8 May 2002 06:20:07 -0700 (PDT) Received: from localhost (jmills@localhost) by otter.mills-atl.com (8.9.3/8.9.3) with ESMTP id JAA02920; Wed, 8 May 2002 09:20:11 -0400 X-Authentication-Warning: otter.mills-atl.com: jmills owned process doing -bs Date: Wed, 8 May 2002 09:20:11 -0400 (EDT) From: John Mills X-Sender: jmills@otter.mills-atl.com Reply-To: John Mills To: Z Kuang Cc: questions@FreeBSD.ORG Subject: Re: your mail In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 8 May 2002, Z Kuang wrote: > The program now generates paper tape output. This format is based on the > well > known 'Morse Code', which consists of 'dots' and 'dashes'. On paper tape, a > 'dash' is represented by a hole in the bottom half of the paper, and a 'dot' > by a hole in the top half. The program simulates the hole by printing the > letter 'o'. Morse code is strictly sequential ('dots' and 'dashes' do not overlap, and their order is significant), and also includes inter-character and inter-element delays. I suggest a 'space' between characters. > The Morse Codes for hex digits are as follows: > > A .- > B -... > C -.-.- > D -.. > E . > F ..-. > 0 ----- > 1 .---- > 2 ..--- > 3 ...-- > 4 ....- > 5 ..... > 6 -.... > 7 --... > 8 ---.. > 9 ----. > The paper tape output for the number BAD would now be: > > oooo oo > o oo I would thus have expected: - ooo o oo o o o - I suggest you first write your program in 'C' (or some other mid-level language if you don't know 'C'), then recode in assembly. I suggest this because you will have to create a data structure which includes at least two lines of characters, and your entire hex number into those lines, then print out the first line, a 'newline', the second line, and another 'newline'. Of course you can print the hex values to the screen in the order they are typed. I recommend 'C' because it is easy to write low-level logic and data structures in 'C'. Naturally this is not the most expert way to write a program, but you need to 'divide and conquer' the parts of the assignment one at a time. - John Mills To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message