NewsProductsSprinterSupportDownloadSprinter ForumAbout usLinksSite map Russian site

English
   >> Software programming for the computer Sprinter
Thread views: 216 *View all threadsNext thread*

Shaos
(enthusiast)
2002/10/07 15:39
RW1P2 - crosstool for development Sprinter soft Reply to this post

RW1P2 - Crosstool for develop sprite-oriented grafics software for Sprinter,ZX-Spectrum,Orion-128,Specialist,Radio-86RK.
Used RW1 programming language (see http://robots.shaos.ru). Syntax is similar to C-language.
I can offer two programs for show differences between C and RW1:

// hello.c
#include <stdio.h>
main()
{
printf("Hello, World")
}

// hello.rw1
robot "Hello"
author "A.Shabarshin"
main()
{
say "Hello, World"
}

So, RW1 program is "robot" with "author" and main function. At present I develop HELP in English. There is old english documentation.

Similarity C and RW1:
- function main()
- structure if(){...} else{...}
- structure for(;;){...} with break and continue
- structure while(){...} with break and continue
- structure do{...}while() with break and continue
- command goto Label
- command return Expr at end of functions (only v2.1 and above)

RW1 don't have:
- structure switch(){case...} and instead

switch(var)
{
case 0: ok=1; break;
case 2: ok=2; break;
case 3: ok=10; break;
}

we will write

def labs[4]={lab0,0,lab2,lab3}
goto labs[var]
lab0: ok=1; goto end
lab2: ok=2; goto end
lab3: ok=10; goto end
end:

- not support functions that may be used inside expressions (largest minus), but RW1 have "procedures" (in pascal terms) or in other words - functions that may be used inside program body or functions body, not in expressions. And you may use macros inside expressions. See RW1_STD.RWI include file:

@if(3)=((@1)?(@2):(@3))
@max(2)=(((@1)>(@2))?(@1):(@2))
@min(2)=(((@1)<(@2))?(@1):(@2))
@abs(1)=(((@1)<0)?(-(@1)):(@1))
@sqr(1)=((@1)*(@1))
@mod(2)=((@1)%(@2))
@and(2)=((@1)&&(@2))
@or(2)=((@1)||(@2))
@not(1)=(!(@1))
@neg(1)=(-(@1))

If you want use @max macro definition than

aa=10;bb=20;cc=@max(aa,bb)

So cc will be equal 20

- RW1 don't have multidimensional arrays - only onedimention

- variables have size only 16-bit signed (-32768...+32767)

Alexander Shabarshin (shaos@mail.ru)
http://www.shaos.ru


Entire thread
SubjectPosted byPosted on
*RW1P2 - crosstool for development Sprinter soft Shaos   2002/10/07 15:39
.*Re: RW1P2 - crosstool for development Sprinter soft Shaos   2003/06/17 08:14
.*Re: RW1P2 - crosstool for development Sprinter soft Shaos   2003/07/23 21:49
.*Re: RW1P2 - crosstool for development Sprinter sof b00mzi11a   2003/08/06 01:43
.*Re: RW1P2 - crosstool for development Sprinter sof Shaos   2003/08/06 08:24
.*Re: RW1P2 - crosstool for development Sprinter sof b00mzi11a   2003/08/08 22:16
.*Re: RW1P2 - crosstool for development Sprinter sof Shaos   2003/08/09 17:03
.*Re: RW1P2 - crosstool for development Sprinter sof b00mzi11a   2003/08/10 00:44
.*Re: RW1P2 - crosstool for development Sprinter sof Shaos   2003/08/10 11:50
.*Re: RW1P2 - crosstool for development Sprinter sof b00mzi11a   2003/08/10 12:22
.*Re: RW1P2 - crosstool for development Sprinter sof Shaos   2003/08/10 14:17
.*Re: RW1P2 - crosstool for development Sprinter sof b00mzi11a   2003/08/10 14:35
.*Re: RW1P2 - crosstool for development Sprinter sof Shaos   2003/08/10 15:23
.*Re: RW1P2 - crosstool for development Sprinter sof b00mzi11a   2003/08/10 15:31
.*Re: RW1P2 - crosstool for development Sprinter sof Shaos   2003/08/10 15:47
Jump to