6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 9:22 am

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sat Aug 24, 2019 4:38 am 
Offline

Joined: Sat Aug 21, 2010 7:52 am
Posts: 231
Location: Arlington VA
JimBoyd wrote:
The assembler I wrote for my Forth for the Commodore 64 is also based on Ragsdale's assembler. I rewrote M/CPU and the index table is ten bytes smaller. I added range checking for the instructions that compile a branch. One change I'm thinking about is removing the comma's at the end of the opcode and control structure names. On the other hand, the code words for the system are written with the comma's in the names and I'd have to rewrite it.

I squeezed it down a bit in PETTIL too. The best reason to leave the commas at the end of the opcodes is that it's how most other RPN Forth Assembly language is written.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 25, 2019 10:10 pm 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
chitselb wrote:
The best reason to leave the commas at the end of the opcodes is that it's how most other RPN Forth Assembly language is written.

Thank you! I don't have experience with other RPN Forth assemblers. I will keep the commas.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 11, 2021 12:31 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895

Does anyone know of any bugs in Ragsdale's assembler?
Blazin' Forth's assembler is based on Ragsdale's and the creator of Blazin' Forth said the following.
Scott Ballantyne wrote:
Actually, there was only one bug ever reported from Blazin' Forth, and I found that myself and uploaded a patch. To tell the truth, there is one other bug in that program, I discovered it years later. It's actually a bug in the assembler - there was a garbage line that should have triggered an error but didn't, it assembled garbage. But the nature of the bug is such that it actually is only triggered extremely rarely. No one has ever reported it. Hehe!

I don't know if he was referring to:
1) The assembler he used to build Blazin' Forth and the bug is in Blazin' Forth.
2) The assembler he included with Blazin' Forth which is based on Ragsdale's.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 11, 2021 12:59 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
chitselb wrote:
The best reason to leave the commas at the end of the opcodes is that it's how most other RPN Forth Assembly language is written.

Which ones have you used? Besides my own, the only one I've used, which was a metacompiler, did this kind of thing:
Code:
( d1 d2 -- f )
CODE D=         TOS 0 + LDA     TOS 4 + CMP     1$ BNE
                TOS 1 + LDA     TOS 5 + CMP     1$ BNE
                TOS 2 + LDA     TOS 6 + CMP     1$ BNE
                TOS 3 + LDA     TOS 7 + CMP     1$ BNE
                POP3-TRUE  JMP
        1$:     POP3-FALSE JMP  END-CODE

No commas. I don't remember any in Forth Dimensions magazine using commas either; but I'd have to look through a lot of old issues to make sure that's true.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 11, 2021 2:01 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895

Interesting. I just got an idea on how to write an editor tool to automate the task of changing the comma terminated version of the mnemonics and control flow words to a version without commas yet it will not affect any other words with commas. I think I'll get rid of those commas after all.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 18, 2021 1:40 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895

I ran into a minor issue which I mention here.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 18, 2023 3:42 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
JimBoyd wrote:
chitselb wrote:
The best reason to leave the commas at the end of the opcodes is that it's how most other RPN Forth Assembly language is written.

Thank you! I don't have experience with other RPN Forth assemblers. I will keep the commas.


I removed the commas from my assembler about two years ago and do not miss them.
This reads much nicer
Code:
CODE BOUNDS  ( N1 N2 -- N1+N2 N1 )
   CLC
   0 ,X LDA  2 ,X ADC  0 ,X STA
   1 ,X LDA  3 ,X ADC  1 ,X STA
   ' SWAP @ JMP  END-CODE

than this
Code:
CODE BOUNDS  ( N1 N2 -- N1+N2 N1 )
   CLC,
   0 ,X LDA,  2 ,X ADC,  0 ,X STA,
   1 ,X LDA,  3 ,X ADC,  1 ,X STA,
   ' SWAP @ JMP,  END-CODE

and it's faster to type.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: