Jump to content

Intel Assembly Language Help!


Legend

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

@ 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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.