RISC OS
Jul 19, 2023 16:19:32 GMT 1
Post by alexfish on Jul 19, 2023 16:19:32 GMT 1
Hi All
I have been looking at RISC OS for raspberry pi
For raspberry pi use imager
for other boards LOOK HERE
and RPC for that HERE
LINUX not tested HERE
looking to see if can get BaCon working
in Short present form BaCon is not compatible , will list the bits later
and see if can get some bits working in BaCon sh version , at present not
holding my breath...
the short of the short tested m4basic By Peter HERE
again there are problems esp with mem management > Malloc
Risc os requires -static and mallocs can choke on compile yet some work IE in MID LEFT etc
again here will list them later
so in the short short edited the file to test bits that work
and the harder to set system wise, was the unix env :: took me a week to get there
and in hard core terms where is HOME$..
terminal wise the terminal commands now work in full once your in
and the short bit
the code and the results
most math function are remove but a few did work
resultant c code is for me hard to read , as mentioned post later on details
The Results: and the bit I was after UNIX home environment /
HOME $ =
that last bit not sure why has not printed correct
terminal wise as seen shows
the results were copied to usb stick
More Later
BR
Alex
Forgot to mention the exec compile on Risc os will work on rasperry pi
but not vice versa
Also the terminal here (Tasks) in linux = old black/white or white/black
there is color switch :: no clue how that works
not even sure that was there in the 90's , among other things
I have been looking at RISC OS for raspberry pi
For raspberry pi use imager
for other boards LOOK HERE
and RPC for that HERE
LINUX not tested HERE
looking to see if can get BaCon working
in Short present form BaCon is not compatible , will list the bits later
and see if can get some bits working in BaCon sh version , at present not
holding my breath...
the short of the short tested m4basic By Peter HERE
again there are problems esp with mem management > Malloc
Risc os requires -static and mallocs can choke on compile yet some work IE in MID LEFT etc
again here will list them later
so in the short short edited the file to test bits that work
and the harder to set system wise, was the unix env :: took me a week to get there
and in hard core terms where is HOME$..
terminal wise the terminal commands now work in full once your in
and the short bit
the code and the results
REM Testing 'rem'. We cannot use capitalized keywords in 'rem' statements.
SUB hello()
PRINT "Hello sub" NL
ENDSUB
CLEAR
REM Testing 'declare'
DECLARE a
DECLARE x TYPE short
DECLARE name TYPE char*
DECLARE e
REM We can delare directly with 'string','float','integer'
STRING ab, bc, some
FLOAT gh, ij
INTEGER kl, mn
REM Testing 'const'
CONST g = 56
CONST i = 57
REM Testing 'let' for numbers
LET a = 0
LET x = 1
REM Testing 'set' for strings
SET name = "Hello cruel world"
SET some = "123"
REM Testing 'print'
PRINT "Hello world.\n"
PRINT "Hello world." NL
REM We can only print strings.
PRINT "The value of 'name' is: " PRINT name NL
PRINT "The value of 'a' is: " PRINT STR(a) NL
REM Or use 'print' with 'format'.
PRINT "The value of 'x' is: ", x FORMAT "%s%d\n"
REM Testing 'while'
WHILE a < 10 DO
PRINT STR(a) NL
INCR a, 2
WEND
REM Testing 'if' 'elif' 'else'
IF a > 5 THEN
PRINT "a is bigger than 5.\n"
ELIF a > 10 THEN
PRINT "a is bigger than 10.\n"
ELSE
PRINT "The else clause.\n"
IF 2 < 3 THEN
PRINT "2 is smaller than 3.\n"
ENDIF
ENDIF
REM Testing 'repeat'
REPEAT
PRINT "Decreasing a: " PRINT STR(a) NL
DECR a
UNTIL a == 0
REM Testing 'for'
FOR x = 1 TO 5
PRINT STR(x) NL
NEXT
FOR x = 1 TO 20 STEP 4
PRINT STR(x) NL
NEXT x
PRINT "left: ", LEFT(name, 3) FORMAT "%s%s\n"
PRINT "right: ", RIGHT(name, 3) FORMAT "%s%s\n"
PRINT "mid: ", MID(name, 7, 3) FORMAT "%s%s\n"
PRINT "concat: " PRINT CONCAT("Hello ", "World", "123") NL
PRINT "File '/etc/hosts' exists: " PRINT STR(FILEEXISTS("/etc/hosts")) NL
REM Testing 'goto'
GOTO further
PRINT "Should not be shown.\n"
LABEL further
PRINT "We went here.\n"
REM Testing 'input'
PRINT "Enter some text... " INPUT name
REM Testing 'equal' and 'len'
PRINT EQUAL(LEFT(name,LEN(name)-1), "Hello") FORMAT "%ld\n"
REM Testing some file commands
DECLARE p TYPE FILEPTR
OPEN "file.txt" FOR READWRITE AS p
WRITELN "This is a file test\n" TO p
REWIND p
READLN name FROM p
SEEK p OFFSET 5
CLOSE p
PRINT name
REM Testing 'color'
COLOR FOREGROUND TO BLUE
REM Testing 'sleep'
PRINT "Sleeping 100 msecs..." NL SLEEP 100
COLOR RESET
REM Testing 'address'
PRINT STR(ADDRESS(name)) NL
REM Testing 'memory'
MEMTYPE float
INTEGER mem
LET mem = MEMORY(100)
REM Testing 'poke' and 'peek'
POKE mem, 123.123
PRINT "Peek: " PRINT STR(PEEK(mem)) NL
FREE mem
REM Testing 'random'
FOR x = 1 TO 10
PRINT STR(RANDOM(x)) NL
NEXT
CALL hello()
REM Testing 'deffn'
DEFFN bla(x) = 12 * x
PRINT STR(bla(3)) NL
REM Testing 'getenv'
PRINT GETENV("HOME") NL
REM Tesing 'columns' and 'rows'
PRINT COLUMNS, ROWS FORMAT "Columns: %d - Rows: %d\n"
REM Testing 'end' with optional return status
END 3
most math function are remove but a few did work
resultant c code is for me hard to read , as mentioned post later on details
The Results: and the bit I was after UNIX home environment /
HOME $ =
PRINT GETENV("HOME") NL
[2J[0;0fHello world.
Hello world.
The value of 'name' is: Hello cruel world
The value of 'a' is: 0
The value of 'x' is: 1
0
2
4
6
8
a is bigger than 5.
Decreasing a: 10
Decreasing a: 9
Decreasing a: 8
Decreasing a: 7
Decreasing a: 6
Decreasing a: 5
Decreasing a: 4
Decreasing a: 3
Decreasing a: 2
Decreasing a: 1
1
2
3
4
5
1
5
9
13
17
left: Hel
right: rld
mid: cru
concat: dHello World123
File '/etc/hosts' exists: 0
We went here.
Enter some text... 0
This is a file test
[34mSleeping 100 msecs...
[00m16805812
Peek: 123.123
0
1
0
3
1
2
0
3
1
8
Hello sub
36
/SDFS::RISCOSpi.$/Apps/Support/!UnixHome/home
Columns: 0 - Rows: 45320
that last bit not sure why has not printed correct
terminal wise as seen shows
Columns:45 - Rows:20
the results were copied to usb stick
More Later
BR
Alex
Forgot to mention the exec compile on Risc os will work on rasperry pi
but not vice versa
Also the terminal here (Tasks) in linux = old black/white or white/black
there is color switch :: no clue how that works
not even sure that was there in the 90's , among other things