Jump to content

Recommended Posts

Posted

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!

Posted

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.

Posted (edited)

The last two columns in that row are 14CD:005E and 14CD:005F.

Legend, do you understand how to count in hexadecimal?

Edited by moth
Posted

@ 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?

Posted (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 by moth
Posted

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.

Posted (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 by moth
Posted

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?

Posted

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?

Posted

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.

Posted (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 by moth
Posted

...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.

Posted

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

Posted (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 by moth

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.