DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Assembly (http://www.daniweb.com/forums/forum125.html)
-   -   Help..!! (http://www.daniweb.com/forums/thread191504.html)

keasub May 10th, 2009 5:27 pm
Help..!!
 
If the following code executed, what will be the result of it?

Intel chips use the LITTLE ENDIAN convention. Data transfer between RAM and CPU registers attaches the LOW byte of RAM to the LOW 8 bits of a register. Please refer to the Instruction Set of Intel 8086.
In all of these assignments you are given that bytes in memory starting at address 200 are

Adress : 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 20A, 20B..
Value : 12, 34, 56, 78, AB, CD, EF, 12, 34, 56, 78, 90

CODE for executed

            MOV  BX, 200         
            MOV  AX, [BX] 
            MOV  CX, [BX + 1]
            CMP  AX, CX 
            JB  cxismax     
            SUB  AX, CX
            MOV  DX, AX
            JMP  storeresult
cxismax:    SUB  CX, AX
            MOV  DX, CX
storeresult: MOV  [BX+5], DX

Salem May 10th, 2009 5:51 pm
Re: Help..!!
 
What do you think the result will be?

Nevermind, the answer is 42.


All times are GMT -4. The time now is 7:26 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC