Legend Posted November 13, 2011 Posted November 13, 2011 Can anyone help me answer this and explain how this was done? please and thank you!
Xittenn Posted November 13, 2011 Posted November 13, 2011 The question has nothing to do with Intel Assembly . . . . . Look at the left hand column each line is divided into 16 address spaces each space holds x number of bytes . . . . this is my hint this looks like homework!
Legend Posted November 14, 2011 Author Posted November 14, 2011 well this is a take home assignment and it is titled intel Assembly, thanks for the hint but its not helping much
immortal Posted November 14, 2011 Posted November 14, 2011 This is done by tracing the program line by line. c:\MASM>MASM FILENAME.ASM ---> for compilation. c:\MASM>LINK FILENAME.OBJ ----> for linking the object file. c:\MASM>DEBUG FILENAME.EXE -----> for debugging or execution of the file. then if you give -G ---> the program will be executed. -T ----> the program will be traced line by line untill one of the registers become zero. There are other commands like that which I have forgot, I hope this helps even I'm not sure about it I learnt about it long back and now I have forgot.
Cap'n Refsmmat Posted November 14, 2011 Posted November 14, 2011 It's just asking for you to convert those hexadecimal bytes into decimal numbers, as far as I can tell. Do you know how to convert between those?
Xittenn Posted November 14, 2011 Posted November 14, 2011 Is the fact that 14CD:59 == 14CD:0059 an issue? Significant digits, the zeros are omitted. . .
Cap'n Refsmmat Posted November 14, 2011 Posted November 14, 2011 14CD:59 seems to be the location of a specific bit of memory, rather than a number, judging by the layout of that picture. It'd be the last two digits in the row starting 14CD:0050.
moth Posted November 14, 2011 Posted November 14, 2011 (edited) The last two columns in that row are 14CD:005E and 14CD:005F. Legend, do you understand how to count in hexadecimal? Edited November 14, 2011 by moth
Legend Posted November 14, 2011 Author Posted November 14, 2011 @ moth yes i know how to count in Hex i just need directs on how to use that skill here so let me get this 14CD:59 ----> answer is 63 14CD:3C ----> answer is 64 is that correct? i thought since its 14CD:59 i go to 14CD:50's line and go to the 9th number, am i wrong?
moth Posted November 14, 2011 Posted November 14, 2011 (edited) @ moth yes i know how to count in Hex i just need directs on how to use that skill here Sorry, I was just so surprised Cap'n misspoke so let me get this 14CD:59 ----> answer is 63 14CD:3C ----> answer is 64 is that correct? i thought since its 14CD:59 i go to 14CD:50's line and go to the 9th number, am i wrong? you are on the right track but you are looking in the wrong spot the byte at 59 is 0x0D. and don't forget x86 words are little endian Edited November 14, 2011 by moth
immortal Posted November 14, 2011 Posted November 14, 2011 You have to start the count from 0 at the line 14CD:50 then you'll get the right answer. And also remember they are asking the value of the word(16 bits) and the double word(32 bits) but you've chosen only 8bits or 1 byte.
Legend Posted November 14, 2011 Author Posted November 14, 2011 so is this the answer? 14CD:59 ----> answer is 0A 0D or 0D 0A? 14CD:3C ----> answer is 64 63 or 63 64?
moth Posted November 14, 2011 Posted November 14, 2011 (edited) Starting at 14CD:59 and making a word you get 0x240D I think (windows 7 doesn't have debug so I can't check). In little endian format the least significant byte of a word is at the lower address. And 0x240D is hex so you still have to convert to decimal. If i remember, in debug you can enter ? or h or help at the prompt. One of those commands that show up will tell you how to load a value from memory to a register (AX,BX, etc) so you can double check if 0x240D is right. It will show up in a register in the correct byte order. Edited November 14, 2011 by moth
Xittenn Posted November 14, 2011 Posted November 14, 2011 55AAH is the Wrong Way to represent the Byte Sequence 55h followed by AAh on a PC
Legend Posted November 14, 2011 Author Posted November 14, 2011 according to a example my professor did, this should be the answer correct me if i am wrong or if i am not presenting the answer correctly 14CD:59 ----> answer is 24 0D 14CD:3C ----> answer is 63 64 correct? or do i have to put "H" next to them?
moth Posted November 14, 2011 Posted November 14, 2011 You have the byte order correct on your first answer. You should mark numbers written in hexadecimal by leading with 0x or a trailing H (0x1234 or 1234 H) so you don't confuse the hex representation for a decimal representation. The question asks for a decimal representation so you still need to convert your answer to decimal. You're not looking in the right spot on your second answer maybe you are looking at 0x3B instead of 0x3C (it takes a while to get used to starting the count at 0). Also how many bytes are in a double word?
immortal Posted November 14, 2011 Posted November 14, 2011 The first one is correct there are no problems with that but I have some doubts for the second one. If I'm not wrong doesn't 14CD:3C point to the location having the byte 00, and so by a dword that would mean 00 00 00 01 and yes ofcourse you need to put 'H' next to them since they are in hexadecimal. I apologize if my answers make you lose some homework points but this is what I think.
Legend Posted November 15, 2011 Author Posted November 15, 2011 yeah forgot that 14CD:3C was double word so its 64 63 63 64 H ?
moth Posted November 15, 2011 Posted November 15, 2011 (edited) You're getting off track somewhere. Are you sure you're not looking at 14CD:5C? What byte do you see at 14CD:3C? Edited November 15, 2011 by moth
doG Posted November 15, 2011 Posted November 15, 2011 ...and so by a dword that would mean 00 00 00 01... yeah forgot that 14CD:3C was double word so its 64 63 63 64 H ? No, Look again.
Legend Posted November 15, 2011 Author Posted November 15, 2011 ummm is 14CD:3C same as saying 14CD:60? since 3C = 60 in decimal, i feel as i am very off....which line do i look at 0_0 *cries* lolz
moth Posted November 15, 2011 Posted November 15, 2011 (edited) Don't worry it's confusing at first but you'll get the hang of it with practice. The addresses on the left are in hex, so find the row 14CD:30 and count 0xC columns to the right. Remember the first column after the address is 14CD:30 the next column is 14CD:31 etc. Edited November 15, 2011 by moth
Legend Posted November 15, 2011 Author Posted November 15, 2011 oh sweet i think i got it C is 12 in decimal so i start from 0 and go to 12 which gives me "00 01 00 00" correct?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now