Solved

Assembly question

Posted on 2000-05-15
8
195 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now