<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Tue Jun 18, 2013 7:40 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Tue Jun 18, 2013 7:40 am</pubDate>
  <lastBuildDate>Tue Jun 18, 2013 7:40 am</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105432#105432</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=252'&gt;M-Saunders&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Apr 19, 2012 4:23 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;pk_fox wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;can't get  lib_input_number to play ball &lt;img src=&quot;images/smiles/icon_sad.gif&quot; alt=&quot;Sad&quot; border=&quot;0&quot; /&gt;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Please be &lt;span style=&quot;font-weight: bold&quot;&gt;much&lt;/span&gt; more specific! Does it not work at all? Does it return the wrong number? What exactly happens? Does the program crash?&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;pk_fox wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;call lib_input_number&lt;br /&gt;
mov [looplimit],eax ; is this correct ? where is the converted number held ?&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
library.asm tells you: &amp;quot;Store positive integer in EAX&amp;quot;. Please always read the documentation at the start.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;pk_fox wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;; modded lib_input_number&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
How did you modify it? It's very difficult for me to bugfix something when you've changed the routines and not described how...&lt;br /&gt;
&lt;br /&gt;
M</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105432#105432</comments>
                                        <author>M-Saunders</author>
                                        <pubDate>Thu Apr 19, 2012 4:23 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105432#105432</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105424#105424</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=326'&gt;pk_fox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Apr 19, 2012 1:14 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;pk_fox wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;M-Saunders wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;Ah yes, the limit was due to using word sizes. Change this bit of the code (in lib_print_number):&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov eax, 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Start converting number to ASCII&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov word ax, &amp;#91;loopctr&amp;#93;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
to just:&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov dword eax, &amp;#91;loopctr&amp;#93;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
As for passing the limit as a parameter, yep, that's also doable. But bear in mind that the limit number will be passed as an ASCII text string, so you can't use it directly. Instead, you need to convert it from a string to a proper number; there's code for this in lib_input_number in library.asm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Give it a try, good luck, and let me know if you need any help!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
M&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Cheers Mike, I do appreciate your help, how do you know what registers to put what in ( if that makes sense ) I've downloaded a few articles from the web and none of them state in muppet terms &amp;quot;this must go in eax&amp;quot;,&amp;quot;this must be a dword&amp;quot; etc etc... I'm finding it difficult to self help ( I'm sure you dont want me bugging you every day ) ]'m a pro dev of long standing but never got involved with assembler as I never had a need to ( nor do I now but it's fascinating ) keep up the tutorials !!&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Me again !, can't get  lib_input_number to play ball &lt;img src=&quot;images/smiles/icon_sad.gif&quot; alt=&quot;Sad&quot; border=&quot;0&quot; /&gt; this is what I've tried&lt;br /&gt;
    &lt;br /&gt;
_start:&lt;br /&gt;
mov dword [loopctr],0&lt;br /&gt;
;mov dword [looplimit],100&lt;br /&gt;
pop ebx ; argc (argument count)&lt;br /&gt;
pop ebx ; argv[0] (argument 0, the program name)&lt;br /&gt;
pop ebx ; The first real arg, a filename&lt;br /&gt;
mov [filename],ebx&lt;br /&gt;
pop ebx ; extra pop for looplimit param&lt;br /&gt;
mov [buffer],ebx ; then move it to your buffer var&lt;br /&gt;
call lib_input_number&lt;br /&gt;
mov [looplimit],eax ; is this correct ? where is the converted number held ?&lt;br /&gt;
mov ebx,[filename]&lt;br /&gt;
&lt;br /&gt;
; rest of the code unchanged.&lt;br /&gt;
&lt;br /&gt;
; modded lib_input_number&lt;br /&gt;
&lt;br /&gt;
        lib_input_number:&lt;br /&gt;
	pusha&lt;br /&gt;
&lt;br /&gt;
	;mov edi, buffer		;  already populated by me&lt;br /&gt;
	;call lib_input_string ; don't need this call ?&lt;br /&gt;
&lt;br /&gt;
	mov esi, buffer		; buffer has the last popped ebx&lt;br /&gt;
&lt;br /&gt;
	mov eax, 0			; Initialise accumulator&lt;br /&gt;
	mov ebx, 10			; Decimal-system's radix&lt;br /&gt;
&lt;br /&gt;
.next_digit:&lt;br /&gt;
	mov cl, [esi]			; Fetch next character&lt;br /&gt;
	cmp cl, '0'			; Char preceeds '0'?&lt;br /&gt;
	jb .invalid			; Yes, not a numeral&lt;br /&gt;
	cmp cl, '9'			; Char follows '9'?&lt;br /&gt;
	ja .invalid			; Yes, not a numeral&lt;br /&gt;
	mul ebx				; Ten times prior sum&lt;br /&gt;
	and ecx, 0x0F			; Convert char to int&lt;br /&gt;
	add eax, ecx			; Add to prior total&lt;br /&gt;
	inc esi				; Advance source index&lt;br /&gt;
	jmp .next_digit			; And check another char&lt;br /&gt;
	&lt;br /&gt;
.invalid:&lt;br /&gt;
	mov long [tmp], eax		; Get EAX back after popa&lt;br /&gt;
	popa&lt;br /&gt;
	mov long eax, [tmp]&lt;br /&gt;
	ret&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sorry to be a pain</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105424#105424</comments>
                                        <author>pk_fox</author>
                                        <pubDate>Thu Apr 19, 2012 1:14 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105424#105424</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105422#105422</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=252'&gt;M-Saunders&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Apr 19, 2012 12:39 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;pk_fox wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;Cheers Mike, I do appreciate your help, how do you know what registers to put what in ( if that makes sense ) I've downloaded a few articles from the web and none of them state in muppet terms &amp;quot;this must go in eax&amp;quot;,&amp;quot;this must be a dword&amp;quot; etc etc...&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
That's impossible to say -- it depends entirely what you want to do. All good routines and libraries should document which registers they use to receive data, and which registers they use to pass data back. For instance, the comment section at the top of library.asm tells you which registers are used by the corresponding routines.&lt;br /&gt;
&lt;br /&gt;
M</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105422#105422</comments>
                                        <author>M-Saunders</author>
                                        <pubDate>Thu Apr 19, 2012 12:39 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105422#105422</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105416#105416</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=326'&gt;pk_fox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Apr 19, 2012 7:52 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;M-Saunders wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;Ah yes, the limit was due to using word sizes. Change this bit of the code (in lib_print_number):&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov eax, 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Start converting number to ASCII&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov word ax, &amp;#91;loopctr&amp;#93;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
to just:&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov dword eax, &amp;#91;loopctr&amp;#93;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
As for passing the limit as a parameter, yep, that's also doable. But bear in mind that the limit number will be passed as an ASCII text string, so you can't use it directly. Instead, you need to convert it from a string to a proper number; there's code for this in lib_input_number in library.asm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Give it a try, good luck, and let me know if you need any help!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
M&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Cheers Mike, I do appreciate your help, how do you know what registers to put what in ( if that makes sense ) I've downloaded a few articles from the web and none of them state in muppet terms &amp;quot;this must go in eax&amp;quot;,&amp;quot;this must be a dword&amp;quot; etc etc... I'm finding it difficult to self help ( I'm sure you dont want me bugging you every day ) ]'m a pro dev of long standing but never got involved with assembler as I never had a need to ( nor do I now but it's fascinating ) keep up the tutorials !!</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105416#105416</comments>
                                        <author>pk_fox</author>
                                        <pubDate>Thu Apr 19, 2012 7:52 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105416#105416</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105401#105401</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=252'&gt;M-Saunders&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Apr 18, 2012 4:22 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Ah yes, the limit was due to using word sizes. Change this bit of the code (in lib_print_number):&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov eax, 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Start converting number to ASCII&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov word ax, &amp;#91;loopctr&amp;#93;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
to just:&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov dword eax, &amp;#91;loopctr&amp;#93;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
As for passing the limit as a parameter, yep, that's also doable. But bear in mind that the limit number will be passed as an ASCII text string, so you can't use it directly. Instead, you need to convert it from a string to a proper number; there's code for this in lib_input_number in library.asm.&lt;br /&gt;
&lt;br /&gt;
Give it a try, good luck, and let me know if you need any help!&lt;br /&gt;
&lt;br /&gt;
M</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105401#105401</comments>
                                        <author>M-Saunders</author>
                                        <pubDate>Wed Apr 18, 2012 4:22 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105401#105401</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105398#105398</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=326'&gt;pk_fox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Apr 18, 2012 2:50 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;M-Saunders wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;OK, here is a version with lib_print_number included from library.asm, and modified slightly to use the file descriptor. I've marked the additional lines with &amp;quot;XXX&amp;quot; in the comments:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://pastebin.com/hNQjZE8R&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://pastebin.com/hNQjZE8R&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This puts the number before each line in the file. Any questions, just shout!&lt;br /&gt;
&lt;br /&gt;
M&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Hi Mike, thanks very much for your help, one thing I notice is, if I change looplimit to 1000000 the last line in my output file is only 16959 ) Hello, world! - what do I need to change to use larger values ? also I would like to pass the limit as a parameter - is this possible ?</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105398#105398</comments>
                                        <author>pk_fox</author>
                                        <pubDate>Wed Apr 18, 2012 2:50 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105398#105398</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105396#105396</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=252'&gt;M-Saunders&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Apr 18, 2012 1:32 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      OK, here is a version with lib_print_number included from library.asm, and modified slightly to use the file descriptor. I've marked the additional lines with &amp;quot;XXX&amp;quot; in the comments:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://pastebin.com/hNQjZE8R&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://pastebin.com/hNQjZE8R&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This puts the number before each line in the file. Any questions, just shout!&lt;br /&gt;
&lt;br /&gt;
M</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105396#105396</comments>
                                        <author>M-Saunders</author>
                                        <pubDate>Wed Apr 18, 2012 1:32 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105396#105396</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105370#105370</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=326'&gt;pk_fox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Apr 17, 2012 9:59 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;M-Saunders wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;OK, you probably need to change the output stream. Put your current code into pastebin.com and I'll have a look at it!&lt;br /&gt;
&lt;br /&gt;
M&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Hi Mike, never used pastebin before, I've put the code there and called it Code for Mike Saunders&lt;br /&gt;
&lt;br /&gt;
Thanks again</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105370#105370</comments>
                                        <author>pk_fox</author>
                                        <pubDate>Tue Apr 17, 2012 9:59 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105370#105370</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105357#105357</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=252'&gt;M-Saunders&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Mon Apr 16, 2012 1:18 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      OK, you probably need to change the output stream. Put your current code into pastebin.com and I'll have a look at it!&lt;br /&gt;
&lt;br /&gt;
M</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105357#105357</comments>
                                        <author>M-Saunders</author>
                                        <pubDate>Mon Apr 16, 2012 1:18 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105357#105357</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105356#105356</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=326'&gt;pk_fox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Mon Apr 16, 2012 12:49 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;M-Saunders wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;Ah. In that case you'll need a routine to convert a numeric value into its printable ASCII equivalent, and then print it. If you've got LXF156, the lib_print_number routine in library.asm does the trick. If not, I can post it here...&lt;br /&gt;
&lt;br /&gt;
M&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Hi Mike, tried using your print_number code with no success, If I'm reading it correctly your routine expects the number to be printed to be in eax, so I &lt;br /&gt;
*pushed eax* , *moved my value into eax* , called your routine then *popped eax* ; end result utter garbage in my output file &lt;img src=&quot;images/smiles/icon_sad.gif&quot; alt=&quot;Sad&quot; border=&quot;0&quot; /&gt; I am outputting to a file not the screen</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105356#105356</comments>
                                        <author>pk_fox</author>
                                        <pubDate>Mon Apr 16, 2012 12:49 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105356#105356</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105354#105354</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=326'&gt;pk_fox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Mon Apr 16, 2012 9:32 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;M-Saunders wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;Ah. In that case you'll need a routine to convert a numeric value into its printable ASCII equivalent, and then print it. If you've got LXF156, the lib_print_number routine in library.asm does the trick. If not, I can post it here...&lt;br /&gt;
&lt;br /&gt;
M&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Hi Mike, I downloaded the lib code and note that your routine prints to the screen and also adds a newline but I'm going to have a go modifying the code for my needs, thanks again and keep the helpline open &lt;img src=&quot;images/smiles/icon_smile.gif&quot; alt=&quot;Smile&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105354#105354</comments>
                                        <author>pk_fox</author>
                                        <pubDate>Mon Apr 16, 2012 9:32 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105354#105354</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105353#105353</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=326'&gt;pk_fox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Mon Apr 16, 2012 8:39 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Thanks Mike , slight problem I've got the mag but not the dvd which has the code &lt;img src=&quot;images/smiles/icon_sad.gif&quot; alt=&quot;Sad&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105353#105353</comments>
                                        <author>pk_fox</author>
                                        <pubDate>Mon Apr 16, 2012 8:39 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105353#105353</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105350#105350</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=252'&gt;M-Saunders&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Apr 15, 2012 11:03 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Ah. In that case you'll need a routine to convert a numeric value into its printable ASCII equivalent, and then print it. If you've got LXF156, the lib_print_number routine in library.asm does the trick. If not, I can post it here...&lt;br /&gt;
&lt;br /&gt;
M</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105350#105350</comments>
                                        <author>M-Saunders</author>
                                        <pubDate>Sun Apr 15, 2012 11:03 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105350#105350</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105324#105324</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=326'&gt;pk_fox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Apr 14, 2012 12:39 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;M-Saunders wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;What do you mean by line number here -- ie referring to which file?&lt;br /&gt;
&lt;br /&gt;
M&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Hi Mike, sorry for not being clear. at the moment I write this string x times&lt;br /&gt;
 ' ) Hello, world!', what I would like to do is:&lt;br /&gt;
&lt;br /&gt;
'1 ) Hello, world!'&lt;br /&gt;
' 2 ) Hello, world!'&lt;br /&gt;
'3 ) Hello, world!'&lt;br /&gt;
etc...&lt;br /&gt;
&lt;br /&gt;
your tutorials started all this &lt;img src=&quot;images/smiles/icon_wink.gif&quot; alt=&quot;Wink&quot; border=&quot;0&quot; /&gt; good fun though</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105324#105324</comments>
                                        <author>pk_fox</author>
                                        <pubDate>Sat Apr 14, 2012 12:39 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105324#105324</guid>
                                      </item>
                                      <item>
                                        <title>Re: Newbie NASM question</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=105323#105323</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=252'&gt;M-Saunders&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Apr 14, 2012 12:12 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      What do you mean by line number here -- ie referring to which file?&lt;br /&gt;
&lt;br /&gt;
M</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=105323#105323</comments>
                                        <author>M-Saunders</author>
                                        <pubDate>Sat Apr 14, 2012 12:12 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=105323#105323</guid>
                                      </item></channel></rss>