The Forth I use has a CLIT which is very easy to implement. The routine fills in the hi-byte with a zero for you. And the compiled code is JSR CLIT followed by one byte instead of 2.
Aother idea is create math routines that treats the literal as two single 8-bit bytes instead of a 16-bit word. It ...
Search found 357 matches
- Thu Apr 04, 2024 2:09 am
- Forum: Programming
- Topic: All roads lead to Rome: a little coding challenge
- Replies: 18
- Views: 15539
- Tue Apr 02, 2024 8:49 pm
- Forum: Programming
- Topic: All roads lead to Rome: a little coding challenge
- Replies: 18
- Views: 15539
Re: All roads lead to Rome: a little coding challenge
I am a little lost here since if you already know the value, why would you need to infer it?
But here is an ideaa. Fill the entire 256 byte page with RTS ($60). Then any location can be caluclated with:
JSR location
...
TSX
LDY $00FF,X
LDA $0100,X
and Y becomes the value if on a page boundary ...
But here is an ideaa. Fill the entire 256 byte page with RTS ($60). Then any location can be caluclated with:
JSR location
...
TSX
LDY $00FF,X
LDA $0100,X
and Y becomes the value if on a page boundary ...
- Sun Mar 17, 2024 6:09 am
- Forum: Forth
- Topic: A Finite State Machine Engine in Forth
- Replies: 14
- Views: 14170
Re: A Finite State Machine Engine in Forth
One change I would make is change the word CONDITION to IF and the word CAUSES to THEN.
Or do you not like IF/THEN statements any more? Or are they not same?
Or do you not like IF/THEN statements any more? Or are they not same?
- Tue Mar 05, 2024 1:50 pm
- Forum: Programming
- Topic: Retesting Accumulator flags
- Replies: 13
- Views: 7797
Re: Retesting Accumulator flags
I have to say, that seems like a poor data structure. The 2 is being used as a signal byte for the next byte and the 2 is basically discarded. What a waste of a byte. If it is not a 2, then use that value. If it is a 2, then check the next byte to see if it is negative. A lot of times they can be ...
- Thu Feb 08, 2024 4:02 pm
- Forum: Programming
- Topic: How to manage identical execution pathes
- Replies: 11
- Views: 7122
Re: How to manage identical execution pathes
if you have a spare register you can use the #$55/AA method.
The Y- reg (or X) is pre-loaded with #$55 (%01010101)
then use this
clc. ; to change Acc to %10101010
tya
bmi s1
sec. ; to change Acc to %01010101
... ;needs a 1-cycle instruction here
s1 rol
tay
The Y- reg (or X) is pre-loaded with #$55 (%01010101)
then use this
clc. ; to change Acc to %10101010
tya
bmi s1
sec. ; to change Acc to %01010101
... ;needs a 1-cycle instruction here
s1 rol
tay
- Fri Jan 19, 2024 12:29 am
- Forum: Forth
- Topic: PUTing number on tos in fig-FORTH
- Replies: 5
- Views: 2816
Re: PUTing number on tos in fig-FORTH
I think AND is used far less than PLUS, so probably doesn't hurt to save a couple bytes at the expense of speed.
- Sat Jan 13, 2024 7:43 am
- Forum: Programming
- Topic: JMP(nn) - indirect JMP question
- Replies: 14
- Views: 7703
Re: JMP(nn) - indirect JMP question
Hoping someone will explain what I'm missing in understanding how indirect JMPs work. For example:
target =$85
.org $200
LDA #0
STA target
LDA #10
STA target+1
...
JMP (target)
...
$1000 .WORD real_destination ; say real_destination is located at $2500
...
real_destination: ...
The way I ...
target =$85
.org $200
LDA #0
STA target
LDA #10
STA target+1
...
JMP (target)
...
$1000 .WORD real_destination ; say real_destination is located at $2500
...
real_destination: ...
The way I ...
- Thu Jan 11, 2024 11:52 am
- Forum: Forth
- Topic: Does EXPECT store a zero at the end of the text?
- Replies: 16
- Views: 9872
Re: Does EXPECT store a zero at the end of the text?
Here is Uniforths definintions for compiling if someone wants to see if they can follow them.
The problem I have with all this is, if one enters a long line of up to 80 characters, like QUERY limits one to, then the next input line is shorter, what prevents INTERPRET from re-compiling the words ...
The problem I have with all this is, if one enters a long line of up to 80 characters, like QUERY limits one to, then the next input line is shorter, what prevents INTERPRET from re-compiling the words ...
- Tue Jan 09, 2024 6:37 pm
- Forum: Forth
- Topic: Does EXPECT store a zero at the end of the text?
- Replies: 16
- Views: 9872
Re: Does EXPECT store a zero at the end of the text?
... Back to the zero at the end of words, after EXPECT has input a word definition, then when following INTERPRET, it isn't clear how INTERPRET ends.
";" finishes up the definition, compiling EXIT and clearing the smudge bit, and setting state to interpret, but then INTERPRET would continue with ...
";" finishes up the definition, compiling EXIT and clearing the smudge bit, and setting state to interpret, but then INTERPRET would continue with ...
- Mon Jan 08, 2024 8:33 am
- Forum: Forth
- Topic: Does EXPECT store a zero at the end of the text?
- Replies: 16
- Views: 9872
Re: Does EXPECT store a zero at the end of the text?
So far I have collected 14 Forth's written for the Apple II computer, which most are early varieties based on '78 and '79 Forth's. There are 4 that would be considered more advanced, with 3 following FigForth, and a recent one I just came across, called UniForth, follows, or tries to follow the '83 ...
- Mon Jan 08, 2024 8:10 am
- Forum: Forth
- Topic: Exploring 64Forth
- Replies: 2
- Views: 27198
Re: Exploring 64Forth
I am starting to think the zero at the end of the line only refers to Forth's that deal with screens and not text files. Not only does Interpret end when interpreting a word, but screens also end when trying to list a screen if a zero is accidentally stored in the middle of a screen.
- Wed Jan 03, 2024 12:11 am
- Forum: Forth
- Topic: Required: recommendation for a Forth variant to use
- Replies: 17
- Views: 74943
Re: Required: recommendation for a Forth variant to use
I see you use $D000.DFFF for I/O. The Apple II uses $C000.CFFF for expansion cards and softswitches. But it also has separate memory ($400 bytes) for a text page and ($2000 bytes) set aside for a graphics page. Are these pages expected to be handled by an expansion card plugged in, and if so, how ...
- Mon Jan 01, 2024 7:56 pm
- Forum: Programming
- Topic: Text Editor Shifting Mechanics
- Replies: 95
- Views: 22891
Re: Text Editor Shifting Mechanics
I agree. The monitor listing is an indespensible tool. Nowadays though, 99% of my errors are because I forgot some syntax in the way my Assembler works, or my typing can't keep up to my brain and I drop an important instruction. Damn serial connection from my brain to my hands isn't fast enough.
- Sat Dec 30, 2023 2:16 am
- Forum: Programming
- Topic: Text Editor Shifting Mechanics
- Replies: 95
- Views: 22891
Re: Text Editor Shifting Mechanics
Some of those ideas go way over my head :) Maybe I'm just a visual learner...
But I especially like the "insert 256 characters" idea! Maybe it could also be "insert new line" or "insert row". Lots of ways to take that.
If anyone else has any ideas I'm all ears.
"Insert new line" won't work ...
But I especially like the "insert 256 characters" idea! Maybe it could also be "insert new line" or "insert row". Lots of ways to take that.
If anyone else has any ideas I'm all ears.
"Insert new line" won't work ...
- Fri Dec 29, 2023 1:28 pm
- Forum: Programming
- Topic: Text Editor Shifting Mechanics
- Replies: 95
- Views: 22891
Re: Text Editor Shifting Mechanics
There are a few options. One is to use expanded memory if you can have access to a 1 meg card, would be a big help swapping memory in and out.
But if it is all memory swapping on and off of a disk, I would go with another option. Have a Ctrl-char sequence that inserts 255 spaces into the document ...
But if it is all memory swapping on and off of a disk, I would go with another option. Have a Ctrl-char sequence that inserts 255 spaces into the document ...