Problems happens to me everywhere, in about every aspect of life. For some normal problems we have prepared solutions on compile time but there are also some run time exceptions that are really hard to be removed(especially when you are in hurry).
Some thing like the run time exception my mind threw in the 1st lab sessional of Assembly. My task was to prepare a solution for finding least number in an array of 5 elements. I asked my teacher whether everything is same as C++, he said yes of course. Now when i started working i took about 2 minutes creating flowchart and about 10 minutes combining logic with syntax. I reviewed the code, it was all okay, i assembled it, the program executed. the elements of the array were something like 3h,9h,7h,6h,4h at first. It gave me the answer 3, i was happy, i thought i should call the teacher but i then tried another combination of 7h,9h,3h,6h,4h and this time the result was 7. i was shocked that whats happening.
Now thinking started again, here check, there check, the flowchart even wasn't spared. Each and every single mov was even checked, found no errors in the logic as well in the Syntax.The teacher came twice and asked me, "Hey whats wrong with you today??", i replied "Nothing sir its just a little error of syntax".
I sat for the whole time staring at each and every classmate of mine, they were happy because they finished their job and started going home and also it was the last paper. i was in a real rush because our class decided to play cricket after the the lab.
When the teacher said its 10 minutes to go, what i did was that i just changed the combination from 7h,9h,3h,6h,4h to 7d,9d,3d,6d,4d, and you wont believe that it worked. This time i tried 4 other combinations and the answers were correct. i said hurray, i was happy but i still didn't figured out why was it like that.
Is there something wrong with the comparison of hexadecimal?
Is the comparison of simple Decimal numbers and Hexadecimal numbers is different?
Alot of confusion is still buzzing around my mind. I still have questions in my mind but will ask the teacher after the vacations.
Live free, with fresh oxygen... :)
Some thing like the run time exception my mind threw in the 1st lab sessional of Assembly. My task was to prepare a solution for finding least number in an array of 5 elements. I asked my teacher whether everything is same as C++, he said yes of course. Now when i started working i took about 2 minutes creating flowchart and about 10 minutes combining logic with syntax. I reviewed the code, it was all okay, i assembled it, the program executed. the elements of the array were something like 3h,9h,7h,6h,4h at first. It gave me the answer 3, i was happy, i thought i should call the teacher but i then tried another combination of 7h,9h,3h,6h,4h and this time the result was 7. i was shocked that whats happening.
Now thinking started again, here check, there check, the flowchart even wasn't spared. Each and every single mov was even checked, found no errors in the logic as well in the Syntax.The teacher came twice and asked me, "Hey whats wrong with you today??", i replied "Nothing sir its just a little error of syntax".
I sat for the whole time staring at each and every classmate of mine, they were happy because they finished their job and started going home and also it was the last paper. i was in a real rush because our class decided to play cricket after the the lab.
When the teacher said its 10 minutes to go, what i did was that i just changed the combination from 7h,9h,3h,6h,4h to 7d,9d,3d,6d,4d, and you wont believe that it worked. This time i tried 4 other combinations and the answers were correct. i said hurray, i was happy but i still didn't figured out why was it like that.
Is there something wrong with the comparison of hexadecimal?
Is the comparison of simple Decimal numbers and Hexadecimal numbers is different?
Alot of confusion is still buzzing around my mind. I still have questions in my mind but will ask the teacher after the vacations.
Live free, with fresh oxygen... :)