• NF Assembler

    From Duhast@21:1/5 to All on Wed May 8 20:40:18 2024
    In the Ninjaforce assembler when you do a:

    LDA #"A"

    It assembles without the high bit set. Doesn't play nice with COUT and
    KYBD reading. Is there a way to force it to a high bit or am I stuck converting everything to hex? Didn't see anything in the docs....

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael J. Mahon@21:1/5 to Duhast on Thu May 9 05:01:11 2024
    Duhast <[email protected]> wrote:
    In the Ninjaforce assembler when you do a:

    LDA #"A"

    It assembles without the high bit set. Doesn't play nice with COUT and
    KYBD reading. Is there a way to force it to a high bit or am I stuck converting everything to hex? Didn't see anything in the docs....


    I’m willing to bet that there’s a convention to select hi-ASCII. But regardless, you can always just add 128 to the literal, perhaps with a name like “hi”:

    LDA #”A”+hi

    It would be harder for a longer string, hence the need for a convention.

    --
    -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Blakeney@21:1/5 to Duhast on Thu May 9 09:07:53 2024
    On 2024-05-08 8:40 p.m., Duhast wrote:
    In the Ninjaforce assembler when you do a:

    LDA #"A"

    It assembles without the high bit set.  Doesn't play nice with COUT and
    KYBD reading.  Is there a way to force it to a high bit or am I stuck converting everything to hex?  Didn't see anything in the docs....

    I'm not sure about the NinjaForce assembler but some assemblers used
    double quotes or single quotes to differentiate between ASCII with the
    high bit set or not. I don't know if this was a common convention or
    which quote character set the high bit.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mmphosis@21:1/5 to Duhast on Thu May 9 21:14:11 2024
    Duhast wrote:
    In the Ninjaforce assembler when you do a:

    LDA #"A"

    It assembles without the high bit set. Doesn't play nice with COUT and
    KYBD reading. Is there a way to force it to a high bit or am I stuck converting everything to hex? Didn't see anything in the docs....


    Maybe:

    MSB ON

    MSB Operand is either ON or OFF. - Takes effect on ASC and STR
    commands.

    http://www.ninjaforce.com/html/products_nf_assembler_documentation.html

    -----
    My own cross assembler has this option but I haven't ported it to the Apple IIGS:

    # asm --help|grep '\-8' -
    -8 Set 8th bit of ASCII characters

    # echo 'LDA #"A" '|asm -8|mondump -r|6502
    A=AA X=00 Y=00 S=00 P=22 PC=0300 0
    0300- A9 C1 LDA #$C1 A=C1 X=00 Y=00 S=00 P=A0 PC=0302 2
    0302- 00 BRK A=C1 X=00 Y=00 S=FD P=A0 PC=0000 9
    0000! end

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jan Poulsen@21:1/5 to mmphosis on Fri May 10 10:47:49 2024
    On 09/05/2024 23.14, mmphosis wrote:
    Duhast wrote:
    In the Ninjaforce assembler when you do a:

    LDA #"A"

    It assembles without the high bit set. Doesn't play nice with COUT and
    KYBD reading. Is there a way to force it to a high bit or am I stuck
    converting everything to hex? Didn't see anything in the docs....


    Maybe:

    MSB ON

    MSB Operand is either ON or OFF. - Takes effect on ASC and STR
    commands.

    http://www.ninjaforce.com/html/products_nf_assembler_documentation.html

    -----
    My own cross assembler has this option but I haven't ported it to the Apple IIGS:

    # asm --help|grep '\-8' -
    -8 Set 8th bit of ASCII characters

    # echo 'LDA #"A" '|asm -8|mondump -r|6502
    A=AA X=00 Y=00 S=00 P=22 PC=0300 0
    0300- A9 C1 LDA #$C1 A=C1 X=00 Y=00 S=00 P=A0 PC=0302 2
    0302- 00 BRK A=C1 X=00 Y=00 S=FD P=A0 PC=0000 9
    0000! end


    I don't know if this is relevant to your issue, but SC Assembler on the
    Apple treats single and double quotes differently. Maybe your assembler
    does too.

    0800- A9 41 1000 LDA #'A'
    0802- A9 C1 1010 LDA #"A"

    --
    --
    Jan Poulsen

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Duhast@21:1/5 to Jan Poulsen on Fri May 10 10:36:01 2024
    On 5/10/2024 4:47 AM, Jan Poulsen wrote:
    On 09/05/2024 23.14, mmphosis wrote:
    Duhast wrote:
    In the Ninjaforce assembler when you do a:

    LDA #"A"

    It assembles without the high bit set.  Doesn't play nice with COUT and >>> KYBD reading.  Is there a way to force it to a high bit or am I stuck
    converting everything to hex?  Didn't see anything in the docs....


    Maybe:

    MSB ON

    MSB      Operand is either ON or OFF. - Takes effect on ASC and STR
    commands.

    http://www.ninjaforce.com/html/products_nf_assembler_documentation.html

    -----

    I don't know if this is relevant to your issue, but SC Assembler on the
    Apple treats single and double quotes differently.  Maybe your assembler does too.

    0800- A9 41    1000        LDA #'A'
    0802- A9 C1    1010        LDA #"A"


    MSB ON doesn't seem to have an effect with LDA #"A", looks like I'm
    going to have to do a +128 on every one.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fadden@21:1/5 to Duhast on Sat May 11 08:26:47 2024
    On 5/10/2024 7:36 AM, Duhast wrote:
    MSB ON doesn't seem to have an effect with LDA #"A", looks like I'm
    going to have to do a +128 on every one.

    The documentation says it only affects ASC and STR. It also uses the
    "+128" notation in its examples... if you scroll down to "example of a
    macro call"), it shows two different ways of setting the high bit on a character constant before calling $FDED.

    FWIW, I've used "|$80" elsewhere, which feels a bit closer to the intent
    ("set the high bit"). The docs don't mention bitwise OR operations though.

    Assemblers that trace their origins back to the Apple II usually have
    better support for low/high ASCII, because of the way DOS 3.3 and the
    text screen worked. Similarly, assemblers written by people who grew up
    with a C64 will have better support for alternate character sets
    (PETSCII, screen codes). I'm a little surprised that NF didn't adopt
    the single/double quote approach, given how much else is similar to Merlin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)