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 322 online users.
» 0 Member(s) | 318 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

 
  Including / compiling code to different addresses
Posted by: JMcGibbitts - 06-08-2019, 08:14 PM - Forum: Help & Support - Replies (1)

Hi there,

I'm in need of some advice with loading code to specific addresses.


1. A way to include a ZXBC basic file - during compilation - at a specific address. Something like this...
#INCLUDE "font.bas" ' load font relevant code to 24576
#INCLUDE "setup.bas" ' load program setup code to 24576 + compiled size of font.bas
#INCLUDE "graphicscode.bas", 38000 ' load graphics code and variables direct to address 38000.

This would see non-speed critical #INCLUDE code (and variables) first compiled to the program's ORG address (24576) and code (and variables) that must run in uncontended memory space - placed at the specified address.


2. How to directly include a binary blob to a specific address, without the use of labels and memmove, memcopy, zx7 unpack, etc. Something like this...
ASM
INCBIN "graphics.bin", 45000
END ASM

Thanks

Print this item

  Is there any way to create a DIM with variables?
Posted by: maeloterkim - 06-04-2019, 05:14 PM - Forum: Help & Support - Replies (3)

Hi

I'm trying this

DIM variableName( 20 * ( myVariable + 1 ) ) AS UBYTE

but the compiler says : "Array bounds muts be constants"

Is there any way to create a DIM with variables?

With a Basic variable?

Thanks

Print this item

  If I do a FUNCTION or SUB When is good to make it fastcall ?
Posted by: maeloterkim - 06-01-2019, 03:24 PM - Forum: Help & Support - Replies (2)

Hi

Well... this is the question Smile

If I do a FUNCTION or SUB When is good to make it fastcall ?

how can i know if ist's better as a fastcall or not?

How can i know that?

Thanks

Print this item

  esxDos file open for write
Posted by: nihirash - 05-10-2019, 05:55 PM - Forum: Help & Support - Replies (2)

Hello!

I'm trying make scl2trd tool for esxDos.

I did:

Code:
InputStream = ESXDosOpen(InputFile$ + ".SCL", EDOS_FMODE_READ)

if (InputStream = -1) then
    print "Failed to open file"
    ESXDosClose(InputStream)
    stop
end if
VerifyScl(InputStream)

' Creating TRD-file where it will be written
OutputStream = ESXDosOpen(InputFile$ + ".TRD", EDOS_FMODE_WRITE | EDOS_FMODE_CREATE_AL)
print "IS: "; InputStream
print "OS: "; OutputSream

InputStream are defined and I can read data from it. But output stream always equals zero and when I try to write something in it 0 - there return 65536 value(I think this is -1 - error code).

But, file was created! It's empty, but exists on sd card.

I'm tested it only via ZEsarUX emulator with ZX-Uno emulated.

Does anybody know where may be issue?

Print this item

  Is possible to do this?
Posted by: maeloterkim - 04-30-2019, 09:35 PM - Forum: Help & Support - Replies (4)

Hi : ) I want to do something like this

iniSuperSub:
SUB mySuperSub()
....
...
....
END SUB
endSuperSub:

SUB otherSub()
ASM
defs 6144-(@endSuperSub - @iniSuperSub),0
END ASM
END SUB

The compiler says -> Error: illegal preprocessor character '@'

I want to do in assembler -> defs (6144 - size mySuperSub ), 0

There is some way to do something like this?

Thanks

Print this item

  ZX ZOO A full ZOO inside 48 K at 3.5Mhz :)
Posted by: maeloterkim - 04-27-2019, 12:48 PM - Forum: Gallery - Replies (1)

ZX ZOO A full ZOO inside 48 K at 3.5Mhz Smile

Made with ZX Basic Compiled. Only tested on Emulators

included here -> zxZOO(48K).rar

If someone can try it in a real zx spectrum hardware and comment here if it works Smile

Enjoy the zoo Smile

DEMO VIDEO here -> https://www.facebook.com/millionthanksbo...212159304/



Attached Files
.rar   zxZOO(48K).rar (Size: 31.03 KB / Downloads: 29)
Print this item

  i don't know if is a bug or what with beeper sound routine
Posted by: maeloterkim - 04-17-2019, 01:14 PM - Forum: Help & Support - Replies (3)

Hi Smile

THIS CODE WORKS AS EXPECTED

1) CLS
2) Print "Hello"
3) Make a sound with assembler subroutine
4) Print "World"
5) Make the STOP

--------INI CODE ---------------------------------------------------------------------------------------------

SUB mySound()
ASM
LD B,5
loop:
PUSH BC
LD HL,768
anotherLoop:
LD DE,1
PUSH HL
CALL 949 ;'ROM BEEPER ROUTINE 949 = $3B5
POP HL
LD DE,16
AND A
SBC HL,DE
JR NZ, anotherLoop
POP BC
DJNZ loop
RET
END ASM
END SUB

CLS : REM 'Clear screen

PRINT "Hello" : REM 'Print Hello on screen

mySound() : REM 'Make the sound

PRINT "World" : REM 'Print World on screen

STOP : REM STOP the program

----------------- END CODE ----------------------------------------------------------------------------------------------------

But if i change something, doesn't work

Per example :

1) ¿BUG ERROR?
If i change the assembler code and i put PUSH IX AT THE BEGINNING AND POP IX AT THE END
that is the advice in this forum to all assembler routines

SUB mySound()
ASM
PUSH IX ; This make the program not work properly
LD B,5
......
......
......
DJNZ loop
POP IX ; This make the program not work properly
RET
END ASM
END SUB

doesn't work


2) ¿BUG ERROR?
If i add some blank space to the words printed per example "hello " blank space at the end or somewhere
or at the printed word "world " make the program not work properly and don't execute the last print and the stop

3) ¿BUG ERROR?
If i add ; at the end of the word "Hello" per example "Hello"; doesn't work either

4) ¿BUG ERROR?
If i make the words "Hello" and "World" variables Per example a$ = "Hello", b$ = "World"
anfd i make

PRINT a$ : REM 'Print Hello on screen

mySound() : REM 'Make the sound

PRINT b$ : REM 'Print World on screen

doesn't work either


-----------------------------------------------------------------------------------------------------------------

I don't know what is going on ¿?¿?¿

Thanks Smile

Print this item

  v1.8.9 bright 8 does not work (*solved*)
Posted by: Eqx - 04-14-2019, 09:52 PM - Forum: Bug Reports - Replies (6)

Hello Boriel,
I found a problem wih bright 8
I'm coding some routines for a game and I need use bright 8 to draw four lines on a square with attributes: ink 2 and bright 1
I set paper 8, ink 8 and bright 8 to draw lines in this zone but zxbasic changes the brightness to zero and seems doesn't works.

Thanks

Code:
ink 2: bright 1
plot 117,154:
draw 0,-8: draw 1,0: draw 0,-5: draw -1,0: draw 0,-8: draw 8,0: draw 0,1: draw 5,0: draw 0,-1: draw 8,0: draw 0,8:
draw -1,0: draw 0,5: draw 1,0: draw 0,8: draw -8,0: draw 0,-1: draw -5,0: draw 0,1: draw -8,0

do

.....

if IN 32766 = 190 go sub fire

print paper 6;over 1; INK 0;AT 5,15;"  ";AT 6,15;"  "

loop

fire:

ink 8: paper 8: bright 8: over 1
for n=1 TO 2
    plot 0,191:draw 126,-47
    plot 255,191:draw -126,-47
    plot 80,75: draw 48,69
    plot 175,75:draw -48,69
next n

over 0

return

Print this item

  Error "4 Out of memory, 0:1"
Posted by: LukeBord1 - 04-01-2019, 10:32 AM - Forum: Help & Support - Replies (6)

Hi to all,
I've completed a program which I'd like to fit into a 16K Spectrum using the lastest 1.8.9 ZXB version. After a long play, the program crashes returing an annoying "4 Out of memory, 0:1", this happens in 48K mode too.

I incuded a couple of libraries: attr.bas and screen.bas, got no string variables (all the strings are included directly in PRINT commands), so i set a low value for the heap: --heap=256.

The program starts at --org=24000 and the generated memory_map.txt file says that the heap starts at "7337: .ZXBASIC_MEM_HEAP" (29495).
The rest of my custom machine code starts at 30.000 and ends at 32767... so all seems at the right place!

Any idea about the cause of the damned crash, which happens after some minutes of normal and working play?! It seems something like an accumulation of data in memory which goes out of bounds, needing some kind of reset :-(

Print this item

  ¿Posible bug ?
Posted by: maeloterkim - 03-29-2019, 11:41 AM - Forum: Bug Reports - Replies (5)

Hola Smile

Estoy compilando con la versión-1.8.9 de ZX BASIC y me pasa lo siguiente:

Cuando pongo

10 DIM valor, sum AS UBYTE

20 LET sum = 3

30 LET valor = 1 * (sum=3)

el valor debería ser solamente: 0 o 1 dependiendo del valor de sum

pero devuelve 0 o 255 ( que me parece que es, el máximo valor de UBYTE)

En el basic del zx spectrum si funciona correctamente

Para solucionarlo pongo

30 LET valor = 1 * ( (sum=3)/255 )

y ahora si da los valores correctos, pero claro añade más procesamiento

¿Debería funcionar así o es un bug?

Saludos

Print this item