Re: Lab4

James Wu (james_wu@telus.net) Tue, 29 Feb 2000 18:57:33 -0800


From: "James Wu" <james_wu@telus.net>
Subject: Re: Lab4
Date: Tue, 29 Feb 2000 18:57:33 -0800

Hi Jonathan: > -------------------------------------------------------------------------- ------- > I am a little confused by the specs for the assembly > code on page 3. > > Q.1 > "...a string consisting of your name, student number > followed by a carriage-return and a line feed" > Does anyone know how to put a carriage return and > line feed in a string? I have the same question about that, too, but what I did was the following: 'my string, 1234567',0dh, 0ah, 0 0dh (in hex) is the ASCII for carriage return. 0ah (in hex) is the ASCII for line feed. 0 is the ASCII for "null" char. > > Q.2 > "returns control to DOS if the current character is > zero" > > Is this because no one has a zero in their student > number? > I recall in Monday's lecture that Dr. Casas mentioned the "zero" refers to the NULL char in the ASCII set (i.e. ASCII value 0). I also recall that a string ends with a NULL char; this is why the assembly program checks for this string terminating char. I think the "zero" you are referring to is the "0" char in the ASCII set (i.e. value 30h). Hope this helps :) James