Two questions
-
I am new to assembly language. and I need help with these two questions: Please post your answer below this thread Question 1: Write a subroutine of 8086 assembly language that can be used for converting a string of numbers (maximum length 4 ASCII digits) to equivalent binary. Question 2: Write a program in 8086 assembly language that accepts two Strings from the keyboard input; store them in two different arrays, finds the length of the two strings, and if lengths are same then compares the two strings.
-
I am new to assembly language. and I need help with these two questions: Please post your answer below this thread Question 1: Write a subroutine of 8086 assembly language that can be used for converting a string of numbers (maximum length 4 ASCII digits) to equivalent binary. Question 2: Write a program in 8086 assembly language that accepts two Strings from the keyboard input; store them in two different arrays, finds the length of the two strings, and if lengths are same then compares the two strings.
I dont have a solution for your problem, but i do have a question. What do you need to use assembly for when you have languages that are much more easier to use? Alex Korchemniy
-
I dont have a solution for your problem, but i do have a question. What do you need to use assembly for when you have languages that are much more easier to use? Alex Korchemniy
-
Hi alex, Thanks for ur response. Assembly is faster as it is more near to machine language. Ranjan Goyal (From India)
It obvious that humans can create more optimized code than compilers. I hope that your time as a developer is worth the pain. Alex Korchemniy
-
Hi alex, Thanks for ur response. Assembly is faster as it is more near to machine language. Ranjan Goyal (From India)
Why not code directly in machine language, since that gets the ultimate speed! rgoyal wrote: Assembly is faster as it is more near to machine language I think you'll find that in this day and age of PIV and Athelon processors, that statement is mute (unless you are writing extremely efficient 3d graphics display code, or coding for the 286). In either case, if you really want the pain, I think a good assembly language book needs to be read first, before reaping the knowledge base of CP.
I Dream of Absolute Zero
-
Why not code directly in machine language, since that gets the ultimate speed! rgoyal wrote: Assembly is faster as it is more near to machine language I think you'll find that in this day and age of PIV and Athelon processors, that statement is mute (unless you are writing extremely efficient 3d graphics display code, or coding for the 286). In either case, if you really want the pain, I think a good assembly language book needs to be read first, before reaping the knowledge base of CP.
I Dream of Absolute Zero
Hi friends, Thanks for your guidance. My above statement is based on the contents available on the following link. http://www.geocities.com/codeteacher/ Can any one of you tell me the name of the proper book? I could not find a tutor for assembly as they are very little in number. I am doing my MCA(Master of Computer Applications(2nd Semester)) through distant learning. Also,I require the answer for those two questions,as those are part of assignment which needs to be submitted. I still have 4 to 5 days left for the purpose(Upto 30th OCT). Need Help. Regards, Ranjan Goyal
-
Hi alex, Thanks for ur response. Assembly is faster as it is more near to machine language. Ranjan Goyal (From India)
We cannot do your homework for you, for fear that you will get a job working for the same company as us, and we will have to do your work as well as our own! Start reading your books, and figure it out for yourself. Once you have 90% of the answer, you can ask for help on how to make the last 10% work and we will be happy to help you. Your are wrong about assembly being faster. In the special case where you have an expert (not a student, like you, though of course you need to start somewhere) who only has to worry about one hardware configureation, then assembly is faster. In today's world what is fast on the intel P4 is often slower on the mobil pentiums, the best compromise for the above two will but the wrong answer for the AMD athalon. You may also have to run on VIA or transmeta CPUS, once again each of those has a different way to make your code fast. Not to mention the Spare, PowerPC, MIPS, and ARM cpus, which do not run the same assembly, yet I've had to make my programs run on. There is one other point of note: the best hand coded assembly is at most 5% faster than a good compiler if all else is equal. Changing your algorithm in a high level language can easilly be worth 100% or more. I'm not faulting your decision to learn assembly, in fact I think everyone should learn one assembly. I'm correcting some assumeptions you have wrong.
-
We cannot do your homework for you, for fear that you will get a job working for the same company as us, and we will have to do your work as well as our own! Start reading your books, and figure it out for yourself. Once you have 90% of the answer, you can ask for help on how to make the last 10% work and we will be happy to help you. Your are wrong about assembly being faster. In the special case where you have an expert (not a student, like you, though of course you need to start somewhere) who only has to worry about one hardware configureation, then assembly is faster. In today's world what is fast on the intel P4 is often slower on the mobil pentiums, the best compromise for the above two will but the wrong answer for the AMD athalon. You may also have to run on VIA or transmeta CPUS, once again each of those has a different way to make your code fast. Not to mention the Spare, PowerPC, MIPS, and ARM cpus, which do not run the same assembly, yet I've had to make my programs run on. There is one other point of note: the best hand coded assembly is at most 5% faster than a good compiler if all else is equal. Changing your algorithm in a high level language can easilly be worth 100% or more. I'm not faulting your decision to learn assembly, in fact I think everyone should learn one assembly. I'm correcting some assumeptions you have wrong.
-
Thanks Henry, For putting me on the track. But I've a doubt. Should I follow the link that I mentioned in my previous posting? Regards Ranjan Goyal
It looks okay to me. I don't know x86 assembly that well. As for what you should do, well that depends on what you want to do. There is very little money in learning assembly language, so if your goal is money, stick with C/C++/C# or something on those lines. If you want to learn how to program, assembly is one part, but once you can do it you are unlikely to use it again.