Solved

Assembly question

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

data segment

data ends

mov ds,data <--fail ?

tks!
0
Comment
Question by:zystudio
  • 4
  • 2
  • 2
8 Comments
 
LVL 5

Accepted Solution

by:
Wyn earned 200 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

808 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