I'm not going to be much help here, because the assembler can't do conditional assembly yet, and macros are really, really simple. Sorry.
A FORTH assembler can readily do conditional assembly.
: PUSHREGS, PHA,
65C02 @ IF
PHX, PHY,
ELSE
TXA, PHA, TYA, PHA,
THEN ;
(This assumes that tha ...
Search found 85 matches
- Fri Jul 01, 2016 9:24 pm
- Forum: Programming
- Topic: Introducing a Tinkerer's Assembler for the 6502/65c02/65816
- Replies: 44
- Views: 14339
- Sat May 14, 2016 3:53 am
- Forum: Forth
- Topic: CS-101 problems and their FORTH solutions.
- Replies: 93
- Views: 57734
Re: CS-101 problems and their FORTH solutions.
Hah :lol: I'd be interested to hear about this - did you just use PEEK & POKE for the linked lists? Because IIRC Commodore BASIC doesn't have any pointer facilities at all...
No, I used a parallel array of integers where NX%(I) gave the index number of the next element in the main array.
This is ...
No, I used a parallel array of integers where NX%(I) gave the index number of the next element in the main array.
This is ...
- Fri May 13, 2016 6:32 pm
- Forum: Forth
- Topic: CS-101 problems and their FORTH solutions.
- Replies: 93
- Views: 57734
Re: CS-101 problems and their FORTH solutions.
I once did something similar with Commodore 64 Basic. Implementing recursion and linked lists in a language that is designed for neither was an interesting exercise.
- Fri Apr 29, 2016 11:06 am
- Forum: Forth
- Topic: Learn X in Y minutes - Forth
- Replies: 4
- Views: 2812
Re: Learn X in Y minutes - Forth
I'm not sure how I am supposed to react to this website:
Is it, "WOW! Only Y minutes? That's fast!!!"
or "What? I have to spend Y minutes learning this? Who has that much time?"
Is it, "WOW! Only Y minutes? That's fast!!!"
or "What? I have to spend Y minutes learning this? Who has that much time?"
- Thu Apr 07, 2016 10:35 am
- Forum: Forth
- Topic: A non-screen based editor in Forth?
- Replies: 17
- Views: 7753
Re: A non-screen based editor in Forth?
Nice coding there. The comments and stack diagrams are first class.
One question: Were you planning to have all the editor commands be part of a EDIT or EDITOR dictionary or do you have to avoid creating words that conflict with the editor words?
One question: Were you planning to have all the editor commands be part of a EDIT or EDITOR dictionary or do you have to avoid creating words that conflict with the editor words?
- Mon Mar 21, 2016 6:30 pm
- Forum: Forth
- Topic: Is there a good book for learning FORTH
- Replies: 3
- Views: 2187
Re: Is there a good book for learning FORTH
I don't know if they meet your long list of requirements but "Starting Forth" and "Thinking Forth" by Leo Brodie are still definitive texts. You might be able to order them from Amazon but they are mainly available as downloadable files nowadays.
Maybe you should get a kindle.
Maybe you should get a kindle.
- Tue Mar 15, 2016 7:19 am
- Forum: Programming
- Topic: A program for today
- Replies: 38
- Views: 17637
Re: A program for today
Not to start a flame war, but of course the, ah, underlying concept here (no spoilers) is famously wrong , and you should all be ashamed of yourselves for giving it space in a forum where there are young and impressionable minds present. See here for pure truth and beauty on this subject.
I'm ...
I'm ...
- Mon Mar 14, 2016 7:02 pm
- Forum: Programming
- Topic: A program for today
- Replies: 38
- Views: 17637
Re: A program for today
dclxvi wrote:
Just supply an OUTPUT routine, which outputs the character in the accumulator (like pretty much every other output routine ever).
Code: Select all
STA PORT- Fri Mar 11, 2016 2:59 am
- Forum: Programming
- Topic: Handling variables in a basic interpreter
- Replies: 7
- Views: 1290
Re: Handling variables in a basic interpreter
White Flame wrote:
Fixed point wouldn't be that much more expensive to add, but given that it's not as generally useful as floating point, may or may not be worth adding.
- Thu Jan 21, 2016 4:30 am
- Forum: Programming
- Topic: Development Tools Survey
- Replies: 22
- Views: 3757
Re: Development Tools Survey
I expected there to be a front-runner for the assembler.
I guess it depends on what was available at the time you sought out an assembler (C64ASM came out in the 90s though I can't remember when I downloaded it). If it works for you then there is little incentive to change to a different type - no ...
I guess it depends on what was available at the time you sought out an assembler (C64ASM came out in the 90s though I can't remember when I downloaded it). If it works for you then there is little incentive to change to a different type - no ...
- Wed Jan 20, 2016 7:29 am
- Forum: Programming
- Topic: Development Tools Survey
- Replies: 22
- Views: 3757
Re: Development Tools Survey
I use C64ASM.EXE to assemble my 6502 code. This is a DOS program which I run in DOSBOX on my Linux system. A MAKE.BAT file makes it easy to do the necessary assembling without having to remember the switches each time.
For small editing purposes, I will use MSDOS's EDIT program or another DOS ...
For small editing purposes, I will use MSDOS's EDIT program or another DOS ...
- Mon Jan 11, 2016 8:47 am
- Forum: Programming
- Topic: Getting code size even smaller
- Replies: 18
- Views: 6738
Re: Getting code size even smaller
I stewed for many hours cooking the UM/MOD and UD/MOD further down in that thread. I don't have a 6502 Forth handy to do the speed comparison, but I'm willing to bet you a soda pop that mine will beat yours slightly for speed and significantly for size.
You'd win that bet hands down. At the time I ...
You'd win that bet hands down. At the time I ...
- Mon Jan 11, 2016 6:18 am
- Forum: Programming
- Topic: Getting code size even smaller
- Replies: 18
- Views: 6738
Re: Getting code size even smaller
I don't think you need to worry about the source-1 and target-1 baggage if you pre-increment your length and post-increment your load and store pointers.
That would require an additional subroutine call for the post-increment.
@theGSman: I didn't know you were such an optimization freak! After ...
That would require an additional subroutine call for the post-increment.
@theGSman: I didn't know you were such an optimization freak! After ...
- Sun Jan 10, 2016 5:37 pm
- Forum: Programming
- Topic: Getting code size even smaller
- Replies: 18
- Views: 6738
Re: Getting code size even smaller
Looking at your code, you're using the Y reg as an index, so you need to load it with zero and use the indexed indirect page zero addressing.
Even so, my code saves 4 bytes per block subroutine and 7 bytes on the UPD_STL routine. Of course, as you point out, this is to no avail if you have to ...
Even so, my code saves 4 bytes per block subroutine and 7 bytes on the UPD_STL routine. Of course, as you point out, this is to no avail if you have to ...
- Sun Jan 10, 2016 7:09 am
- Forum: Programming
- Topic: Getting code size even smaller
- Replies: 18
- Views: 6738
Re: Getting code size even smaller
As the (further updated) code sits now, the UPD_TL is part is UPD_STL. In the monitor code, UPD_STL is called by the EEPROM program routine, the memory compare routine and the memory move routine. The UPD_TL is called by the memory fill routine. So in all, the update routine is used by four ...