Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #44603

Re: DurexForth v1.5.0

Newsgroups comp.lang.forth
Date 2016-01-05 16:40 -0800
References (6 earlier) <8723e69f-be92-4993-bc4c-d44e21b988c9@googlegroups.com> <n6gs9v$tgf$1@dont-email.me> <dc9d000f-7d6d-4385-9a4c-0f0f1549017a@googlegroups.com> <n6h4dl$u3m$2@dont-email.me> <190dbca1-0309-4e25-99dd-1a47b5ebc1fb@googlegroups.com>
Message-ID <d255cdc8-7f4e-4d50-bf42-2511bf7db72e@googlegroups.com> (permalink)
Subject Re: DurexForth v1.5.0
From hughaguilar96@gmail.com

Show all headers | View raw


On Tuesday, January 5, 2016 at 2:42:17 PM UTC-7, Johan Kotlinski wrote:
> On Tuesday, January 5, 2016 at 8:12:22 PM UTC+1, rickman wrote:
> > Yeah, that's for sure.  So I guess nothing remains to explain why the 
> > C64 was designed this way?
> 
> I think Paul had the right idea. The original Commodore computers were based on the 1963 ASCII standard, with only uppercase characters and the $60-$ff range left undefined. Commodore used this extra space to provide graphics characters for games. It was also possible to switch to a business graphics set, where uppercase + graphics are replaced with lowercase + uppercase.
> 
> One could have imagined that the business set would map to ASCII-1973, but it does not. This is because the keyboard is made so that pressing SHIFT simply toggles the MSB (unshifted 'a'=$41 becomes shifted 'A'=$c1).
> 
> Commodore cut a lot of corners with the C64 to reduce development time and production costs. This example is far from the worst :)
> 
> Johan

I liked the C64 --- that was a very cool computer --- it was a lot better than the Apple-II and cost a lot less.

Rickman is just a troll --- no matter what subject you might have brought up, he would have put it down --- the C64 is a classic of the era though, so putting it down is like putting down the Datsun 280Z.

Anyway, as I said before, good Forth style is to abstract away magic numbers, including ascii values. We have BL that returns the value of a blank, but this doesn't necessarily return 32 on every system. We also have BLANK CR SPACE and SPACES that abstract away the char value used internally. BTW: I don't know why ANS-Forth has both SPACE and SPACES as one or the other should be sufficient. Similarly, BLANK is so trivial to write that it hardly needs to be in the standard. A lot of these could have just been provided in source-code as recommendations, rather put in the standard where they just become clutter. 

ANS-Forth fails to provide a way to obtain the char values of various non-printable characters. The BL constant is the only one standardized, and it didn't have to be standardized because it is easy to obtain like this: 
s"  " drop c@ 
Because of this lack, I have these constants in my novice package:
 8 constant <backspace>
 9 constant <tab>
13 constant <cr>
27 constant <esc>
I don't know of any way to programmatically determine these constants. All of these constants should have been in the ANS-Forth standard, but the best we can do now is to just put these in every program as a pseudo-standard --- change them as necessary when porting to any computer that has different values.

When I was programming in UR/Forth, I had these constants:
1   constant c   \ the size of a char
2   constant w   \ the size of a word, either an integer or pointer
4   constant d   \ the size of a double word
8   constant f   \ the size of a float

Putting these constants at the top of every program as a pseudo-standard allowed me to easily switch back and forth between 16-bit and 32-bit UR/Forth just by changing the constants --- afaik, everybody who used Forth-83 in those days had constants like this that they used to ease the transition from 16-bit to 32-bit. I still have these constants in the novice package --- because they are short, they are more convenient to use than 1 CELLS or 1 FLOATS (W and F respectively).

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

DurexForth v1.5.0 Johan Kotlinski <kotlinski@gmail.com> - 2016-01-04 15:08 -0800
  Re: DurexForth v1.5.0 hughaguilar96@gmail.com - 2016-01-04 20:54 -0800
    Re: DurexForth v1.5.0 Johan Kotlinski <kotlinski@gmail.com> - 2016-01-05 00:48 -0800
      Re: DurexForth v1.5.0 rickman <gnuarm@gmail.com> - 2016-01-05 04:40 -0500
        Re: DurexForth v1.5.0 Johan Kotlinski <kotlinski@gmail.com> - 2016-01-05 02:53 -0800
          Re: DurexForth v1.5.0 rickman <gnuarm@gmail.com> - 2016-01-05 09:19 -0500
            Re: DurexForth v1.5.0 Chris Curl <ccurl609@gmail.com> - 2016-01-05 08:44 -0800
              Re: DurexForth v1.5.0 rickman <gnuarm@gmail.com> - 2016-01-05 11:53 -0500
                Re: DurexForth v1.5.0 Chris Curl <ccurl609@gmail.com> - 2016-01-05 10:28 -0800
                Re: DurexForth v1.5.0 rickman <gnuarm@gmail.com> - 2016-01-05 14:12 -0500
                Re: DurexForth v1.5.0 Paul Rubin <no.email@nospam.invalid> - 2016-01-05 11:16 -0800
                Re: DurexForth v1.5.0 rickman <gnuarm@gmail.com> - 2016-01-05 14:58 -0500
                Re: DurexForth v1.5.0 Paul Rubin <no.email@nospam.invalid> - 2016-01-05 12:03 -0800
                Re: DurexForth v1.5.0 rickman <gnuarm@gmail.com> - 2016-01-05 15:10 -0500
                Re: DurexForth v1.5.0 Paul Rubin <no.email@nospam.invalid> - 2016-01-05 12:36 -0800
                Re: DurexForth v1.5.0 rickman <gnuarm@gmail.com> - 2016-01-05 16:34 -0500
                Re: DurexForth v1.5.0 Johan Kotlinski <kotlinski@gmail.com> - 2016-01-05 13:42 -0800
                Re: DurexForth v1.5.0 hughaguilar96@gmail.com - 2016-01-05 16:40 -0800
                Re: DurexForth v1.5.0 Johan Kotlinski <kotlinski@gmail.com> - 2016-01-05 18:13 -0800
                Re: DurexForth v1.5.0 "Elizabeth D. Rather" <erather@forth.com> - 2016-01-05 16:27 -1000
                Re: DurexForth v1.5.0 Paul Rubin <no.email@nospam.invalid> - 2016-01-05 18:59 -0800
                Re: DurexForth v1.5.0 Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-01-05 22:47 -0800
                Re: DurexForth v1.5.0 "Elizabeth D. Rather" <erather@forth.com> - 2016-01-05 21:37 -1000
                Re: DurexForth v1.5.0 Paul Rubin <no.email@nospam.invalid> - 2016-01-06 00:14 -0800
                Re: DurexForth v1.5.0 Ron Aaron <rambamist@gmail.com> - 2016-01-06 10:32 +0200
                Re: DurexForth v1.5.0 Paul Rubin <no.email@nospam.invalid> - 2016-01-06 00:42 -0800
                Re: DurexForth v1.5.0 Ron Aaron <rambamist@gmail.com> - 2016-01-06 11:02 +0200
                Re: DurexForth v1.5.0 Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-01-06 01:51 -0800
                Re: DurexForth v1.5.0 Ron Aaron <rambamist@gmail.com> - 2016-01-06 12:02 +0200
                Re: DurexForth v1.5.0 Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2016-01-06 10:46 +0000
                Re: DurexForth v1.5.0 Ron Aaron <rambamist@gmail.com> - 2016-01-06 12:49 +0200
                Re: DurexForth v1.5.0 Raimond Dragomir <raimond.dragomir@gmail.com> - 2016-01-06 03:12 -0800
                Re: DurexForth v1.5.0 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-06 18:21 +0000
                Re: DurexForth v1.5.0 Johan Kotlinski <kotlinski@gmail.com> - 2016-01-06 22:57 -0800
                Re: DurexForth v1.5.0 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-07 08:47 +0000
                Re: DurexForth v1.5.0 Coos Haak <chforth@hccnet.nl> - 2016-01-06 13:39 +0100
                Re: DurexForth v1.5.0 Ron Aaron <rambamist@gmail.com> - 2016-01-06 14:45 +0200
                Re: DurexForth v1.5.0 Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-06 12:48 +0000
                Re: DurexForth v1.5.0 Syd Rumpo <usenet@nononono.co.uk> - 2016-01-07 11:09 +0000
                Re: DurexForth v1.5.0 hughaguilar96@gmail.com - 2016-01-06 22:57 -0800
        Re: DurexForth v1.5.0 no.top.post@gmail.com - 2016-01-14 12:45 +0000
  Re: DurexForth v1.5.0 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-05 10:37 +0000
    Re: DurexForth v1.5.0 Johan Kotlinski <kotlinski@gmail.com> - 2016-01-05 03:08 -0800
  Re: DurexForth v1.5.0 Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2016-01-06 12:22 +0100
    Re: DurexForth v1.5.0 Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-06 13:08 +0000
  Re: DurexForth v1.5.0 Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-01-07 03:14 -0500

csiph-web