pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: [Pgubook-readers] Programming from Grown up


From: Jason Creech
Subject: Fwd: [Pgubook-readers] Programming from Grown up
Date: Sun, 7 Oct 2007 19:25:59 -0700 (PDT)


Haven't worked any of the examples in a while, but I do remember that echo $? is the command line to display the exit status of the program, so you can only view one result using the command.  I suspect that the second echo $? is displaying the exit status of the first echo command, but I'm not knowledgeable enough of the linux programming environment to say for sure.  One of the exercises is to rewrite the maximum program to find the minimum instead, but not both.  You might try that one to see how the logic differs, Displaying both would be an interesting problem to solve, perhaps there is a way to access the contents of a different register from the command line and you could store the second result there?  Good luck!

p.s. sorry the code attachment was blocked, so if I have misunderstood what you were trying to do, I apologize.

Note: forwarded message attached.
--- Begin Message --- Subject: [Pgubook-readers] Programming from Grown up Date: Sun, 07 Oct 2007 20:27:57 -0400
Hi there

I am currently reading the book. When I finished first 3 chapters, i was trying 
to write a similar program as "findiing the maximun number. However, I want my 
program to not only find the maximun but also the minimun. Anyway, when I run 
my program and tried to output the two numbers, the program always gave me the 
maximun. 

---------------------------------------------------------
For example.

     1st echo $?
         the maximun
     2nd echo $?
         0
-----------------------------------------------------------

My question is how can I use "echo $?" to give me both max and min, and how can 
I define a string of number of positive and negative numbers. Can you give me 
some advice ?

Best regard.

ps. I work under the linux OS. And the attached file is my program.

Attachment: tryout.s.s
Description: Binary data

_______________________________________________
Pgubook-readers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/pgubook-readers

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]