Thank you Paul, looks so simple when you've done it. I did not realize FORTH is built around symbols, like in good old days. Got so used to look for words, descriptors ... Andrey --- In , "Paul B. Webster" <paulb@m...> wrote: > Presuming MAX-FORTH works as one would expect (I've had the kit here > for ten years or more, yet to try it out!), > > > writing 01 at address $1004 should set pin PB0 to +5v > > HEX 01 1004 C! (may need to go DECIMAL later; reads "value, address, > ( Character_put" - language is otherwise word- oriented) > > > For data acquisition, I want > > Write 00 to register $1030 then > > 00 1030 C! > > > Read register $1030 in a loop. When $1030 is more then 128 > > (conversion completed), I would read > > BEGIN > 1030 C@ ( Read character at address ) > 128 > ( 128 is the reference, is greater? ) > UNTIL ( exit loop when true ) > > > > > Read register $1031 > > 1031 C@ ( Read character at this address ) > > . ( Print it out, on this system, presumably to terminal ) > ( That was, by the way, a "dot". ) > > To enter this all as a "word" (program element), encapsulate the text > (leave out all bracketed, BTW) in: > > : READ_INPUT ( define a word of this name ) > ( all above code ) > ; ( complete definition ) > > And execute it by entering that same word; "READ_INPUT". Capitals are > probably not critical. > -- > Cheers, > Paul B. |
|