Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 258
» Latest member: manuelzo75
» Forum threads: 1,074
» Forum posts: 6,434

Full Statistics

Online Users
There are currently 331 online users.
» 0 Member(s) | 327 Guest(s)
Applebot, Bing, Google, Yandex

Latest Threads
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 256
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 274
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,558
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 529
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 427
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 298
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,050
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,875
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 412
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,694

 
  Vim syntax file for ZX BASIC
Posted by: programandala.net - 06-17-2010, 07:09 PM - Forum: How-To & Tutorials - Replies (10)

I use the Vim editor a lot; well, it's the only one I use Smile. I wrote a Vim syntax file for ZX BASIC. Maybe it can be useful for someone else.

Print this item

  "Unexpected end of file" because of missing brackets
Posted by: programandala.net - 06-17-2010, 10:55 AM - Forum: Bug Reports - Replies (1)

I got the error "Unexpected end of file" and it took time to find out the stupid reason: I had forgotten to write the brackets in a sub call! That sub needs no parameters, so I naively hadn't written the bracktes in the call Smile

Well, maybe the message could be more explicit? It's not an important issue at all, just a suggestion. Anyway I won't forget the empty brackets again Smile

Code:
pressAnyKey()

Print this item

  Any way to to include command line options into the code?
Posted by: programandala.net - 06-16-2010, 07:25 PM - Forum: Help & Support - Replies (3)

Is there any compiler directive to include command line options into the source? I've looked in the docs and in the forum, and found some mentions about "#pragma", but nothing clear.

I always include the following comment at the top of my source

Code:
' Compile with the following command:
' zxb.py myprogram.bas --tap --autorun --BASIC --strict-bool
in order to remember the options needed (sometimes I tinker with them, and they are not the same for every program). It would be easier to include the options into the source:

Code:
#option tap
#option strict-bool
or
Code:
#options tap strict-bool

Then all programs could be compiled just with zxb.py program.bas. Of course, the actual command line options would have higher priority than those in the source.

Print this item

  First draft of FOR...NEXT
Posted by: programandala.net - 06-16-2010, 03:46 PM - Forum: Documentation - No Replies

I created the first draft of the FOR...NEXT page.

Print this item

  Illegal Character "."
Posted by: britlion - 06-16-2010, 12:50 AM - Forum: Help & Support - Replies (5)

I was playing with putChars to tighten it and add attribs...

This comes back with "illegal character "." in line 52. There is indeed one in that line. It's in a comment. If you remove it (I already removed all the others) it freaks into "Too many errors. Giving up".

Line 52:
; gets screen address in HL, and bytes address in DE. [<<<< This . is apparently an error] Copies the 8 bytes to the screen

I have no idea why!



Code:
SUB Baspaint (x as uByte,y as uByte, width as uByte, height as uByte, attribute as ubyte)
    dim i,j as ubyte
    FOR i=x to x+width-1
        for j=y to y+height-1
        poke (22528+(CAST(uinteger,32)*j)+i),attribute
        next j
    next i
    END SUB
    
    SUB paint (x as uByte,y as uByte, width as uByte, height as uByte, attribute as ubyte)
    print x,y,width,height,attribute
    
    END SUB
    
    
    
    
    
    
    SUB putChars(x as uByte,y as uByte, width as uByte, height as uByte, dataAddress as uInteger)
  
    BLPutChar:
             LD      a,(IX+5)
             ;AND     31
             ld      l,a
             ld      a,(IX+7) ; Y value
             ld      d,a
             AND     24
             add     a,64
             ld      h,a
             ld      a,d
             AND     7
             rrca
             rrca
             rrca
             OR      l
             ld      l,a

    PUSH HL ; save our address

    LD E,(IX+12) ; Marker - This will be poked for the data address by the subroutine
    LD D,(IX+13)
    LD B,(IX+9) ; Marker - this will be poked for the width
    PUSH BC ; save our column count

    BLPutCharColumnLoop:

    LD B,(IX+11) ; Marker - this will be poked for the height by the subroutine

    BLPutCharInColumnLoop:
  
    ; gets screen address in HL, and bytes address in DE. Copies the 8 bytes to the screen
    ld a,(DE) ; First Row
    LD (HL),a
    
    INC DE
    INC H
    ld a,(DE)
    LD (HL),a ; second Row
    
    INC DE
    INC H
    ld a,(DE)
    LD (HL),a ; Third Row
    
    INC DE
    INC H
    ld a,(DE)
    LD (HL),a ; Fourth Row
    
    INC DE
    INC H
    ld a,(DE)
    LD (HL),a ; Fifth Row
    
    INC DE
    INC H
    ld a,(DE)
    LD (HL),a ; Sixth Row
    
    INC DE
    INC H
    ld a,(DE)
    LD (HL),a ; Seventh Row
    
    INC DE
    INC H
    ld a,(DE)
    LD (HL),a ; Eigth Row
    
    INC DE ; Move to next data item.
    
    DEC B
    JR Z,BLPutCharNextColumn
    ;The following code calculates the address of the next line down below current HL address.
    PUSH DE ; save DE
             ld   a,l  
             and  224  
             cp   224  
             jp   z,BLPutCharNextThird

    BLPutCharSameThird:
             ld   de,-1760
             ;and  a        
             add  hl,de      
             POP DE ; get our data point back.
             jp BLPutCharInColumnLoop

    BLPutCharNextThird:
             ld   de,32      
             ;and  a
             add  hl,de  
             POP DE ; get our data point back.
    JP BLPutCharInColumnLoop

    BLPutCharNextColumn:
    POP BC
    POP HL
    DEC B
    JP Z BLPutCharsEnd

    INC HL
    PUSH HL
    PUSH BC
    JP BLPutCharColumnLoop

BLPutCharsEnd:
    end asm

    END SUB

    goto start

    datapoint:
asm
defb 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
defb 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64
defb 65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96
defb 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128
end asm

    start:
    cls
    putChars(10,10,3,3,@datapoint)
    paint(10,10,3,3,79)

Print this item

  Any missing reserved identifier in the docs?
Posted by: programandala.net - 06-09-2010, 02:57 PM - Forum: Documentation - Replies (1)

I think it would be fine to confirm the list of reserved identifiers is complete (even if the linked pages don't exist yet). Then it will be easy to keep it updated with every ZX Basic version.

boriel, may you check it?

Print this item

  First draft of DECLARE
Posted by: programandala.net - 06-09-2010, 02:51 PM - Forum: Documentation - Replies (3)

I've created the first draft of the DECLARE page.

Print this item

  <qbasic> in the docs
Posted by: programandala.net - 06-09-2010, 02:27 PM - Forum: Documentation - Replies (4)

Why the <qbasic> extension is used in the docs? The following code has been taken from the FUNCTION page:

Code:
<qbasic>FUNCTION Factorial(x AS Ulong) AS Ulong
    IF x < 2 THEN RETURN x: END IF
    RETURN Factorial(x - 1) * x
END FUNCTION</qbasic>

The extension highligths the code but also links the keywords to http://www.qbasicnews.com

Print this item

  New beta release 1.2.6r1603b
Posted by: boriel - 06-06-2010, 10:14 AM - Forum: Bug Reports - Replies (3)

This version just adds little improvements to the previous one:

  • Multiplication of bytes a little faster and smaller.
  • Compatibility for DO UNTIL <cond>... LOOP and DO WHILE <cond> ... LOOP as programandala asked.

Download at the Archive.

Note: If you want to be automagically you can register into the wiki and click on "Watch this", so each time the page is changed you will receive a notification (I think it would be a good idea). :roll:

Print this item

  Wiki Improvements
Posted by: britlion - 06-04-2010, 07:35 PM - Forum: Documentation - Replies (11)

All I can say is wow. I like!

I love the new navigation bars that are appearing. Much easier to find your way around with those as an option - I kept having to reload the start page.

Bravo! Thank you for this and all your efforts, Boriel.

Print this item