1 ' An example of assembly code running in a dedicated cog
5 ' ------- asm code start
10 data $58,$4c,$64,$fd ' drvl #38
20 data $5f,$4c,$64,$fd ' drvnot #38
30 data $fe,$21,$8a,$ff ' setq
40 data $1f,$00,$66,$fd ' waitx ##340000000
50 data $f0,$ff,$9f,$fd ' jmp #1
55 ' ------- the end of asm code
60 for i=0 to 19: read a : poke 1000000+i,a : next i
70 cog=coginit(1000000,0)
80 ?"The cog ";cog;" was initialized. Press any key to stop it"
90 if inkey$="" then goto 90
100 cogstop cog : ?"The cog ";cog;" is now stopped."
This example blinks the led until a key is pressed.
Preparing for beta - the new documentation file, this time in pdf format.
I managed to add a bug somewhere to the inkey$ command, that worked in older versions, that I have to find and correct. Also, while upgrading a documentation file , I encountered 3 planned and not implemented yet commands: setcolor, memtop and memlo.
@pik33 said:
coginit/cogstop implemented and pushed.
This is useful. Very much reminds me of poking assembly language opcodes from data statements to run assembly code in BASIC.
The example in the post #182 is exactly this. The assembly code in data lines. Notice I poked these to the PSRAM and used PSRAM address in coginit() - the interpreter supports this.
defchar asciicode, defptr - define a character in the current font. defptr is an address of 16 bytes block that defines 8x16 character. As always, it can be HUB or PSRAM if the address is >$80000
findfirst(pattern,[mode]) - find a file name in the current direvtory that matches the pattern. "mode" is a string and can be nothing, "file" or "dir". If nothing, both files and directories are searched
findnext returns the next file name with pattern set by findfirst or an empty string if no more files.
A pi (3.141...) computing benchmark in Basic. So I tried it on my interpreter and then I discovered that I forgot to implement str$ that is needed there. Also my interpreter doesn't like variables that end wih # and has no 'line input'
So I had to implement str$ and slihghtly modify the program (input instead of line input, rename variables that end in # and it works. Not very fast, however, good PC Basics are much faster on a slower machine
Attached a binary with str$ implemented.
A pi (3.141...) computing benchmark in Basic. So I tried it on my interpreter and then I discovered that I forgot to implement str$ that is needed there. Also my interpreter doesn't like variables that end wih # and has no 'line input'
So I had to implement str$ and slihghtly modify the program (input instead of line input, rename variables that end in # and it works. Not very fast, however, good PC Basics are much faster on a slower machine
Attached a binary with str$ implemented.
That ain't too bad, actually. The 168MHz ArmMite F4 takes ~2.0 seconds.
Tomorrow I will test The 480MHz ArmMite H7 with hardware double-precision floating point.
Comments
coginit/cogstop implemented and pushed.
There can be
cog=coginit(cog#, addr, ptra)
or
cog=coginit(addr,ptra)
In the second case 16 is used for a cog number
Address can be PSRAM:
This example blinks the led until a key is pressed.
Preparing for beta - the new documentation file, this time in pdf format.
I managed to add a bug somewhere to the inkey$ command, that worked in older versions, that I have to find and correct. Also, while upgrading a documentation file , I encountered 3 planned and not implemented yet commands: setcolor, memtop and memlo.
After this, I will prepare a first beta release.
Edit: the documentation text also needs debugging![:) :)](https://forums.parallax.com/resources/emoji/smile.png)
![:( :(](https://forums.parallax.com/resources/emoji/frowning.png)
This is useful. Very much reminds me of poking assembly language opcodes from data statements to run assembly code in BASIC.
The example in the post #182 is exactly this. The assembly code in data lines. Notice I poked these to the PSRAM and used PSRAM address in coginit() - the interpreter supports this.
Let's go beta.
3 new keywords added:
defchar asciicode, defptr - define a character in the current font. defptr is an address of 16 bytes block that defines 8x16 character. As always, it can be HUB or PSRAM if the address is >$80000
findfirst(pattern,[mode]) - find a file name in the current direvtory that matches the pattern. "mode" is a string and can be nothing, "file" or "dir". If nothing, both files and directories are searched
findnext returns the next file name with pattern set by findfirst or an empty string if no more files.
The new binary attached.
You've been quiet for a while.![:+1: :+1:](https://forums.parallax.com/resources/emoji/+1.png)
Great to know that you're still making progress.
Craig
There was too much other work to do.
There was this post on Basic facebook group: https://www.facebook.com/groups/2057165187928233/posts/3540343772943693/
A pi (3.141...) computing benchmark in Basic. So I tried it on my interpreter and then I discovered that I forgot to implement str$ that is needed there. Also my interpreter doesn't like variables that end wih # and has no 'line input'
So I had to implement str$ and slihghtly modify the program (input instead of line input, rename variables that end in # and it works. Not very fast, however, good PC Basics are much faster on a slower machine
Attached a binary with str$ implemented.
That ain't too bad, actually. The 168MHz ArmMite F4 takes ~2.0 seconds.
Tomorrow I will test The 480MHz ArmMite H7 with hardware double-precision floating point.
Craig