You are right about this routine not going any faster in ZP. However, copying data is common operation and in such case, you save bytes on setting the start and end address.
So the code
lda #<start
sta xxx_adr
lda #>start
sta xxx_adr+1
lda #<start
sta yyy_adr
lda #>start
sta yyy_adr+1
is four ...
Search found 41 matches
- Wed Feb 25, 2026 7:01 am
- Forum: Programming
- Topic: Buffer indirection
- Replies: 18
- Views: 1132
- Tue Feb 24, 2026 6:52 am
- Forum: Programming
- Topic: Buffer indirection
- Replies: 18
- Views: 1132
Re: Buffer indirection
If your code is in RAM, you can use self-modifying code very effectively.
Even if in ROM, it may be usefull to reserve some small area of zero page for copy routine.
loop:
lda xxxx,Y
sta yyyy,Y
dey
bne loop
rts
This effectively costs you just 6 bytes in ZP (as xxxx and yyyy would have to be ...
Even if in ROM, it may be usefull to reserve some small area of zero page for copy routine.
loop:
lda xxxx,Y
sta yyyy,Y
dey
bne loop
rts
This effectively costs you just 6 bytes in ZP (as xxxx and yyyy would have to be ...
- Tue Oct 21, 2025 7:59 am
- Forum: Programming
- Topic: Early draft of DWARF standard
- Replies: 7
- Views: 1310
Re: Early draft of DWARF standard
Here are some of my suggestions/questions.
Be warned, that me being not familiar with the DWARF system, they may not be very insightful :-)
Formal suggestions
------
The table "Chipset registers" start with row
31 Chipset Flag Always 1 Identifies chipset space
It would be more readable, if ...
Be warned, that me being not familiar with the DWARF system, they may not be very insightful :-)
Formal suggestions
------
The table "Chipset registers" start with row
31 Chipset Flag Always 1 Identifies chipset space
It would be more readable, if ...
- Mon Oct 06, 2025 6:22 am
- Forum: Programming
- Topic: READ, DATA & RESTORE in my TinyBasic ...
- Replies: 23
- Views: 2313
Re: READ, DATA & RESTORE in my TinyBasic ...
I understand memory constraints very well. We are all on the same forum, after all 
I just could not understand how that 'input evaluator' could be a feature. Now, compromise on the side of code size, that I can understand very well:-)
Rudla
I just could not understand how that 'input evaluator' could be a feature. Now, compromise on the side of code size, that I can understand very well:-)
Rudla
- Fri Oct 03, 2025 6:17 am
- Forum: Programming
- Topic: READ, DATA & RESTORE in my TinyBasic ...
- Replies: 23
- Views: 2313
Re: READ, DATA & RESTORE in my TinyBasic ...
In case of input, this is, i believe, very undesired 'feature'. Especially, if the expression evaluator in this case can reference variables.
For example:
>LIST
10 JOHN = 30
20 INPUT A
30 PRINT A
>RUN
?JOHN
30
This renders input almost useless.
Rudla
It's a feature.
Not really. Let ...
- Thu Oct 02, 2025 6:38 am
- Forum: Programming
- Topic: READ, DATA & RESTORE in my TinyBasic ...
- Replies: 23
- Views: 2313
Re: READ, DATA & RESTORE in my TinyBasic ...
I've not looked at VTL in detail, but my TinyBasic does similar - mostly due to re-use of code, and (I suspect) some slop from an earlier incarnation of the IL (Intermediate Language) that TinyBasics are written in... So:
>LIST
10 INPUT A
20 PR A
>RUN
?1+2
3
In case of input, this is, i ...
>LIST
10 INPUT A
20 PR A
>RUN
?1+2
3
In case of input, this is, i ...
- Wed Oct 01, 2025 6:00 am
- Forum: Programming
- Topic: READ, DATA & RESTORE in my TinyBasic ...
- Replies: 23
- Views: 2313
Re: READ, DATA & RESTORE in my TinyBasic ...
ZX Spectrum Basic allowed using of expressions in DATA statements, which was sometimes quite handy.
Depending on how your code is organized, it can be even simpler, than allowing just constants.
Depending on how your code is organized, it can be even simpler, than allowing just constants.
- Tue Oct 15, 2024 5:43 pm
- Forum: Programming
- Topic: BBC floating point formats
- Replies: 18
- Views: 4760
Re: BBC floating point formats
Loops will probably benefit the most from this feature.
- Thu Sep 19, 2024 11:34 am
- Forum: Programming
- Topic: Interesting race hazard
- Replies: 10
- Views: 4731
Re: Interesting race hazard
Two questions come to mind...
1) can you show us some code?
2) what is supposed to happen in case of buffer overrun?
1) can you show us some code?
2) what is supposed to happen in case of buffer overrun?
- Wed Aug 28, 2024 6:47 am
- Forum: Programming
- Topic: Streamlining code with JSR
- Replies: 18
- Views: 4398
Re: Streamlining code with JSR
I see, you do not call any jsr, even if it looks like you are prepared to do so. Does any call to JSR damage to output?
I suppose you do not have any debugging options on your machne, but maybe try to check some invariants in your code.
Like:
PLA
bmi BAD_VALUE
STA ACIA_DATA ; put character to ...
I suppose you do not have any debugging options on your machne, but maybe try to check some invariants in your code.
Like:
PLA
bmi BAD_VALUE
STA ACIA_DATA ; put character to ...
- Mon Nov 27, 2023 2:24 pm
- Forum: Programming
- Topic: calculating 65c02 instruction size
- Replies: 18
- Views: 10676
Re: calculating 65c02 instruction size
I posted similar table based routine in this thread:
http://forum.6502.org/viewtopic.php?f=2&t=7496
We can compare notes :-)
I like your approach because it also works with the 6502. Does it also deliver the correct results for the legal and illegal opcodes of the 65c02?
Currently it does not ...
http://forum.6502.org/viewtopic.php?f=2&t=7496
We can compare notes :-)
I like your approach because it also works with the 6502. Does it also deliver the correct results for the legal and illegal opcodes of the 65c02?
Currently it does not ...
- Wed Nov 22, 2023 9:06 am
- Forum: Programming
- Topic: calculating 65c02 instruction size
- Replies: 18
- Views: 10676
- Tue May 30, 2023 5:39 am
- Forum: Programming
- Topic: Good strategies for software single stepping
- Replies: 19
- Views: 10842
Re: Good strategies for software single stepping
By 'normal' i meant having the code run and just stop at the specified address - as opposed to the breakpoint that is inserted after the single stepped instruction.
But you are right, Woz's method may be easily updated to support this, even if for the price of speed.
But you are right, Woz's method may be easily updated to support this, even if for the price of speed.
- Mon May 29, 2023 6:19 am
- Forum: Programming
- Topic: Good strategies for software single stepping
- Replies: 19
- Views: 10842
Re: Good strategies for software single stepping
drogon wrote:
hjalfi wrote:
I'd look again about how Woz did it on the Apple II. You don't need to handle BRK at all.
- Wed Feb 22, 2023 8:16 am
- Forum: Programming
- Topic: Single step (ram) with BRK
- Replies: 17
- Views: 4412
Re: Single step (ram) with BRK
You will probably also need to print a list of all currently defined breakpoints and allow clearing some of them.
The best option probably is to have a list of breakpoint addresses and search a breakpoint based on it's address. The same table will contain the code of the instruction you replaced ...
The best option probably is to have a list of breakpoint addresses and search a breakpoint based on it's address. The same table will contain the code of the instruction you replaced ...