Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 131 users online: 9 members, 96 guests and 26 bots. Members: hellninjas, MGOS, Spyro543, Thunderbird336, tifreak8x, willwac, Xeda112358. Bots: Spinn3r (3), Magpie Crawler (3), Googlebot (18), MSN/Bing (2).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
Helo
Newbie

Joined: 05 Jan 2012 Posts: 10
|
Posted: 05 Jan 2012 11:20:43 am Post subject: ptr in x86 asm |
|
|
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]
|
|
| Back to top |
|
|
Ashbad

... I think redheaded girls are kind of cool

Joined: 01 Dec 2010 Posts: 2417 Location: Stomp Stomp Stomp, The Idiot Convention
|
Posted: 05 Jan 2012 12:29:37 pm Post subject: |
|
|
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 http://tinyurl.com/6cq7ph9 _________________ -Ashbad |
|
| Back to top |
|
|
Helo
Newbie

Joined: 05 Jan 2012 Posts: 10
|
Posted: 05 Jan 2012 03:48:02 pm Post subject: |
|
|
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.
Last edited by Helo on 05 Jan 2012 03:53:17 pm; edited 1 time in total |
|
| Back to top |
|
|
Ashbad

... I think redheaded girls are kind of cool

Joined: 01 Dec 2010 Posts: 2417 Location: Stomp Stomp Stomp, The Idiot Convention
|
Posted: 05 Jan 2012 03:52:35 pm Post subject: |
|
|
| Helo wrote: | | And thank u for concerned with me. |
No problem, glad I could help 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 It's what I started learning it in! _________________ -Ashbad
Last edited by Ashbad on 05 Jan 2012 04:03:26 pm; edited 1 time in total |
|
| Back to top |
|
|
Helo
Newbie

Joined: 05 Jan 2012 Posts: 10
|
Posted: 05 Jan 2012 04:01:00 pm Post subject: |
|
|
| But i am taking debugger error with "^ ".So i dont conjecture variable with memory access, or it would make for an inefficient machine operation. |
|
| Back to top |
|
|
Ashbad

... I think redheaded girls are kind of cool

Joined: 01 Dec 2010 Posts: 2417 Location: Stomp Stomp Stomp, The Idiot Convention
|
Posted: 05 Jan 2012 05:43:48 pm Post subject: |
|
|
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?  _________________ -Ashbad |
|
| Back to top |
|
|
|
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
|
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
|
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.029401 seconds.
|