Discussion:
NF Assembler
(too old to reply)
Duhast
2024-05-09 00:40:18 UTC
Permalink
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....
Michael J. Mahon
2024-05-09 05:01:11 UTC
Permalink
Post by Duhast
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
Jeff Blakeney
2024-05-09 13:07:53 UTC
Permalink
Post by Duhast
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.
mmphosis
2024-05-09 21:14:11 UTC
Permalink
Post by Duhast
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
Jan Poulsen
2024-05-10 08:47:49 UTC
Permalink
Post by mmphosis
Post by Duhast
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....
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
# 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
Duhast
2024-05-10 14:36:01 UTC
Permalink
Post by Jan Poulsen
Post by mmphosis
Post by Duhast
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....
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.
fadden
2024-05-11 15:26:47 UTC
Permalink
Post by Duhast
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.
Loading...