Page 1 of 2
nxtBasic error with STA "A"
Posted: Wed Jul 24, 2024 9:31 pm
by funkheld
hello, good day.
here is an error with nxtbasic.
thanks.
greeting
---------------------------------
STA "A" 'puts a "A" in the accumulator
SYS $FFD2 'Calls the kernal CHROUT subroutine to print the A on the screen
PRINT GETA 'as the accumulator is not changed by CHROUT, this will return the value 65
---------------------------------
Re: nxtBasic error with STA "A"
Posted: Thu Jul 25, 2024 7:31 am
by unartic
funkheld wrote: ↑Wed Jul 24, 2024 9:31 pm
hello, good day.
here is an error with nxtbasic.
thanks.
greeting
---------------------------------
STA "A" 'puts a "A" in the accumulator
SYS $FFD2 'Calls the kernal CHROUT subroutine to print the A on the screen
PRINT GETA 'as the accumulator is not changed by CHROUT, this will return the value 65
---------------------------------
Hi! The documentation is incorrect.
STA "A" should be LDA "A"
I'll correct the docs asap
Re: nxtBasic error with STA "A"
Posted: Thu Jul 25, 2024 2:28 pm
by funkheld
hello, thanks for info.
I thought you could use this sta now too.
Could you extend this asm so that it works with sta too?
you made a great nxtBasic.
thanks.
greetings
Re: nxtBasic error with STA "A"
Posted: Thu Jul 25, 2024 4:12 pm
by Ed Minchau
No, the language can't be extended; the opcodes are hardwired. Even if we could, STA A would be a useless command, "store the contents of the accumulator in the accumulator".
Re: nxtBasic error with STA "A"
Posted: Thu Jul 25, 2024 6:19 pm
by unartic
funkheld wrote: ↑Thu Jul 25, 2024 2:28 pm
hello, thanks for info.
I thought you could use this sta now too.
Could you extend this asm so that it works with sta too?
you made a great nxtBasic.
thanks.
greetings
To load a value in the processor registers you can use:
LDA "A"
LDX "A"
LDY "A"
To retrieve a value from one of the processor registers, you get use:
var$ = GETA()
var$ = GETX()
var$ = GETY()
Re: nxtBasic error with STA "A"
Posted: Thu Jul 25, 2024 7:28 pm
by funkheld
hello thanks for info.
greeting
Re: nxtBasic error with STA "A"
Posted: Thu Jul 25, 2024 7:30 pm
by funkheld
If I have compiled a basic, where is the ASM program?
I would like to take a look at it, please.
Which assembler did we use to make a prg from the ASM, please?
Thanks.
Greetings
Re: nxtBasic error with STA "A"
Posted: Fri Jul 26, 2024 5:58 am
by unartic
The program is assembled with a custom assembler Ive developed myself (build in). If you compile with -debug option a debug folder is created in wich you’ll find the compiler steps, which includes the assembly listing.
Re: nxtBasic error with STA "A"
Posted: Fri Jul 26, 2024 6:41 am
by funkheld
hello, good day.
there are wonderful ASM assemblers for the x16.
why is the wheel being reinvented here?
I would have preferred to see more light in the ASM code than more secrets.
Can you recompile the asm code that you see with -debug?
thanks.
greetings
Re: nxtBasic error with STA "A"
Posted: Fri Jul 26, 2024 8:02 am
by unartic
funkheld wrote: ↑Fri Jul 26, 2024 6:41 am
hello, good day.
there are wonderful ASM assemblers for the x16.
why is the wheel being reinvented here?
I would have preferred to see more light in the ASM code than more secrets.
Can you recompile the asm code that you see with -debug?
thanks.
greetings
I wanted to make sure there are no dependency's. So, just download nxtBasic and it runs. As this is a Basic language, I recon the assembly side if of little interest
It is not possible to compile files in the /debug folder.
If you want to have look at how the build in functions work, the /asm folder is your friend.