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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 271
» Latest member: WilliamAnemo
» Forum threads: 1,075
» Forum posts: 6,435

Full Statistics

Online Users
There are currently 224 online users.
» 1 Member(s) | 220 Guest(s)
Bing, Google, Yandex, boriel

Latest Threads
Strange Happenings
Forum: Bug Reports
Last Post: zedex82
05-07-2025, 09:05 AM
» Replies: 0
» Views: 44
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 423
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 334
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,663
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 604
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 937
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 374
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,138
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,920
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 438

 
  Happy Christmas 2012
Posted by: britlion - 12-25-2012, 12:49 AM - Forum: Off-Topic - Replies (2)

Happy Christmas to one and all Smile

Print this item

  debug information
Posted by: wilco2009 - 12-18-2012, 11:42 PM - Forum: Help & Support - Replies (6)

It is possible to debug a zxbasic program in any emulator but at BASIC level (not assembler) using the debug information generated on compiling time?

Print this item

  Definition of macros in the compiler
Posted by: wilco2009 - 12-18-2012, 11:39 PM - Forum: Wishlist - Replies (2)

Could be a good idea to add the possibility to define macros in the same way than C "define" directive.
That's one of the things I miss when I'm programming in ZXBasic

Print this item

  Var declaration checking
Posted by: wilco2009 - 12-18-2012, 11:34 PM - Forum: Wishlist - Replies (5)

Please, Could be possible to add an command option to require declare all variables.
I think, not declared variables is the source of bugs more difficult to find.
The problem is worse when you consider that BASIC is case sensitive.

Print this item

  Non sense results (or error) working with defm strings
Posted by: wilco2009 - 12-15-2012, 10:48 AM - Forum: Help & Support - Replies (2)

Just to save space, I'm coding some strings in inline Asm sentences, and I found a bug.
If you execute the following code:

Code:
Dim x as byte = 1
Dim y as byte = 5
Dim c as byte

textdata:
    Asm
        defm " BILBO GUARDO EL TESORO Y EL  "
        db 0
        defm " ANILLO POR MUCHO TIEMPO, SIN"
        db 0
        defm "    SOSPECHAR SU VERDADERA"
        db 0
        defm "NATURALEZA Y SU TERRIBLE PODER"
        db 0
        defm "HASTA MUCHO TIEMPO DESPUES"
        db 0
        defm "PERO ESO YA ES OTRA HISTORIA.."
        defb $FF
    End Asm

    Border 0: Paper 0: Ink 6: Bright 1: Cls
    dir = @textdata
    Do
        
        c = Peek dir
        
        If c <> 255 Then
            if c <> 0 Then
                print at y, x; Chr$(c)
                x = x   1
            Else
                x = 1
                y = y    2
            End If
            dir = dir   1
        End If
        If Inkey$ <> "" Then Exit Do: End If
    Loop
    Pause 1000
End Sub
You will not get the expected result. Instead of it, you will get a white screen.
If you delete the lines:
Code:
        defm "HASTA MUCHO TIEMPO DESPUES"
        db 0
Program shows a correct behaviour.

I think the bug have relation with the memory reserved by the asm lines, because deleting or adding lines you get differents errors, sometimes you get an "Out of Memory" message or shows the correct result but paper white instead black.

Print this item

  Incorrect values asigned to an uinteger matrix (*solved*)
Posted by: wilco2009 - 12-15-2012, 09:42 AM - Forum: Bug Reports - Replies (1)

Si se compila el siguiente fragmento de código el resultado es muy diferente del esperado:

Code:
Dim obj(15) as uinteger

for i = 0 to 15
   obj(i) = 9999
   Print Obj(i)
nex i

Si ahora consultas el resultado del array de objs, en lugar de contener todos los elementos 9999 contienen el valor 255.

Compiling the following code, the value of the matrix elements is totally diferent to the expected one:
Code:
Dim obj(15) as uinteger

for i = 0 to 15
   obj(i) = 9999
   Print Obj(i)
nex i

All the elements of the obj matrix are now 255 instead 999.
Using a intermediate scalar variable the result is correct.

NOTE: Bug fixed in the new version 1.3.0s952

Print this item

  THE HOBBIT
Posted by: JBGV - 12-07-2012, 09:31 PM - Forum: Gallery - Replies (6)

Hello!

I just finished another game, is for the competition of "Bytemaniacos":

http://www.bytemaniacos.com/?page_id=127

Hope you like ! I've had very good programming it.

Print this item

  Optimiser level 3 bug found (*solved*)
Posted by: LCD - 11-28-2012, 09:25 AM - Forum: Bug Reports - Replies (8)

Hi Boriel!
I just ran into a bug with this code:

Code:
paper 7:ink 0:border 7:cls

Function code2level() as ubyte
    dim adr as uinteger
    dim count as ubyte
    adr=@buffer
    count=0
    do
        if not (peek(Uinteger,adr)-peek(Uinteger,@inpstring+3)+peek(Uinteger,adr+2)-peek(Uinteger,@inpstring+5)+peek(Uinteger,adr+4)-peek(Uinteger,@inpstring+7))
            goto passok
        Else
            count=count+1:adr=adr+6
        end if
    loop until count=32
    count=255
    passok:
    return count
end function

print code2level()

End
inpstring:
asm
    defb 1,1,56
    defm "Leveld"
end asm

buffer:
asm
    defm "Level1"
    defm "Level2"
    defm "Level3"
    defm "Level4"
    defm "Level5"
    defm "Level6"
    defm "Level7"
    defm "Level8"
    defm "Level9"
    defm "Level0"
    defm "Levela"
    defm "Levelb"
    defm "Levelc"
    defm "Leveld"
    defm "Levele"
    defm "Levelf"
    defm "Levelg"
    defm "Levelh"
    defm "Leveli"
    defm "Levelj"
    defm "Levelk"
    defm "Levell"
    defm "Levelm"
    defm "Leveln"
    defm "Levelo"
    defm "Levelp"
    defm "Levelq"
    defm "Levelr"
    defm "Levels"
    defm "Levelt"
    defm "Levelu"
    defm "Levelv"
end asm
Without Optimiser or at level 1 or 2 it displays the correct value (13), but with Optimiser level 3 it runs through all the strings aot finding the correct one, so the output is 255 which here means "code not found".

Print this item

  Bit shift bug. (*solved*)
Posted by: britlion - 11-17-2012, 03:16 PM - Forum: Bug Reports - Replies (5)

Bit shift by 0, when 0 is from a variable=0, which is incorrect!


Code:
DIM num as uByte=1
DIM num2 as uByte=0

PRINT num
PRINT (num<<0)
PRINT (num<<num2)

All three lines should read "1"

Print this item

  Print String Bug (*solved*)
Posted by: britlion - 11-12-2012, 10:41 PM - Forum: Bug Reports - Replies (14)

Confirmed - this demonstrates it. zxb 1.3.0-s928

Code:
DIM score as uLong


SUB displayScore(amount as ulong)
    ink 2
    dim a$ as string
    a$="000000"+STR$(amount)
    print at 12,12;a$(LEN a$-7 TO);"#"
END SUB


FOR score= 0 to 1000000 step 10
displayScore(score)
NEXT score

Should print a string, followed by a # - but the # ends up printing OVER the prior string, not after it and then on the next line and all over the place - the printed string seems to print beyond where it should. Seems to work on some numbers - so perhaps it's a STR$ bug? Though I think I've seen it on non STR$ stuff.


I just spent ages recompiling Berksman trying to find where on earth it was printing blank data across half the screen Smile - It was the print line above! Not my fault!

Print this item