Computer Hardware
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsComputer HardwareComputer Hardware

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 15th, 2009, 03:04 PM
emerald09 emerald09 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 1 emerald09 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 22 sec
Reputation Power: 0
Effective memory address calculation

What is the effective address generated by each of the following instruction?

Initially BX=0x0100, label=0x0234, [label]=0x0010, and SI=0x00E1

(Offsets in part a, b and f are in decimal)

1. mov ax, [bx+40]
answer:
0x0140

2. mov ax, [bx+20]
answer:
0x0160

3. mov ax, [bx+label]
answer:
0x0394

4. mov ax, [label+bx]
answer:
0x0404

5. mov ax, [bx+si]
answer:
0x0475

6. mov ax, [si+25]
answer:
0x0106

Kindly check my answers, please point out the mistakes and tell me by an example how to do these.

Reply With Quote
  #2  
Old November 9th, 2010, 10:50 AM
jay387 jay387 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2010
Posts: 1 jay387 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 37 sec
Reputation Power: 0
Post Check this assembly program

[org 0x0100]
mov al, [num1]
mov bl, [num1+1]
mov bl, [num1+2]
add al, bl
mov ax, 0x4c00
int 0x21


num1: db 5, 10, 15, 0


After analysis you have to provide all information that is asked under:

al,bl and IP Register

You have to fill the table given below and write the values of al,bl and IP registers before and after execution of an instruction as you analyze in debugger. You also have to give reason that why the value of al,bl and IP registers change after a particular instruction. Give reason in corresponding column.

Instruction Before Execution After Execution(with Reasons)
Value of al Value of bl Value of IP Value of al Value of bl Value of IP
mov al,[num1]
0000 0000 0100 0005 0000 0103
mov bl,[num1+1]
0005 0000 0103 0005 000A 0107
add al,bl
0005 000A 0107 000F 000A 0109
mov bl,[num1+2]
000F 000A 0109 000F 000F 010D
add al,bl
000F 000F 010D 001E 000F 010F
mov [num1+3],al
001E 000F 010F 001E 000F 0112





You also have to provide the following information

Address of num1=0117
Address of num1+1=0118
Address of num1+2=0119
Address of num1+3=011A
Value of num1+3(at end of program) =?

Reply With Quote
Reply

Viewing: Dev Shed ForumsComputer HardwareComputer Hardware > Effective memory address calculation

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap