I can use:

Code:
mov ax,ds[bp]
in 16-bit x86asm.But i dont use:
Code:
mov ax,ds[ax]
,
Code:
mov ax,ds[dx]
,
Code:
mov ax,ds[ap]
or
Code:
mov ax,ds[dp]
I'm assuming you're asking why you can't use those 16-bit registers as an offset from the segment address in DS? As far as I know, you can only use the "mov XX, ds:[bp+OFFSET]" form of accessing from DS -- you'll have to use the base pointer BP along with a constant offset.

And welcome to Cemetech! If you're not a bot, then I would suggest posting an introduction post in this thread Smile http://tinyurl.com/6cq7ph9
I'm not a bot.Because i dont like meet part.And thank u for concerned with me.I want to learn x86asm in cmd debugger before fasm or masm.
Helo wrote:
And thank u for concerned with me.


No problem, glad I could help Wink luckily I was familiarizing myself with the old legacy 16-bit instructions left on recent x86/x86-64 model's instruction sets a few days ago, so I could answer this.

As for the reason for why you can't use registers ax, bx, cx, etc. when using segmented offsets from DS, I'm unsure; the only guess I have is that it would be too variable with memory access, or it would make for an inefficient machine operation.

EDIT:

Quote:
I want to learn x86asm in cmd debugger before fasm or masm.


Cool experience, I recently tasked myself with getting familiar with x86-64 assembly using FASM as the assembler of choice (from what I tried out, it was the best, though NASM isn't half bad either). As you can imagine, I'm going to suggest you kick right into using FASM, which has nice assembly bindings for the Win32 API and other popular low-level libraries, including OpenGL Smile It's what I started learning it in!
But i am taking debugger error with "^ ".So i dont conjecture variable with memory access, or it would make for an inefficient machine operation.
As a follow up for why it isn't allowed in x86, as pointed out by Tari in IRC (thanks, Tari!), is simply because the old 16-bit x86 architectures and legacy instructions are non-orthogonal, meaning that you can't do things like "mov ax, ds[bx+5]" simply because intel did not design it to be able to do that, but rather so that the base stack pointer BP solely could.

EDIT: in response to your latest post, would you mind telling us abut your cmd '^' error some more, so that one of use could help you out with it? Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement