Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Assembly question

Posted on 2000-05-15
8
Medium Priority
?
209 Views
Last Modified: 2010-04-02
Why this failed?

data segment

data ends

mov ds,data <--fail ?

tks!
0
Comment
Question by:zystudio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 5

Accepted Solution

by:
Wyn earned 800 total points
ID: 2812053
Beause you can not move imme to ds directly ,change it to:

mov dx ,data
mov ds,dx

Regards
Eirnava...
0
 
LVL 22

Expert Comment

by:nietod
ID: 2812058
try

MOV AX,DATA
MOV DS,AX

continues
0
 
LVL 22

Expert Comment

by:nietod
ID: 2812062
Opps, 1 minute too late

The reason is that there is no instruction for moving an immediate value to a segment register.  There is one for moving an immediate to a GP register, like AX (or DC in Wyn's case), so you move the segment value (which is an immediate or constant value) to the GP register and then move the value in the GP register to the segment register.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 22

Expert Comment

by:nietod
ID: 2812068
Note using AX instead of DX will be 1 byte shorter and potentially a little faster.
0
 

Author Comment

by:zystudio
ID: 2812072
Thank you ,nietod and Wyn ...How can I give the points ??

0
 
LVL 5

Expert Comment

by:Wyn
ID: 2812085
oh, sorry ,nietod ...
zystudio , nietod's answer is better ,reject me ..

Regards to you both...
Eirnava
0
 

Author Comment

by:zystudio
ID: 2812116
Nietod , I  post another question for you ,thank you and Wyn!!


0
 
LVL 22

Expert Comment

by:nietod
ID: 2812507
>>  nietod's answer is better ,reject me ..
Thanks, although mine was insignificantly smaller and insignifcantly faster, but assembly programs tend to worry about those things...
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question