Re: Question about jumps



randyhyde@xxxxxxxxxxxxx wrote:
Your problem, as others have pointed out, is that you're not to the
point yet where you understand the difference between the string
representation of an integer and the integer itself.

I understand it, but obviously it's in assembler language more complicated
than I thought, but it's my target to learn exactly these basic things.

stdout.put( "Enter an integer:" );
stdin.geti32(); // Read integer from stdin into EAX.
shl( 1, eax ); // Multiply EAX by two
stdout.put( "eax = " );
stdout.puti32( eax );

So why should I deal with assembler, when I could solve it with C-like
methods? That's not what I want to learn.

Now you get to see the effect of the shl instruction without having to
learn all the stuff needed to write your own integer input and output
routines. Sure, at some point you ought to be able to write your own
input and output routines, but for right now the integer I/O routines
in the HLA stdlib are *perfect* for the job.

It's not my target to see what's happened when I type in a number and see
the result on stdout. That's what computer newbies are probably interested
in but I want to understand what the little gremlins in the background are
doing while this happens.

Regards,
Markus

.



Relevant Pages

  • Re: Question about jumps
    ... This has _nothing_ to do with assembly language. ... // Read integer from stdin into EAX. ... input and output routines, but for right now the integer I/O routines ... If that's not acceptable, "printf" is sitting in memory, Not difficult to call it... ...
    (alt.lang.asm)
  • Re: Question about jumps
    ... The fact of the matter is that the most common "assembly language" way ... // Read integer from stdin into EAX. ... input and output routines, but for right now the integer I/O routines ... code would work without the C code that built the Linux kernel. ...
    (alt.lang.asm)
  • Re: book on assembly language
    ... the program is made up by the OS's C++ routines? ... mov eax D$ARect@left ebx D$ARect@Top ... pop eax ebx | mov eax D$ARect@left ...
    (alt.lang.asm)
  • Re: US Military Dead during Iraq War
    ... Is it true that for C language routines we can not to save eax, ecx, ... mov eax, ...
    (alt.lang.asm)
  • Re: Question about jumps
    ... multiplies that value by two. ... covering the shift instructions. ... // Read integer from stdin into EAX. ... learn all the stuff needed to write your own integer input and output ...
    (alt.lang.asm)