From: <joe...@t-...> - 2007-03-15 08:49:03
|
Hi all, I wrote a word dump, to look around in the memory (s). Unfortunately the output is not column by column due the fact that we have not the possibility to EMIT all the numbers with equal amounts of decimals... Is there a possibility in amforth or do I have to make it all by myself (with <# # #> ....) greetings joh |
From: Matthias T. <mt...@we...> - 2007-03-15 16:06:14
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joerg, > fact that we have not the possibility to EMIT all the numbers > with equal amounts of decimals... emit sends a single character only. Probably you mean . (dot). This uses the free number format which indeed does not provide a field width. > Is there a possibility in amforth or do I have to make it all > by myself (with <# # #> ....) What's wrong with " : my. hex <# # # # # #> type" ? Matthias -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFF+W7dLo3irIddFw4RAjsqAJ9GRKdeaJPHBap/w+piiCvQOT0CnQCfTq7H FDWDJU7hn0Iy7rEouUwKdkY= =6DKV -----END PGP SIGNATURE----- |
From: <joe...@t-...> - 2007-03-15 22:32:33
|
Hi all, -----Original Message----- > Date: Thu, 15 Mar 2007 17:05:49 +0100 > Subject: Re: [Amforth-devel] formated output > From: Matthias Trute > To: Everything around amforth > emit sends a single character only. Probably you mean . (dot). > This uses the free number format which indeed does not provide > a field width. Yes (dot) was the thing I struggle with. Emit only for the right side of the dump - the ASCII print. > > > Is there a possibility in amforth or do I have to make it all > > by myself (with <# # #> ....) > > What's wrong with " : my. hex <# # # # # #> type" ? should work, I'll try it this weekend. Thank you joh |
From: Ulrich H. <uh...@xl...> - 2007-03-15 19:34:18
|
> Is there a possibility in amforth or do I have to make it all > by myself (with <# # #> ....) Hi, for right adjusted number output you often find the words .r or u.r as in: \ amforth : spaces ( u -- ) ?dup if 0 do space loop then ; : u.r ( u w -- ) >r <# #s #> r> over - 0 max spaces type ; w specifies the width of the field, where the number is displayed right aligned, like this: > 100 12 u.r 100 ok > 10 12 u.r 10 ok > 1 12 u.r 1 ok > Regards, Ulli |
From: <joe...@t-...> - 2007-03-15 22:39:03
|
-----Original Message----- > Date: Thu, 15 Mar 2007 20:34:08 +0100 > Subject: Re: [Amforth-devel] formated output > From: Ulrich Hoffmann > To: Everything around amforth > > Is there a possibility in amforth or do I have to make it all > > by myself (with <# # #> ....) > > Hi, > for right adjusted number output you often find the words .r or u.r > as in: > > \ amforth > : spaces ( u -- ) ?dup if 0 do space loop then ; > > : u.r ( u w -- ) > > r <# #s #> r> over - 0 max spaces type ; That leads to a stack underflow (as tested in gforth) > w specifies the width of the field, where the number is > displayed right aligned, like this: > > > 100 12 u.r > 100 ok > > 10 12 u.r > 10 ok > > 1 12 u.r > 1 ok > > > Thanks for your ideas. Greetings joh |
From: Ulrich H. <uh...@xl...> - 2007-03-15 23:56:02
|
Hi Joh, amforth's <# # #> do not work with double cell numbers but only with single cell numbers. gforth's work with double cell numbers. So for gforth you either define \ gforth : u.r ( u w -- ) >r 0 <# #s #> r> over - 0 max spaces type ; 5 10 u.r 5 ok or you use the original definition with double precision numbers: \ gforth : ud.r ( d w -- ) >r <# #s #> r> over - 0 max spaces type ; 5. 10 ud.r 5 ok amforth slightly diverges from Standard Forth behavior here. Regards, Ulli Am Mar 15, 2007 um 11:38 PM schrieb joe...@t-...: > > -----Original Message----- >> Date: Thu, 15 Mar 2007 20:34:08 +0100 >> Subject: Re: [Amforth-devel] formated output >> From: Ulrich Hoffmann >> To: Everything around amforth > >>> Is there a possibility in amforth or do I have to make it all >>> by myself (with <# # #> ....) >> >> Hi, >> for right adjusted number output you often find the words .r or u.r >> as in: >> >> \ amforth >> : spaces ( u -- ) ?dup if 0 do space loop then ; >> >> : u.r ( u w -- ) >>> r <# #s #> r> over - 0 max spaces type ; > > That leads to a stack underflow (as tested in gforth) > > >> w specifies the width of the field, where the number is >> displayed right aligned, like this: >> >>> 100 12 u.r >> 100 ok >>> 10 12 u.r >> 10 ok >>> 1 12 u.r >> 1 ok >>> >> > > Thanks for your ideas. > Greetings > joh > > > > ----------------------------------------------------------------------- > -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |