Shop Learn
NEON vs JUNO — Parallax Forums

NEON vs JUNO

In trying to decide whether to move from JUNO to NEON, I found at least two disadvantages of NEON.

NEON does not include the command TO or its equivalent. Sometimes one needs to change the value of constants in a running program without reloading the program. This was known as the "TO" solution. For example: suppose 46 == xyz, I can change its value - 123 TO xyz. I can find no equivalent of TO in NEON.

JUNO allows you to define multiple variables in one line: long rt, yu, ik, .... while NEON requires
long rt long yu long ik ....

I note that EXTEND for NEON includes a section - F32 FLOATING POINT SUPPORT . The key command FCMD only generates an infinite loop. Does anyone have any knowledge how this is supposed to work?

Nick

Comments

  • Hi Nick,
    Yes, in 5.7 there are 2 types of constants: 15bit and 32bit. Therefore to is not there.

    :=! Does not work properly.
    Christof

  • Christof Eb.Christof Eb. Posts: 520
    edited 2021-08-17 08:56
    125000 := lisa \ create a 32bit constant
    
    : :=! \ Usage: 1234 ' 32bit- constant-name :=!
        2 +
        2DUP ( data adr data adr )
        SWAP 16 >> SWAP W!
        2 + W!
    ;
    

    This seems to work. But be careful, the constant has to be defined as a 32bit constant at the beginning. Short constants are coded as wordcodes, totally differently.
    1234 ' lisa :=!
    is the usage. The value can then be short.

  • Christof,

    Thanks for your reply - but the majority of the constants I work with are not 32 bit.

    I note that, unlike JUNO, if you define 2 different constants in NEON with same value, the CFA's will be the same.
    The problem is to change the CFA associated with a specific NFA.

    Nick

  • @nchlor said:
    Christof,

    Thanks for your reply - but the majority of the constants I work with are not 32 bit.

    I note that, unlike JUNO, if you define 2 different constants in NEON with same value, the CFA's will be the same.
    The problem is to change the CFA associated with a specific NFA.

    Nick

    For 15bit numbers, there is no code field, because the number itself is coded into the wordcode, which would normally be the code field address. Wordcodes, that have bit 15 set are numbers, that are loaded onto the stack.

    125000 := lisa \ create a 32bit constant
    : :L! \ Usage: 1234 ' 32bit- constant-name :L!
        2 +
        2DUP ( data adr data adr )
        SWAP 16 >> SWAP W!
        2 + W!
    ;
    
    12 := shorty \ create a 15bit constant
    : :S! \ Usage: 1234 cr NFA' 15bit-constant-name :S! 
        DUP C@ $0F AND + 1+ \ get length of name, goto end
        DUP 1 AND IF 1+ THEN \ align on words
        SWAP $8000 OR SWAP W! \ create and write the wordcode
    ;
    

    The funny thing is, that NFA' does something weird: You have to have the new number on the stack before the line, which contains NFA'. Otherwise the number and the name field address are swapped.

    1234 NFA' shorty :S! \ does not work

    1234
    NFA' shorty :S! \ does work

Sign In or Register to comment.