Post questions about Section 4.9.2 of textbook Assembly Programming: prob 13- Section 4.10 probs 1,2,3,4, 5. Use the first line of your post as the subject of the post.
loose llama posted at 2021-07-09T18:17:36.000Z
32-bit mode or 64-bit mode?
The homework says that the programming exercises can be completed in 32 or 64 bit mode. I know we are focused on 32 bit only but is it acceptable to submit 64 bit mode for these programming exercises?
"4.10 Programming Exercises
The following exercises may be completed in either 32-bit mode or 64-bit mode."
financial fowl posted at 2021-07-13T07:51:22.000Z
The professor said a while ago that no matter what the homework said, you should only focus on writing your code on 32 bit.
insufficient junglefowl posted at 2021-07-14T03:28:48.000Z
This entire class is in 32-bit mode.
electoral dragon posted at 2021-07-18T19:19:49.000Z
I agree that the hw should be done in 32 bit mode. But also wanted to ask if this means that it is ok to skip the sections in the book that specifically talk about 64 bit mode?
occasional muskox posted at 2021-07-18T22:10:24.000Z
I don't believe we need to worry about the 64-bit content.
skilled silkworm posted at 2021-07-19T01:03:10.000Z
32 bit mode is what we are learning so far. We might have some opportunity to learn 64 bit mode at the end.
breezy bird posted at 2021-07-19T06:02:51.000Z
Yep, 32 bit is what we have been learning and is going to be in 32 - bit mode for the entire class.
thin tick posted at 2021-07-19T06:18:00.000Z
I was wondering this as well because of the professor's emphasis on only using 32-bit.
hilarious harrier posted at 2021-07-19T10:27:07.000Z
Should be 32 bit mode
dizzy cuckoo posted at 2021-07-13T02:55:17.000Z
Just a note from the class tonight on programming homework submission for:
Only submit .code section in a text file, plus .data section if you have declared any data. The purpose is that the professor can then copy your code and execute it in a non-Microsoft assembler. Thanks!
secure salamander posted at 2021-07-14T02:55:27.000Z
I submitted way more than this, but I'll keep it in mind from now on.
consistent centipede posted at 2021-07-16T21:50:02.000Z
Thanks for making note of this, I also have been submitting the entire .asm file, so knowing that we only need to include the .data & .code is better.
statutory squirrel posted at 2021-07-16T22:12:39.000Z
Thanks a bunch! Great to know this,
ugliest trout posted at 2021-07-19T03:56:21.000Z
Thank you so much!
faithful firefly posted at 2021-07-19T04:18:26.000Z
Also, and this has been said a million times, you can leave out the main proc, exitprocess, and dumpregs/other irvine stuff.
abstract aardwolf posted at 2021-07-19T05:03:11.000Z
Thanks for the reminder! Good to know this.
conscious cattle posted at 2021-07-19T05:48:33.000Z
Thank you Amy. Glad to know about this.
close buzzard posted at 2021-07-19T05:59:41.000Z
It just makes it easier for the professor, as the other parts are not implemented by us and is just part of the template to make sure it compiles.
breezy bird posted at 2021-07-19T06:03:23.000Z
Thank you, would have totally missed this!
surviving takin posted at 2021-07-19T06:05:30.000Z
Will we be marked off if we submitted the whole thing already? (for former homeworks)
In problem 1 of section 4.10, it is my understanding from the question that the order of the bytes in bigEndian should be reversed in littleEndian, i.e, it should be 78h, 56h, 34h, 12h. However, to me it looks like the chapter 4 solutions posted maintains the original order of bigEndian in littleEndian as well. Did I get this wrong? Please explain this to me. Thank you.
supposed swordtail posted at 2021-07-16T21:23:53.000Z
The chapter 4 solutions change it to little endian. It looks like it kept the byte ordering as big endian since DumpRegs prints out the bytes in big endian order. Try moving 1 to EAX and calling DumpRegs to see this.
grumpy haddock posted at 2021-07-16T22:57:25.000Z
In the book, section 4.5.3 shows how you can see the elements of an array while debugging, which could be helpful to see if the array becomes littleEndian.
easy dolphin posted at 2021-07-17T05:39:33.000Z
Thank you for your replies! This makes a bit more sense.
dizzy cuckoo posted at 2021-07-18T04:11:11.000Z
Thanks this is very helpful while I am also struggling with HW.
littleEndian will reverse the way it is stored. if i need to declare i will use
littleEndian BYTE 78h, 56h, 34h, 12h
To do it programmatically: (using indirect addressing, reading from bigEndian array and then moving register values in opposite order - have to say little tricky to get it at first. Another way implement is to use two pointers from start and end of array and keep swapping numbers at those pointers till it meets in the middle or low < high condition)
For question 3 what does it mean by the array {0, 2, 5, 9, 10} has gaps of 2, 3, 4, and 1 and whats the reason we need to know this?
entitled earwig posted at 2021-07-19T00:33:46.000Z
When it says gaps, it refers to the difference between consecutive array elements.
advanced anaconda posted at 2021-07-19T04:38:15.000Z
I think this question is a practice for us to loop through an array and do some calculations around it.
The gap means the difference between two consecutive array elements, which can be calculated by subtracting the left element by the right element. For example, 2-0=2, 5-2=3, 9-5=4, 10-9=1.
surviving takin posted at 2021-07-19T06:07:24.000Z
In addition to what Sarah stated, it's simply just an algebra problem that is solved using array functionalities so that's really all you need to know to figure it out.
geographical gopher posted at 2021-07-19T00:25:27.000Z
I'm confused on question 2:
If the input array is values 1,2,3,4,5,6 etc are they saying the output should be 2,1,4,3,6,5? This is also the midterm question so I need to make sure I don't get messed up by the wording lol.
driving deer posted at 2021-07-19T05:23:26.000Z
Hi Aaron,
That is also how I interpreted the question. It says that item i needs to be swapped with item i+1, and then item i+2 with item i+3. So if i is 0, then item 0 is swapped with item 1, and item 2 is swapped with item 3. I believe that you must also assume that the array contains an even number of elements so you do not need to worry about the condition where there's an odd number.
conceptual catfish posted at 2021-07-19T01:34:28.000Z
Problem #2 - Exchanging Pairs of Array Values
Can someone further explain the instructions of this problem, I am not quite sure what I am suppose to be doing.
conceptual catfish posted at 2021-07-19T01:34:47.000Z
Problem #2 - Exchanging Pairs of Array Values
Can someone further explain the instructions of this problem, I am not quite sure what I am suppose to be doing.
entitled earwig posted at 2021-07-22T14:17:23.000Z
I think all you have to do is just use a loop and loop through moving and exchanging the register values.
moaning mastodon posted at 2021-07-19T05:02:56.000Z
I’m still very confused on question 5. Can someone give me a hint?
conscious cattle posted at 2021-07-19T06:09:24.000Z
Hey Aman,
I found this on stackoverflow to initiate the question. Hope that helps.