Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:26 11 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Final PicoMite Release - V6.00.01

     Page 4 of 4    
Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4038
Posted: 10:51pm 09 Jan 2025
Copy link to clipboard 
Print this post

I think the mention of WRITE in that part of OPEN may be a documentation bug.

John
Edited 2025-01-10 08:51 by JohnS
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 75
Posted: 10:54am 10 Jan 2025
Copy link to clipboard 
Print this post

It appears to be what we call "Karteileiche" in German - google translator gives "dead file" for it..  

I looked into the current sources for the PicoMite - the file AllCommands.h has no entry for "Write" - so it seems to be planned once in the past but never realized?

GwBasic has it and MS-QBasic, too:
https://hwiegman.home.xs4all.nl/gw-man/WRITEF.html

  Quote  The WRITE# and PRINT# statements differ in that WRITE# inserts commas between the items as they are written and delimits strings with quotation marks, making explicit delimiters in the list unnecessary. Another difference is that WRITE# does not put a blank in front of a positive number. After the last item in the list is written, a carriage return/line feed sequence is inserted.


I think it is dispensable..

bfwolf
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3284
Posted: 03:07am 11 Jan 2025
Copy link to clipboard 
Print this post

  bfwolf said  @Geoff, Regarding the user manual:
Within the description for the OPEN statement, a WRITE statement is mentioned but never described in detail anywhere else..
Is the WRITE statement "just an alias" for PRINT or are there differences?

I don't know how "WRITE" ended up in that text... I will delete it in the next revision of the manual.

I did consider putting the WRITE command in MMBasic (Bill Gates had it in Microsoft BASIC) but it is easy to do the same thing using the PRINT command and for a microcontroller you try to avoid putting in unnecessary functions.

So no, WRITE is not an alias and was never in MMBasic.

Geoff
Geoff Graham - http://geoffg.net
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 459
Posted: 06:37am 14 Jan 2025
Copy link to clipboard 
Print this post

Hello everyone, I'll ask the experts here!
Is it possible to get the value of a label in MMBASIC?
I need this value to pass to a subroutine for accessing data from different pieces of DATA ...

Sub MeSub(Label)
Restore Label
Read n
...
End Sub

Label1:
DATA nn, nn, nn
Label2:
DATA nn, nn, nn
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1360
Posted: 07:11am 14 Jan 2025
Copy link to clipboard 
Print this post

@javavi
I'm only on my first coffee but..

You mean like this?

This is a great revelation for me  
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5056
Posted: 07:25am 14 Jan 2025
Copy link to clipboard 
Print this post

@Peter,

There is something wrong in the PIO ASSEMBLER. See below code. This code is a copy of the UART RX code in the RP2040 datasheet.

'Statemachine 1 = uart RX
 
 PIO ASSEMBLE 1,".program uart_rx"         'uart tx program from RP2040 datasheet
 pio assemble 1,".line 5"                  '5=start of PIO program memory RX
 PIO ASSEMBLE 1,"start:"                   'label
 PIO ASSEMBLE 1,".wrap target"             'outer loop return
 PIO ASSEMBLE 1,"wait 0 pin 0"             'wait for a start bit
'  PIO ASSEMBLE 1,"good_stop:"                'test ---------- this backwards jump works -----
 PIO ASSEMBLE 1,"set x,7 [10]"             'set counter to 7,wait 10 cycles (=mid lsb)
 PIO ASSEMBLE 1,"bitloop2:"                'inner loop
 PIO ASSEMBLE 1,"in pins,1"                'shif in 1 bit
 PIO ASSEMBLE 1,"jmp x-- bitloop2 [6]"     'if x>0 next bit, delay 6, then x--
 PIO ASSEMBLE 1,"jmp pin good_stop"         'if valid stop bit -> good_stop
 PIO ASSEMBLE 1,"irq 4 rel"                '?? flag for ARM ??
 PIO ASSEMBLE 1,"wait 1 pin 0"             'wait for a valid stop
 PIO ASSEMBLE 1,"jmp start"                'then goto wait for new start (loop)
 PIO ASSEMBLE 1,"good_stop:"                'label ---------- this forward jump does not work
 PIO ASSEMBLE 1,"in null,24"               'shift the data to LSB in the ISR
 PIO ASSEMBLE 1,"push"                     'shift data to fifo
 PIO ASSEMBLE 1,".wrap"                    'outer loop for new character
 PIO assemble 1,".end program list


This program exits with an error code

RUN
[69] PIO assemble 1,".end program list"
Error : label not found at line 9


When I change the ".line 5" to ".line 0" the code compiles correctly.

When I (just for test) change the label "good_stop:" to the position in the code where it is commented out, the code also compiles correctly (although the code would not run). Even with ".line 5" as start address.

So apparently something goes wrong in calculating forward jumps when the start address is not ".line 0".

Please confirm you see the same. This is not new. It exists in 5.09.00rc5 also.

Regards,

Volhout

P.S. and I found another weird thing. When you have 2 labels in your code at the same  location in the code, the compiler also does not work correct. But this is something that typically does not occur. Only by idiots like me. You can simulate this by moving the commented line 2 lines up in the code, so it is next to "start:".
Edited 2025-01-14 17:29 by Volhout
PicomiteVGA PETSCII ROBOTS
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 459
Posted: 07:28am 14 Jan 2025
Copy link to clipboard 
Print this post

PicoMiteVGA MMBasic RP2040 Edition V6.00.01
OPTION CPUSPEED 252000 [315000]
One more question!
Previously, before the release of the PicoMiteVGA V6.00.01 at a frequency of 252000 Hz, it was possible to work with and create a FRAMEBUFFER for one buffer and one layer.
My program rendered graphics in the shadow buffer F and then copied it to the layer L, which was rendered on top of the layer N, and it worked.

MODE 1
FRAMEBUFFER CREATE
FRAMEBUFFER LAYER
...
FRAMEBUFFER WRITE F
Do
...
FRAMEBUFFER COPY F,L,B
Loop

Now it does not work, buffers are created, but layer L is not displayed on top of layer N.
Edited 2025-01-14 17:33 by javavi
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5056
Posted: 07:31am 14 Jan 2025
Copy link to clipboard 
Print this post

Hi javavi,

Overlay of L over N only works in mode 2 (2040). In mode 1 the CPU power is used to process the tiles, and there is no possibility to also "overlay".
I had the exact same question 2 weeks ago.

Volhout
Edited 2025-01-14 17:42 by Volhout
PicomiteVGA PETSCII ROBOTS
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 459
Posted: 07:44am 14 Jan 2025
Copy link to clipboard 
Print this post

  PhenixRising said  
This is a great revelation for me  

You can try passing the label name to the SUB, but I'm not sure that will work for RESTORE Line  

The manual states that the RESTORE command can take a value from a variable.
I don't know how to assign a number from a label to this variable in order to pass it as an argument to the procedure?
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 459
Posted: 07:56am 14 Jan 2025
Copy link to clipboard 
Print this post

  PhenixRising said  @javavi
I'm only on my first coffee but..

Thanks for the direction hint...
Just checked and yes, you can pass a label to a procedure as a string type variable!

MeSUB("Label1")
End

Sub MeSUB(Label$)
Restore Label$
For i=1 To 5
 Read n
 Print n
Next
End Sub

Label1:
Data 1,2,3,4,5
Label2:
Data 6,7,8,9,0
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7857
Posted: 08:14am 14 Jan 2025
Copy link to clipboard 
Print this post

I've done this sort of thing in the past:

n=5
a$="Label"+str$(n)
restore a$
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10232
Posted: 09:11am 14 Jan 2025
Copy link to clipboard 
Print this post

  Quote  There is something wrong in the PIO ASSEMBLER.


Will fix
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 459
Posted: 09:29am 14 Jan 2025
Copy link to clipboard 
Print this post

PicoMiteVGA MMBasic RP2040 Edition V6.00.01
Font 1 '8x12
CLS
For n=0 To 5
 Print @( 0+8*n,0+12*n)"12345";
Next

Gives different results, on the VGA monitor the offset is correct, but in the terminal the first and second lines go the same way along the left edge of the terminal.

12345
12345
 12345
  12345
   12345
    12345
>

Edited 2025-01-14 19:30 by javavi
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10232
Posted: 10:00am 14 Jan 2025
Copy link to clipboard 
Print this post

  Quote  Gives different results, on the VGA monitor the offset is correct, but in the terminal the first and second lines go the same way along the left edge of the terminal.

Will fix
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 459
Posted: 03:18pm 15 Jan 2025
Copy link to clipboard 
Print this post

PicoMiteVGA RP2040 V6.00.1
MODE 1
TILE HEIGHT 12
CLS
LOAD IMAGE file$
LOAD JPG file$

The image is loading, but the strip at the top of the screen with the tile height 12 is not displayed.

Edited 2025-01-16 01:27 by javavi
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10232
Posted: 04:09pm 15 Jan 2025
Copy link to clipboard 
Print this post

  Quote  The image is loading, but the strip at the top of the screen with the tile height 12 is not displayed.

Will fix - nothing to do with load image by the way. The first row of tile colours are being overwritten
 
     Page 4 of 4    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025