linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Newbie Question
@ 2002-10-24 21:42 dAvId KeDrOsKy
  2002-10-24 22:15 ` Rudolf Marek
  2002-10-24 23:43 ` Brian Raiter
  0 siblings, 2 replies; 14+ messages in thread
From: dAvId KeDrOsKy @ 2002-10-24 21:42 UTC (permalink / raw)
  To: Linux Assembly Programming List

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.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Newbie Question
@ 2003-02-27 22:57 dAvId KeDrOsKy
  2003-02-27 23:19 ` Dragan Stancevic
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: dAvId KeDrOsKy @ 2003-02-27 22:57 UTC (permalink / raw)
  To: Linux Assembly Programming List

The following program gives me a seg fault.  But I don't understand why.

1.	mov	ebx, dword 1234
2.	mov	ax, [ebx]

To me the code would mean 1) move the integer 1234 into ebx and then 2) move 
the value of ebx into ax.  But of course my reasoning is incorrect.

Feedback would be great.

Dave

^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <Pine.VMS.3.91-2(vms).1030228001923.25337A-100000@cs.felk.cvut.cz>]
* newbie question
@ 2005-09-03 17:16 raphael
  2005-09-03 17:36 ` jeff
  0 siblings, 1 reply; 14+ messages in thread
From: raphael @ 2005-09-03 17:16 UTC (permalink / raw)
  To: linux-assembly

Hello list

I would like to know how i can manage to read the entry
on the keyboard without using C functions like scanf or get.

thank you for the help and forgive my poor english

Raphael



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-09-03 20:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-24 21:42 Newbie Question dAvId KeDrOsKy
2002-10-24 22:15 ` 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

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).