Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: RBPLC on August 31, 2019, 09:43:58 AM

Title: Initialization of Strings
Post by: RBPLC on August 31, 2019, 09:43:58 AM
In the first scan I'm trying to define string variables. I tried this with the COPY command but get errors when trying to enter my strings as text into the source field. What is the proper way to write a string to a variable to define it?
Title: Re: Initialization of Strings
Post by: BobO on August 31, 2019, 09:52:58 AM
We probably should look at adding a string option to INIT, but I guess the best way is STRPRINT.
Title: Re: Initialization of Strings
Post by: RBPLC on August 31, 2019, 10:18:59 AM
Thanks Bob. I would recommend something like INIT or COPY so that many of these can be defined in one instruction.
Title: Re: Initialization of Strings
Post by: Bolt on August 31, 2019, 02:49:35 PM
I've often wondered just what the difference is between INIT and COPY.  And MAPIO and COPY.  Why would one use MAPIO when COPY lets you do ranges of elements?
Title: Re: Initialization of Strings
Post by: franji1 on August 31, 2019, 07:33:13 PM
I've often wondered just what the difference is between INIT and COPY.  And MAPIO and COPY.  Why would one use MAPIO when COPY lets you do ranges of elements?
COPY and INIT are both "macros" (along with CALL).  COPY was developed later once we had a better set of "data assignment" instructions.  COPY really should be the one stop shop for 90% of your data assignments.  One of its limitations is string literals - you still have to use STRPRINT for that.  We can definitely look at addressing that in the future.
Title: Re: Initialization of Strings
Post by: ATU on September 01, 2019, 09:06:25 AM
You have my vote for adding string initializations to Init
Title: Re: Initialization of Strings
Post by: franji1 on September 01, 2019, 12:17:17 PM
You have my vote for adding string nationalizations to Init

I was planning on doing it for COPY, but if we do what I want to do, I should also be able to add it to INIT also.  TomAYto TomAHto.  One person's INIT instruction is another person's COPY instruction.
Title: Re: Initialization of Strings
Post by: Andrew S on September 01, 2019, 12:33:54 PM
Thanks. I use INIT much more often that COPY so I'd find that very useful.
Title: Re: Initialization of Strings
Post by: franji1 on September 01, 2019, 01:47:55 PM
COPY is a superset of INIT.  It can do everything INIT does, plus what MOVER and MEMCOPY can do.
Title: Re: Initialization of Strings
Post by: ATU on September 01, 2019, 04:24:16 PM
I have pretty much standardized on using INIT in my initialization stages.
Title: Re: Initialization of Strings
Post by: BobO on September 01, 2019, 05:40:08 PM
I like the idea of adding literals to INIT, we'll just need to see how much it takes.