linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: dAvId KeDrOsKy <davidkedrosky@rogers.com>
To: Linux Assembly Programming List <linux-assembly@vger.kernel.org>
Subject: Newbie Question
Date: Thu, 24 Oct 2002 17:42:35 -0400	[thread overview]
Message-ID: <200210241742.35488.davidkedrosky@rogers.com> (raw)

Hello, 

I have recently started learning x86 assembly and have been programming it in 
Linux with NASM (Netwide Assembler). 

I am trying to write a program that takes a string as input, reverses it and 
calculated its length.  I'm using the stack to do so.  

Here's my problem..  NASM only lets me move the string into a 32-bit register.

e.g.  		mov	EBX, the_string		; move memory address of the_string into EBX

At this point I need to push the register on the stack.  I know I can do:

push EBX
call string_length_procedure

BUT I was wondering how it is possible to push BX instead.  Does BX also hold 
the string in this case, considering the size of the string it isn't that 
big?  If not, is there a way to put the contents of EBX (the string) into BX? 
For the time being I would like to just deal with 16-bit registers because it 
is easier to follow along with the book I am using.

P.s. I am using an already coded procedure that gets the string for me and 
puts it into 'string' in this case.

             reply	other threads:[~2002-10-24 21:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-24 21:42 dAvId KeDrOsKy [this message]
2002-10-24 22:15 ` Newbie Question Rudolf Marek
2002-10-24 23:43 ` Brian Raiter
2002-10-25  3:07   ` Robin Miyagi
  -- strict thread matches above, loose matches on Subject: below --
2003-02-27 22:57 dAvId KeDrOsKy
2003-02-27 23:19 ` Dragan Stancevic
2003-02-27 23:26 ` Rudolf Marek
2003-02-27 23:42 ` Robert G. Plantz
2003-02-28  6:28   ` hpr
2003-02-28  0:27 ` Slack Traq
     [not found] <Pine.VMS.3.91-2(vms).1030228001923.25337A-100000@cs.felk.cvut.cz>
2003-02-28  0:45 ` Dragan Stancevic
2005-09-03 17:16 newbie question raphael
2005-09-03 17:36 ` jeff
2005-09-03 20:10   ` Martin Fflores

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200210241742.35488.davidkedrosky@rogers.com \
    --to=davidkedrosky@rogers.com \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).