<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Boriel Basic Forum - Help & Support]]></title>
		<link>https://forum.boriel.com/</link>
		<description><![CDATA[Boriel Basic Forum - https://forum.boriel.com]]></description>
		<pubDate>Fri, 22 May 2026 03:00:50 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[location of heap management code...]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2652</link>
			<pubDate>Tue, 24 Feb 2026 13:17:50 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2568">sdo303</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2652</guid>
			<description><![CDATA[I'd like to use strings and arrays in my paged code, but I seem to have reached a blockage whereby, even though my paged-code looks like:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#PRAGMA push(case_insensitive)<br />
#PRAGMA case_insensitive = True<br />
#define STANDALONE  ' remove ROM initialization and SysVars...<br />
<br />
Asm<br />
    org &#36;6000<br />
    di<br />
End Asm<br />
s_stage_init()<br />
Asm<br />
    ret<br />
End Asm<br />
<br />
<br />
#include "constants.bas"<br />
#include "globals.bas"<br />
#include "stage-include.bas"<br />
<br />
<br />
Sub s_init_keyboard_table_ZX_keys()<br />
    ' effect: populates the lookup table for the 40-key spectrum matrix<br />
    ' row 0: port &#36;FEFE<br />
    gub_zxkeys(0)  = 0   ' caps shift<br />
'...<br />
    gub_zxkeys(55) = 127 ' delete (standard)<br />
End Sub<br />
<br />
<br />
Sub s_init_keyboard_table_ZX_symkeys()<br />
    ' row 0: z, x, c, v<br />
    gub_zxsymkeys(1)  = 58  ' :<br />
'...<br />
    gub_zxsymkeys(55) = 127 ' delete (standard)<br />
End Sub<br />
<br />
<br />
Sub s_init_title_screen()<br />
    ' footer prompt<br />
    s_print_string_at( 28, 21, "Press any key to begin..."  , UB_BRIGHT_YELLOW )<br />
<br />
    ' wait for player input<br />
    s_get_key()<br />
    ' check if the one-hour timeout occurred<br />
    If guw_key_code = 0 Then gub_core_end = true<br />
End Sub<br />
<br />
<br />
Sub s_stage_init()<br />
    s_init_keyboard_table_ZX_keys()<br />
    s_init_keyboard_table_ZX_symkeys()<br />
<br />
    s_init_title_screen()<br />
End Sub</code></div></div><br />
and when I compile with :<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>python &#36;Compiler "&#36;(&#36;Name).bas" -f bin -o "&#36;(&#36;Name).bin" --org 24576 -W150 --headerless --explicit --strict --zxnext -i --arch zxnext --opt-strategy size --heap-address 32000 --heap-size 767 -M "&#36;(&#36;Name).map"</code></div></div><br />
then I still seem to end up with some kind of header code that makes  a call to &#36;46A4...<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&gt;6001  CALL 46A4        PC  6001<br />
 6004  NOP              SP  FFFA<br />
 6005  NOP              AF  FFFF'3C40<br />
 6006  NOP              SZ5H3PNC<br />
 6007  NOP              HL  0001'3C44<br />
 6008  NOP              DE  0000'FFFF<br />
 6009  NOP              BC  0000'5393<br />
 600A  LD BC, 6013      IX  FFF1<br />
 600D  EX AF, AF'       IY  EFF3<br />
 600E  LD B, A          IR  001B<br />
 600F  NOP              IM1 IFF--<br />
 6010  NOP              (HL) F3 00<br />
 6011  NOP              (DE) 00 F3<br />
                        (BC) 00 F3<br />
<br />
(SP) 0C3C 010B 0000 F300 C300 0</code></div></div><br />
which I think must be some kind of heap management setup...<br />
<br />
...so please may I ask...<br />
<br />
Is there a compiler switch or directive whereby I can get the heap management code tacked on just after my code ends, so that I can have private heap management per 8KB segment of paged code ?<br />
<br />
Thank you.]]></description>
			<content:encoded><![CDATA[I'd like to use strings and arrays in my paged code, but I seem to have reached a blockage whereby, even though my paged-code looks like:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#PRAGMA push(case_insensitive)<br />
#PRAGMA case_insensitive = True<br />
#define STANDALONE  ' remove ROM initialization and SysVars...<br />
<br />
Asm<br />
    org &#36;6000<br />
    di<br />
End Asm<br />
s_stage_init()<br />
Asm<br />
    ret<br />
End Asm<br />
<br />
<br />
#include "constants.bas"<br />
#include "globals.bas"<br />
#include "stage-include.bas"<br />
<br />
<br />
Sub s_init_keyboard_table_ZX_keys()<br />
    ' effect: populates the lookup table for the 40-key spectrum matrix<br />
    ' row 0: port &#36;FEFE<br />
    gub_zxkeys(0)  = 0   ' caps shift<br />
'...<br />
    gub_zxkeys(55) = 127 ' delete (standard)<br />
End Sub<br />
<br />
<br />
Sub s_init_keyboard_table_ZX_symkeys()<br />
    ' row 0: z, x, c, v<br />
    gub_zxsymkeys(1)  = 58  ' :<br />
'...<br />
    gub_zxsymkeys(55) = 127 ' delete (standard)<br />
End Sub<br />
<br />
<br />
Sub s_init_title_screen()<br />
    ' footer prompt<br />
    s_print_string_at( 28, 21, "Press any key to begin..."  , UB_BRIGHT_YELLOW )<br />
<br />
    ' wait for player input<br />
    s_get_key()<br />
    ' check if the one-hour timeout occurred<br />
    If guw_key_code = 0 Then gub_core_end = true<br />
End Sub<br />
<br />
<br />
Sub s_stage_init()<br />
    s_init_keyboard_table_ZX_keys()<br />
    s_init_keyboard_table_ZX_symkeys()<br />
<br />
    s_init_title_screen()<br />
End Sub</code></div></div><br />
and when I compile with :<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>python &#36;Compiler "&#36;(&#36;Name).bas" -f bin -o "&#36;(&#36;Name).bin" --org 24576 -W150 --headerless --explicit --strict --zxnext -i --arch zxnext --opt-strategy size --heap-address 32000 --heap-size 767 -M "&#36;(&#36;Name).map"</code></div></div><br />
then I still seem to end up with some kind of header code that makes  a call to &#36;46A4...<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&gt;6001  CALL 46A4        PC  6001<br />
 6004  NOP              SP  FFFA<br />
 6005  NOP              AF  FFFF'3C40<br />
 6006  NOP              SZ5H3PNC<br />
 6007  NOP              HL  0001'3C44<br />
 6008  NOP              DE  0000'FFFF<br />
 6009  NOP              BC  0000'5393<br />
 600A  LD BC, 6013      IX  FFF1<br />
 600D  EX AF, AF'       IY  EFF3<br />
 600E  LD B, A          IR  001B<br />
 600F  NOP              IM1 IFF--<br />
 6010  NOP              (HL) F3 00<br />
 6011  NOP              (DE) 00 F3<br />
                        (BC) 00 F3<br />
<br />
(SP) 0C3C 010B 0000 F300 C300 0</code></div></div><br />
which I think must be some kind of heap management setup...<br />
<br />
...so please may I ask...<br />
<br />
Is there a compiler switch or directive whereby I can get the heap management code tacked on just after my code ends, so that I can have private heap management per 8KB segment of paged code ?<br />
<br />
Thank you.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[non-paged supervisor code calling paged application code]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2651</link>
			<pubDate>Sun, 15 Feb 2026 15:01:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2568">sdo303</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2651</guid>
			<description><![CDATA[Firstly, a proper thankyou to Boriel for the compiler.   And secondly, also a proper thankyou to Duefectu for the beginner's guide book (I bought a hard copy), which I have read cover to cover (but I did skip the sound/audio sections <img src="https://forum.boriel.com/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" />).  And I bought a hard copy of Simon G's NextTech book too, again I have read it cover to cover (but skipped the sound/audio parts).<br />
<br />
Using Boriel ZXBasic and as little Z80 machine code as I can get away with (until I need to performance tune)... my project is that I am trying to write a quasi "character cell" based application, like being on an old VT100, whereby the application uses all 64KB of the Z80 for itself, and thus no ZX Spectrum ROM, and which internally leverages a poor man's virtual memory framework, whereby I have a supervisor layer of non-paged code running in MMU0/1, which boots from &#36;0000 and jumps over IM1 at &#36;0038 to begin my main code properly at say &#36;0050 where the application begins properly... and so I have my core non-paged system variables mapped in MMU2 and then I have my paged code to run from MMU3 - and then various different aspects of paged application data paging in and out MMU4/5/6, with finally MMU7 again being static non-paged to host the 5KB of screen tile map for an 80x32 screen, with the final 3KB of MMU7 being available for the stack pointer from &#36;FFFE downwards.<br />
phew...<br />
I know my code will never work first time, I get that... but I feel fairly sure that I have the basic (excuse the pun) initial structure of what I want to achieve, with all of my system variables (so far identified) defined at static addresses in MMU2, and my main supervisor MMU paging and also my screen updating routines and keyboard reading routines written (to be permanently resident in MMU0/1) and the first of my paged blocks of code to run from MMU3, and I have gotten the source code clean enough pass through zxbc without the compiler spitting any hard errors... (just lots and lots of warnings)... but I've now hit a roadblock...<br />
<br />
I get how I can have many separate pages of 8KB deposited across the ZX Next vast 200+ pages of 8KB across 1.75 MB of RAM, and I get how I can have my code paged in at MMU3 for my application to execute from &#36;6000, and I can get my non-paged supervisor layer code to make calls such as       uw_dummy = USR &#36;6000     to call my paged code in MMU3, and thus wait for a return... but what I don't understand is how I can have many different paged code blocks where each is aware of *ALL* of the available core supervisor routines and their parameter structures and thus able to makes calls back in to the supervisor to run any of the many core system routines...<br />
<br />
i.e. how can I make zxbc firstly compile the application core without dropping routines that zxbc thinks are unused, and yet also somehow get the compilations of many different "paged" application code to be aware of the core supervisor routines and their parameters and any return value data types (of functions).<br />
<br />
e.g. I get this from my compilation of my "core.bas":<br />
core.bas:115: warning: [W170] Function 's_crash' is never called and has been ignored<br />
core.bas:154: warning: [W170] Function 's_fc_ram_copy' is never called and has been ignored<br />
core.bas:165: warning: [W170] Function 's_clear_screen' is never called and has been ignored<br />
core.bas:126: warning: [W170] Function 's_print_char_at' is never called and has been ignored<br />
core.bas:143: warning: [W170] Function 's_print_string_at' is never called and has been ignored<br />
core.bas:217: warning: [W170] Function 's_display_monitor' is never called and has been ignored<br />
core.bas:283: warning: [W170] Function 'fub_key_get_minutes' is never called and has been ignored<br />
<br />
...and I get this for my first stage of my application:<br />
stage-include.bas:37: warning: [W170] Function 's_next_reg' is never called and has been ignored<br />
stage-include.bas:38: warning: [W170] Function 's_return_to_zxos' is never called and has been ignored<br />
stage-include.bas:39: warning: [W170] Function 's_crash' is never called and has been ignored<br />
stage-include.bas:40: warning: [W170] Function 's_fc_ram_copy' is never called and has been ignored<br />
stage-include.bas:42: warning: [W170] Function 's_clear_screen' is never called and has been ignored<br />
stage-include.bas:43: warning: [W170] Function 's_print_char_at' is never called and has been ignored<br />
stage-include.bas:44: warning: [W170] Function 's_print_string_at' is never called and has been ignored<br />
stage-include.bas:45: warning: [W170] Function 's_display_monitor' is never called and has been ignored<br />
stage-include.bas:47: warning: [W170] Function 'fub_key_get_minutes' is never called and has been ignored<br />
stage-include.bas:48: warning: [W170] Function 's_key_wait_for_vblank' is never called and has been ignored<br />
stage-include.bas:49: warning: [W170] Function 's_get_key' is never called and has been ignored<br />
...<br />
stage-init.bas:8: warning: [W170] Function 's_stage_init' is never called and has been ignored<br />
stage-init.bas:20: warning: [W170] Function 's_init_keyboard_table_ZX_keys' is never called and has been ignored<br />
stage-init.bas:21: warning: [W170] Function 's_init_keyboard_table_ZX_symkeys' is never called and has been ignored<br />
stage-init.bas:18: warning: [W170] Function 's_init_load_palette' is never called and has been ignored<br />
stage-init.bas:186: warning: [W170] Function 's_init_load_palette_entry' is never called and has been ignored<br />
stage-init.bas:223: warning: [W170] Function 's_init_clear_screen' is never called and has been ignored<br />
stage-init.bas:26: warning: [W170] Function 's_init_title_screen' is never called and has been ignored<br />
<br />
...where stage-include.bas was my attempt to make each "stage" aware of a jump-table of locations of core routines:<br />
<span style="color: #cccccc;" class="mycode_color"><span style="font-family: Consolas, 'Courier New', monospace;" class="mycode_font"><span style="color: #c586c0;" class="mycode_color">Asm</span><br />
    ; fixed jump table addresses <span style="color: #ce9178;" class="mycode_color">for</span> the linker<br />
    _s_main                          equ &#36;0050<br />
    _s_next_reg                      equ &#36;0053<br />
    _s_return_to_zxos                equ &#36;0056<br />
    _s_crash                         equ &#36;0059<br />
    _s_fc_ram_copy                   equ &#36;005C<br />
    _s_clear_screen                  equ &#36;005F<br />
    _s_print_char_at                 equ &#36;0062<br />
    _s_print_<span style="color: #b5cea8;" class="mycode_color">string</span>_at               equ &#36;0065<br />
    _s_display_monitor               equ &#36;0068<br />
    _fub_key_get_minutes             equ &#36;006B<br />
    _s_key_wait_for_vblank           equ &#36;006E<br />
    _s_get_key                       equ &#36;0071<br />
<span style="color: #c586c0;" class="mycode_color">End Asm</span></span></span><br />
<span style="font-family: Consolas, 'Courier New', monospace;" class="mycode_font"><br />
<span style="color: #6a9955;" class="mycode_color"><span style="color: #6a9955;" class="mycode_color">' implementation blocks to stop "not implemented" errors</span></span><br />
<span style="color: #6a9955;" class="mycode_color"><span style="color: #6a9955;" class="mycode_color">' these contain no code; the equate above handles the address</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_main</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_next_reg</span></span><span style="color: #cccccc;" class="mycode_color">(reg As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">value</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_return_to_zxos</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_crash</span></span><span style="color: #cccccc;" class="mycode_color">(</span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">error_code</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">error_text</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">String</span></span><span style="color: #cccccc;" class="mycode_color">): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Fastcall</span></span><span style="color: #cccccc;" class="mycode_color"> s_fc_ram_copy(src_address </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">As</span></span><span style="color: #cccccc;" class="mycode_color"> UInteger, dest_address </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">As</span></span><span style="color: #cccccc;" class="mycode_color"> UInteger, byte_count </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">As</span></span><span style="color: #cccccc;" class="mycode_color"> UInteger): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_clear_screen</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_print_char_at</span></span><span style="color: #cccccc;" class="mycode_color">(</span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">x</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">y</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">char</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">colour</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_print_string_at</span></span><span style="color: #cccccc;" class="mycode_color">(</span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">x</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">y</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">text</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">String</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">colour</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_display_monitor</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Function</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">fub_key_get_minutes</span></span><span style="color: #cccccc;" class="mycode_color">() As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">: </span><span style="color: #ce9178;" class="mycode_color"><span style="color: #ce9178;" class="mycode_color">return</span></span><span style="color: #cccccc;" class="mycode_color"> 0: </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Function</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_key_wait_for_vblank</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_get_key</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span></span><br />
<br />
<br />
But clearly there is something I'm not getting, and I've reached the limits of capability of AI helper tools.<br />
<br />
I had rationalised to myself that my build script should only call to zxbc to produce "-f asm" ASM files... as I expect to have to then somehow "link" the static core ASM and the many paged stage ASM together at some point... and I also seem to have rationalised that I may perhaps need to use     sjasmplus     to assemble my ".nex" package.<br />
<br />
Does the above sound achievable?  Or am I asking too much of the "Next" as a platform?  i.e. is the "Next" only any good for paging graphics data, and no good for paging application code?]]></description>
			<content:encoded><![CDATA[Firstly, a proper thankyou to Boriel for the compiler.   And secondly, also a proper thankyou to Duefectu for the beginner's guide book (I bought a hard copy), which I have read cover to cover (but I did skip the sound/audio sections <img src="https://forum.boriel.com/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" />).  And I bought a hard copy of Simon G's NextTech book too, again I have read it cover to cover (but skipped the sound/audio parts).<br />
<br />
Using Boriel ZXBasic and as little Z80 machine code as I can get away with (until I need to performance tune)... my project is that I am trying to write a quasi "character cell" based application, like being on an old VT100, whereby the application uses all 64KB of the Z80 for itself, and thus no ZX Spectrum ROM, and which internally leverages a poor man's virtual memory framework, whereby I have a supervisor layer of non-paged code running in MMU0/1, which boots from &#36;0000 and jumps over IM1 at &#36;0038 to begin my main code properly at say &#36;0050 where the application begins properly... and so I have my core non-paged system variables mapped in MMU2 and then I have my paged code to run from MMU3 - and then various different aspects of paged application data paging in and out MMU4/5/6, with finally MMU7 again being static non-paged to host the 5KB of screen tile map for an 80x32 screen, with the final 3KB of MMU7 being available for the stack pointer from &#36;FFFE downwards.<br />
phew...<br />
I know my code will never work first time, I get that... but I feel fairly sure that I have the basic (excuse the pun) initial structure of what I want to achieve, with all of my system variables (so far identified) defined at static addresses in MMU2, and my main supervisor MMU paging and also my screen updating routines and keyboard reading routines written (to be permanently resident in MMU0/1) and the first of my paged blocks of code to run from MMU3, and I have gotten the source code clean enough pass through zxbc without the compiler spitting any hard errors... (just lots and lots of warnings)... but I've now hit a roadblock...<br />
<br />
I get how I can have many separate pages of 8KB deposited across the ZX Next vast 200+ pages of 8KB across 1.75 MB of RAM, and I get how I can have my code paged in at MMU3 for my application to execute from &#36;6000, and I can get my non-paged supervisor layer code to make calls such as       uw_dummy = USR &#36;6000     to call my paged code in MMU3, and thus wait for a return... but what I don't understand is how I can have many different paged code blocks where each is aware of *ALL* of the available core supervisor routines and their parameter structures and thus able to makes calls back in to the supervisor to run any of the many core system routines...<br />
<br />
i.e. how can I make zxbc firstly compile the application core without dropping routines that zxbc thinks are unused, and yet also somehow get the compilations of many different "paged" application code to be aware of the core supervisor routines and their parameters and any return value data types (of functions).<br />
<br />
e.g. I get this from my compilation of my "core.bas":<br />
core.bas:115: warning: [W170] Function 's_crash' is never called and has been ignored<br />
core.bas:154: warning: [W170] Function 's_fc_ram_copy' is never called and has been ignored<br />
core.bas:165: warning: [W170] Function 's_clear_screen' is never called and has been ignored<br />
core.bas:126: warning: [W170] Function 's_print_char_at' is never called and has been ignored<br />
core.bas:143: warning: [W170] Function 's_print_string_at' is never called and has been ignored<br />
core.bas:217: warning: [W170] Function 's_display_monitor' is never called and has been ignored<br />
core.bas:283: warning: [W170] Function 'fub_key_get_minutes' is never called and has been ignored<br />
<br />
...and I get this for my first stage of my application:<br />
stage-include.bas:37: warning: [W170] Function 's_next_reg' is never called and has been ignored<br />
stage-include.bas:38: warning: [W170] Function 's_return_to_zxos' is never called and has been ignored<br />
stage-include.bas:39: warning: [W170] Function 's_crash' is never called and has been ignored<br />
stage-include.bas:40: warning: [W170] Function 's_fc_ram_copy' is never called and has been ignored<br />
stage-include.bas:42: warning: [W170] Function 's_clear_screen' is never called and has been ignored<br />
stage-include.bas:43: warning: [W170] Function 's_print_char_at' is never called and has been ignored<br />
stage-include.bas:44: warning: [W170] Function 's_print_string_at' is never called and has been ignored<br />
stage-include.bas:45: warning: [W170] Function 's_display_monitor' is never called and has been ignored<br />
stage-include.bas:47: warning: [W170] Function 'fub_key_get_minutes' is never called and has been ignored<br />
stage-include.bas:48: warning: [W170] Function 's_key_wait_for_vblank' is never called and has been ignored<br />
stage-include.bas:49: warning: [W170] Function 's_get_key' is never called and has been ignored<br />
...<br />
stage-init.bas:8: warning: [W170] Function 's_stage_init' is never called and has been ignored<br />
stage-init.bas:20: warning: [W170] Function 's_init_keyboard_table_ZX_keys' is never called and has been ignored<br />
stage-init.bas:21: warning: [W170] Function 's_init_keyboard_table_ZX_symkeys' is never called and has been ignored<br />
stage-init.bas:18: warning: [W170] Function 's_init_load_palette' is never called and has been ignored<br />
stage-init.bas:186: warning: [W170] Function 's_init_load_palette_entry' is never called and has been ignored<br />
stage-init.bas:223: warning: [W170] Function 's_init_clear_screen' is never called and has been ignored<br />
stage-init.bas:26: warning: [W170] Function 's_init_title_screen' is never called and has been ignored<br />
<br />
...where stage-include.bas was my attempt to make each "stage" aware of a jump-table of locations of core routines:<br />
<span style="color: #cccccc;" class="mycode_color"><span style="font-family: Consolas, 'Courier New', monospace;" class="mycode_font"><span style="color: #c586c0;" class="mycode_color">Asm</span><br />
    ; fixed jump table addresses <span style="color: #ce9178;" class="mycode_color">for</span> the linker<br />
    _s_main                          equ &#36;0050<br />
    _s_next_reg                      equ &#36;0053<br />
    _s_return_to_zxos                equ &#36;0056<br />
    _s_crash                         equ &#36;0059<br />
    _s_fc_ram_copy                   equ &#36;005C<br />
    _s_clear_screen                  equ &#36;005F<br />
    _s_print_char_at                 equ &#36;0062<br />
    _s_print_<span style="color: #b5cea8;" class="mycode_color">string</span>_at               equ &#36;0065<br />
    _s_display_monitor               equ &#36;0068<br />
    _fub_key_get_minutes             equ &#36;006B<br />
    _s_key_wait_for_vblank           equ &#36;006E<br />
    _s_get_key                       equ &#36;0071<br />
<span style="color: #c586c0;" class="mycode_color">End Asm</span></span></span><br />
<span style="font-family: Consolas, 'Courier New', monospace;" class="mycode_font"><br />
<span style="color: #6a9955;" class="mycode_color"><span style="color: #6a9955;" class="mycode_color">' implementation blocks to stop "not implemented" errors</span></span><br />
<span style="color: #6a9955;" class="mycode_color"><span style="color: #6a9955;" class="mycode_color">' these contain no code; the equate above handles the address</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_main</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_next_reg</span></span><span style="color: #cccccc;" class="mycode_color">(reg As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">value</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_return_to_zxos</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_crash</span></span><span style="color: #cccccc;" class="mycode_color">(</span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">error_code</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">error_text</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">String</span></span><span style="color: #cccccc;" class="mycode_color">): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Fastcall</span></span><span style="color: #cccccc;" class="mycode_color"> s_fc_ram_copy(src_address </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">As</span></span><span style="color: #cccccc;" class="mycode_color"> UInteger, dest_address </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">As</span></span><span style="color: #cccccc;" class="mycode_color"> UInteger, byte_count </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">As</span></span><span style="color: #cccccc;" class="mycode_color"> UInteger): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_clear_screen</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_print_char_at</span></span><span style="color: #cccccc;" class="mycode_color">(</span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">x</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">y</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">char</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">colour</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_print_string_at</span></span><span style="color: #cccccc;" class="mycode_color">(</span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">x</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">y</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">text</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">String</span></span><span style="color: #cccccc;" class="mycode_color">, </span><span style="color: #9cdcfe;" class="mycode_color"><span style="color: #9cdcfe;" class="mycode_color">colour</span></span><span style="color: #cccccc;" class="mycode_color"> As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_display_monitor</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Function</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">fub_key_get_minutes</span></span><span style="color: #cccccc;" class="mycode_color">() As </span><span style="color: #b5cea8;" class="mycode_color"><span style="color: #b5cea8;" class="mycode_color">UByte</span></span><span style="color: #cccccc;" class="mycode_color">: </span><span style="color: #ce9178;" class="mycode_color"><span style="color: #ce9178;" class="mycode_color">return</span></span><span style="color: #cccccc;" class="mycode_color"> 0: </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Function</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_key_wait_for_vblank</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span><br />
<span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span> <span style="color: #dcdcaa;" class="mycode_color"><span style="color: #dcdcaa;" class="mycode_color">s_get_key</span></span><span style="color: #cccccc;" class="mycode_color">(): </span><span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">End</span></span> <span style="color: #c586c0;" class="mycode_color"><span style="color: #c586c0;" class="mycode_color">Sub</span></span></span><br />
<br />
<br />
But clearly there is something I'm not getting, and I've reached the limits of capability of AI helper tools.<br />
<br />
I had rationalised to myself that my build script should only call to zxbc to produce "-f asm" ASM files... as I expect to have to then somehow "link" the static core ASM and the many paged stage ASM together at some point... and I also seem to have rationalised that I may perhaps need to use     sjasmplus     to assemble my ".nex" package.<br />
<br />
Does the above sound achievable?  Or am I asking too much of the "Next" as a platform?  i.e. is the "Next" only any good for paging graphics data, and no good for paging application code?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Old zxbasic game errors]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2649</link>
			<pubDate>Mon, 03 Nov 2025 20:32:31 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=204">ardentcrest</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2649</guid>
			<description><![CDATA[trying Escape From Cnossus from 2013 getting this error<br />
<br />
Error: 'subdivideHigh' is neither an array nor a function.<br />
<br />
the line is <br />
<br />
wall1 =	subdivideHigh(x1, y1, x - 1, y2)<br />
<br />
any help please]]></description>
			<content:encoded><![CDATA[trying Escape From Cnossus from 2013 getting this error<br />
<br />
Error: 'subdivideHigh' is neither an array nor a function.<br />
<br />
the line is <br />
<br />
wall1 =	subdivideHigh(x1, y1, x - 1, y2)<br />
<br />
any help please]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Error: Undefined GLOBAL label]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2648</link>
			<pubDate>Sun, 02 Nov 2025 12:43:21 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=204">ardentcrest</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2648</guid>
			<description><![CDATA[Looking over an old file of mine that once worked I'm now getting Error: Undefined GLOBAL label . each one is going to a fastcall.<br />
<br />
ie<br />
<br />
        ld hl, lineMSG<br />
        ld bc, end1-lineMSG<br />
        call myPrint42<br />
<br />
calling <br />
<br />
SUB fastcall myPrint42()<br />
ASM<br />
myPrint42:<br />
    push    af<br />
    push    ix<br />
    push    hl<br />
    ld    ix, PRINT42<br />
    CALL    IXCALL<br />
    pop    hl<br />
    pop    ix<br />
    pop    af<br />
    ret<br />
END ASM<br />
END SUB<br />
<br />
gives me Error: Undefined GLOBAL label ".myPrint42"<br />
<br />
any help please....]]></description>
			<content:encoded><![CDATA[Looking over an old file of mine that once worked I'm now getting Error: Undefined GLOBAL label . each one is going to a fastcall.<br />
<br />
ie<br />
<br />
        ld hl, lineMSG<br />
        ld bc, end1-lineMSG<br />
        call myPrint42<br />
<br />
calling <br />
<br />
SUB fastcall myPrint42()<br />
ASM<br />
myPrint42:<br />
    push    af<br />
    push    ix<br />
    push    hl<br />
    ld    ix, PRINT42<br />
    CALL    IXCALL<br />
    pop    hl<br />
    pop    ix<br />
    pop    af<br />
    ret<br />
END ASM<br />
END SUB<br />
<br />
gives me Error: Undefined GLOBAL label ".myPrint42"<br />
<br />
any help please....]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[3DOS Commands?]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2643</link>
			<pubDate>Sun, 05 Oct 2025 21:33:54 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2556">tubz74</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2643</guid>
			<description><![CDATA[Hi<br />
<br />
I'm looking at using some 3DOS commands, starting to see how I can cat a disk.<br />
<br />
I've takend the below code from the +3 manula (pg 200 to 203) which should allow me to get the CAT into memory - the code looks to activate the disk (and for example if I don't attach a disk, it give me abort/retry) but then "reboots"/crashes the emulator back to the +3 menu.<br />
<br />
I'm assuming that there might be some incompatibility somewhere between, starting reading, and returning contorl to the program.  Code is below.<br />
<br />
Any thoughts?<br />
<br />
(PS If the ASM didn't crash, the program wouldn't actually do anything anyway yet, as I've not sorted any output, or any caribles)<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;input.bas&gt;<br />
#include &lt;screen.bas&gt;<br />
#INCLUDE &lt;keys.bas&gt; <br />
<br />
PRINT "This is the start"<br />
main()<br />
<br />
<br />
SUB main()<br />
    LET YesNo = "n"<br />
    PRINT "do you want to CAT disk"<br />
    YesNo = INPUT(1)<br />
    IF YesNo="y" then<br />
        Catalogue()<br />
    END IF<br />
    PRINT "Ed#nd Main"<br />
END SUB<br />
<br />
<br />
<br />
SUB Catalogue()<br />
    ASM<br />
        PUSH IX ; dos catalog corrupts ix<br />
        PROC<br />
        <br />
        LOCAL   MYSTACK<br />
        LOCAL   STACKSTORAGE<br />
        LOCAL   BANKM<br />
        LOCAL   PORT1<br />
        LOCAL   CATBUFF<br />
        LOCAL   DOS_CATALOG<br />
        <br />
        <br />
        MYSTACK         EQU     9fffh ; <br />
        STACKSTORAGE    EQU     9000h ; save pointer<br />
        BANKM           EQU     5b5ch ; system var that holds last value output to 7ff0h<br />
        PORT1           EQU     7ffdh ; address of rom/ram switching port<br />
        CATBUFF         EQU     8000h ; location for dos to output<br />
        DOS_CATALOG     EQU     011Eh ; DOS routine to call<br />
    <br />
        JP start<br />
        stardstar:  defb "*.*",255                    <br />
        dosret:     defw 0<br />
    <br />
        start:<br />
            DI<br />
            LD (STACKSTORAGE),SP<br />
            LD BC,PORT1         ; <br />
            LD A,(BANKM)        ; current switch state<br />
            RES 4,A             ; move right to left in horizontal rom switch (3 to 2)<br />
            OR 7                ; switch in ram page 7<br />
            LD (BANKM),A        ; keep system var up to date<br />
            OUT (C),A           ; switch ram and rom<br />
            LD SP,MYSTACK       ; make sure stack is above 4000h and below bfeoh<br />
            EI                  ; enable interrupts<br />
            ; <br />
    <br />
   <br />
            LD HL,CATBUFF<br />
            LD DE,CATBUFF+1<br />
            LD BC,1024<br />
            LD (HL),0<br />
            LDIR<br />
            LD B,64<br />
            LD C,1<br />
            LD DE, CATBUFF<br />
            LD HL,stardstar             ;file name *.*<br />
            CALL DOS_CATALOG            ;call dos catalog<br />
            PUSH AF<br />
            POP HL<br />
            LD (dosret),HL              ; put here so can be seen from basic<br />
            LD C,B                      ; number of files in catalog, low byte of bc<br />
            LD B,0                      ; returned to basic by usr functio<br />
    <br />
            DI<br />
            PUSH BC<br />
            LD BC, PORT1<br />
            LD A, (BANKM)<br />
            SET 4, A                    ; move left to right (riom 2 to 3)<br />
            AND 48h                     ; ram page 9<br />
            LD (BANKM),A                ; update syste value<br />
            OUT (C),A                   ;switch<br />
            POP BC                      ; get back saved number of files<br />
            LD SP,(STACKSTORAGE)        ; <br />
            EI<br />
            ;RET ; not sure if thisis needed<br />
        ENDP<br />
        POP IX<br />
        ;RET ; Not sure if this is needed here<br />
    END ASM<br />
END SUB</code></div></div>]]></description>
			<content:encoded><![CDATA[Hi<br />
<br />
I'm looking at using some 3DOS commands, starting to see how I can cat a disk.<br />
<br />
I've takend the below code from the +3 manula (pg 200 to 203) which should allow me to get the CAT into memory - the code looks to activate the disk (and for example if I don't attach a disk, it give me abort/retry) but then "reboots"/crashes the emulator back to the +3 menu.<br />
<br />
I'm assuming that there might be some incompatibility somewhere between, starting reading, and returning contorl to the program.  Code is below.<br />
<br />
Any thoughts?<br />
<br />
(PS If the ASM didn't crash, the program wouldn't actually do anything anyway yet, as I've not sorted any output, or any caribles)<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include &lt;input.bas&gt;<br />
#include &lt;screen.bas&gt;<br />
#INCLUDE &lt;keys.bas&gt; <br />
<br />
PRINT "This is the start"<br />
main()<br />
<br />
<br />
SUB main()<br />
    LET YesNo = "n"<br />
    PRINT "do you want to CAT disk"<br />
    YesNo = INPUT(1)<br />
    IF YesNo="y" then<br />
        Catalogue()<br />
    END IF<br />
    PRINT "Ed#nd Main"<br />
END SUB<br />
<br />
<br />
<br />
SUB Catalogue()<br />
    ASM<br />
        PUSH IX ; dos catalog corrupts ix<br />
        PROC<br />
        <br />
        LOCAL   MYSTACK<br />
        LOCAL   STACKSTORAGE<br />
        LOCAL   BANKM<br />
        LOCAL   PORT1<br />
        LOCAL   CATBUFF<br />
        LOCAL   DOS_CATALOG<br />
        <br />
        <br />
        MYSTACK         EQU     9fffh ; <br />
        STACKSTORAGE    EQU     9000h ; save pointer<br />
        BANKM           EQU     5b5ch ; system var that holds last value output to 7ff0h<br />
        PORT1           EQU     7ffdh ; address of rom/ram switching port<br />
        CATBUFF         EQU     8000h ; location for dos to output<br />
        DOS_CATALOG     EQU     011Eh ; DOS routine to call<br />
    <br />
        JP start<br />
        stardstar:  defb "*.*",255                    <br />
        dosret:     defw 0<br />
    <br />
        start:<br />
            DI<br />
            LD (STACKSTORAGE),SP<br />
            LD BC,PORT1         ; <br />
            LD A,(BANKM)        ; current switch state<br />
            RES 4,A             ; move right to left in horizontal rom switch (3 to 2)<br />
            OR 7                ; switch in ram page 7<br />
            LD (BANKM),A        ; keep system var up to date<br />
            OUT (C),A           ; switch ram and rom<br />
            LD SP,MYSTACK       ; make sure stack is above 4000h and below bfeoh<br />
            EI                  ; enable interrupts<br />
            ; <br />
    <br />
   <br />
            LD HL,CATBUFF<br />
            LD DE,CATBUFF+1<br />
            LD BC,1024<br />
            LD (HL),0<br />
            LDIR<br />
            LD B,64<br />
            LD C,1<br />
            LD DE, CATBUFF<br />
            LD HL,stardstar             ;file name *.*<br />
            CALL DOS_CATALOG            ;call dos catalog<br />
            PUSH AF<br />
            POP HL<br />
            LD (dosret),HL              ; put here so can be seen from basic<br />
            LD C,B                      ; number of files in catalog, low byte of bc<br />
            LD B,0                      ; returned to basic by usr functio<br />
    <br />
            DI<br />
            PUSH BC<br />
            LD BC, PORT1<br />
            LD A, (BANKM)<br />
            SET 4, A                    ; move left to right (riom 2 to 3)<br />
            AND 48h                     ; ram page 9<br />
            LD (BANKM),A                ; update syste value<br />
            OUT (C),A                   ;switch<br />
            POP BC                      ; get back saved number of files<br />
            LD SP,(STACKSTORAGE)        ; <br />
            EI<br />
            ;RET ; not sure if thisis needed<br />
        ENDP<br />
        POP IX<br />
        ;RET ; Not sure if this is needed here<br />
    END ASM<br />
END SUB</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Printing with FZX]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2632</link>
			<pubDate>Mon, 14 Jul 2025 15:45:43 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2514">solar penguin</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2632</guid>
			<description><![CDATA[Hi, I'm new, so these are probably stupid questions. But, I'm confused about printing with printFzxStr. Is there any way to to get it to word wrap neatly? It's breaking to a new line in the middle of a word (or even the middle of a letter)<br />
<br />
As a last resort, I guess I could have a go at writing my own word-wrap routine if I knew where to find the different widths of all the characters and the position of the text-printing cursor along the row. How would I go about finding them?<br />
<br />
One final question. Is there a way to make FZX scroll when it reaches the bottom of the screen instead of just stopping ZX81-style with an error message?<br />
<br />
Thanks]]></description>
			<content:encoded><![CDATA[Hi, I'm new, so these are probably stupid questions. But, I'm confused about printing with printFzxStr. Is there any way to to get it to word wrap neatly? It's breaking to a new line in the middle of a word (or even the middle of a letter)<br />
<br />
As a last resort, I guess I could have a go at writing my own word-wrap routine if I knew where to find the different widths of all the characters and the position of the text-printing cursor along the row. How would I go about finding them?<br />
<br />
One final question. Is there a way to make FZX scroll when it reaches the bottom of the screen instead of just stopping ZX81-style with an error message?<br />
<br />
Thanks]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[.tap file code not executed]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2624</link>
			<pubDate>Thu, 24 Apr 2025 16:09:58 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2384">manuelzo75</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2624</guid>
			<description><![CDATA[Hello, I'm a newbie tinkering with the Spectrum.<br />
I tried to get some code to test like the classic 'clock.bas' or 'circle. bas' and then converting a .bas file to .tap.<br />
In some cases, I obtain some errors like:<br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">manuelzompetta@Manuels-MacBook-Pro zxbasic % python zxbc.py clock.bas </span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">clock.bas:21: warning: [W100] Using default implicit type 'float' for 'a'</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">clock.bas:22: warning: [W100] Using default implicit type 'float' for 'sx'</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">clock.bas:22: warning: [W100] Using default implicit type 'float' for 'sy'</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">clock.bas:25: warning: [W100] Using default implicit type 'ulong' for 't2'</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">Traceback (most recent call last):</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/zxbc.py", line 12, in &lt;module&gt;</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    sys.exit(zxbc.main())  # Exit</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">             ^^^^^^^^^^^</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/src/zxbc/zxbc.py", line 155, in main</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    asm_output = backend.emit(optimize=OPTIONS.optimization_level &gt; 0)</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/src/arch/z80/backend/main.py", line 770, in emit</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    self._output_join(output, self._QUAD_TABLE[quad.instr].func(quad), optimize=optimize)</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/src/arch/z80/backend/generic.py", line 362, in _cast</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    output.extend(to_long(tA))</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">                  ^^^^^^^^^^^</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/src/arch/z80/backend/common.py", line 401, in to_long</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    raise NotImplementedError(f"type conversion from {stype} to long is undefined")</span></span></span><br />
<span style="font-size: 10pt;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: Monaco;" class="mycode_font">NotImplementedError: type conversion from u32 to long is undefined</span></span></span><br />
<br />
<br />
In other cases I obtain .tap file but when I execute it in the Spectrum or in an emulator nothing happens, I just obtain the welcome screen.<br />
<br />
What I'm doing wrong?<br />
<br />
Thanks]]></description>
			<content:encoded><![CDATA[Hello, I'm a newbie tinkering with the Spectrum.<br />
I tried to get some code to test like the classic 'clock.bas' or 'circle. bas' and then converting a .bas file to .tap.<br />
In some cases, I obtain some errors like:<br />
<br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">manuelzompetta@Manuels-MacBook-Pro zxbasic % python zxbc.py clock.bas </span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">clock.bas:21: warning: [W100] Using default implicit type 'float' for 'a'</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">clock.bas:22: warning: [W100] Using default implicit type 'float' for 'sx'</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">clock.bas:22: warning: [W100] Using default implicit type 'float' for 'sy'</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">clock.bas:25: warning: [W100] Using default implicit type 'ulong' for 't2'</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">Traceback (most recent call last):</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/zxbc.py", line 12, in &lt;module&gt;</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    sys.exit(zxbc.main())  # Exit</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">             ^^^^^^^^^^^</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/src/zxbc/zxbc.py", line 155, in main</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    asm_output = backend.emit(optimize=OPTIONS.optimization_level &gt; 0)</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/src/arch/z80/backend/main.py", line 770, in emit</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    self._output_join(output, self._QUAD_TABLE[quad.instr].func(quad), optimize=optimize)</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/src/arch/z80/backend/generic.py", line 362, in _cast</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    output.extend(to_long(tA))</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">                  ^^^^^^^^^^^</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">  File "/Users/manuelzompetta/Downloads/zxbasic/src/arch/z80/backend/common.py", line 401, in to_long</span></span></span><br />
<span style="color: #000000;" class="mycode_color"><span style="font-size: 10pt;" class="mycode_size"><span style="font-family: Monaco;" class="mycode_font">    raise NotImplementedError(f"type conversion from {stype} to long is undefined")</span></span></span><br />
<span style="font-size: 10pt;" class="mycode_size"><span style="color: #000000;" class="mycode_color"><span style="font-family: Monaco;" class="mycode_font">NotImplementedError: type conversion from u32 to long is undefined</span></span></span><br />
<br />
<br />
In other cases I obtain .tap file but when I execute it in the Spectrum or in an emulator nothing happens, I just obtain the welcome screen.<br />
<br />
What I'm doing wrong?<br />
<br />
Thanks]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Creating +3 Menus - Loading external BAS files]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2622</link>
			<pubDate>Sat, 12 Apr 2025 05:18:24 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=246">merlinkv</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2622</guid>
			<description><![CDATA[Hello,<br />
<br />
I'm creating Menus for my +3 game compilations but I can't find a way to load external BAS files.<br />
<br />
With the LOAD command I can load only CODE &amp; SCREEN&#36; files. There is a way to LOAD another BAS file included in the disks?<br />
<br />
Like on standard +3 BASIC.<br />
<br />
ie: LOAD "MYBASPRG" or LOAD "MYBASPRG.BAS"<br />
<br />
Thanks in advance.<br />
<br />
Example:<br />
<br />
<img src="https://www.winuaespanol.com/almacenphpbb/merlinkv/ZX_Games/SERVER_000249.jpg" loading="lazy"  alt="[Image: SERVER_000249.jpg]" class="mycode_img" />]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I'm creating Menus for my +3 game compilations but I can't find a way to load external BAS files.<br />
<br />
With the LOAD command I can load only CODE &amp; SCREEN&#36; files. There is a way to LOAD another BAS file included in the disks?<br />
<br />
Like on standard +3 BASIC.<br />
<br />
ie: LOAD "MYBASPRG" or LOAD "MYBASPRG.BAS"<br />
<br />
Thanks in advance.<br />
<br />
Example:<br />
<br />
<img src="https://www.winuaespanol.com/almacenphpbb/merlinkv/ZX_Games/SERVER_000249.jpg" loading="lazy"  alt="[Image: SERVER_000249.jpg]" class="mycode_img" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Randomize not very random?]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2621</link>
			<pubDate>Sun, 06 Apr 2025 12:21:25 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2351">BrianT</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2621</guid>
			<description><![CDATA[I don't know if this should be in the bug section or is just a general question. There was an older question in the bug forum saying it would be fixed.<br />
<br />
Making a card game, I use an array (0 to 51) for card numbers, then have a routine to shuffle it up.<br />
With RANDOMIZE at top of program so it only gets used once each time the game is loaded, I consistently start with 2,0,3,48,9.<br />
Moving it into the "new game" loop so it is run at the start of each new game, I'm always seeing 49,0,21,24.<br />
I'm seeing the same sequence whether I use my Linux or Windows pc.<br />
Not sure if it's something to do with FUSE emulator rather than ZX BASIC, and not using the FRAME setting which the help page mentions? <br />
I've added my source as a txt file for reference.<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=353" target="_blank" title="">hilo3.txt</a> (Size: 4.05 KB / Downloads: 846)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[I don't know if this should be in the bug section or is just a general question. There was an older question in the bug forum saying it would be fixed.<br />
<br />
Making a card game, I use an array (0 to 51) for card numbers, then have a routine to shuffle it up.<br />
With RANDOMIZE at top of program so it only gets used once each time the game is loaded, I consistently start with 2,0,3,48,9.<br />
Moving it into the "new game" loop so it is run at the start of each new game, I'm always seeing 49,0,21,24.<br />
I'm seeing the same sequence whether I use my Linux or Windows pc.<br />
Not sure if it's something to do with FUSE emulator rather than ZX BASIC, and not using the FRAME setting which the help page mentions? <br />
I've added my source as a txt file for reference.<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=353" target="_blank" title="">hilo3.txt</a> (Size: 4.05 KB / Downloads: 846)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Filling drawings]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2607</link>
			<pubDate>Fri, 07 Feb 2025 12:16:48 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2201">baltasarq</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2607</guid>
			<description><![CDATA[There's no function or command "fill", allowing to pass two coordinates and making the computer to fill all delimited pixels with the current color.<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>circle 50, 50, 30<br />
fill 50, 50</code></div></div><br />
In the eighties, I used to fill a circle with a for loop:<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>circle 50, 50, 30<br />
for i = 1 to 30<br />
    circle 50, 50, i<br />
next i</code></div></div>I suppose I could do something like this for rectangles, as well. This is, however, slow, ugly (certain pixels remain unplotted), and clumsy. Is there an alternate way?<br />
Thanks,]]></description>
			<content:encoded><![CDATA[There's no function or command "fill", allowing to pass two coordinates and making the computer to fill all delimited pixels with the current color.<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>circle 50, 50, 30<br />
fill 50, 50</code></div></div><br />
In the eighties, I used to fill a circle with a for loop:<br />
<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>circle 50, 50, 30<br />
for i = 1 to 30<br />
    circle 50, 50, i<br />
next i</code></div></div>I suppose I could do something like this for rectangles, as well. This is, however, slow, ugly (certain pixels remain unplotted), and clumsy. Is there an alternate way?<br />
Thanks,]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Headerless load routine in ZX Basic]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2601</link>
			<pubDate>Tue, 04 Feb 2025 05:19:37 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2271">Maywind</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2601</guid>
			<description><![CDATA[Hello,<br />
I'm trying to code a simple headerless LOAD routine in ZX Basic using the inline assembly feature of the compiler. The basic idea here is to write a function that uses assembly to set up the necessary registers and call the ROM routine 0556h for a headerless load (e.g. to load an extra level from the tape). I have some progress in this area, but it looks like I misunderstand how to clean up things correctly after the ROM routine returns and my function ends, so the poor Speccy either hangs or is reset after the code loading routine completes. I tried a few things so far, but the experiment that went the farthest so far is this one:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>function hload(addr as uInteger, size as uInteger) as uByte<br />
&nbsp;&nbsp;&nbsp;&nbsp;asm<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pop hl<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pop de<br />
        pop ix<br />
        ld a, 255<br />
        scf<br />
        call 0556h<br />
        push hl<br />
&nbsp;&nbsp;&nbsp;&nbsp;end asm<br />
end function</code></div></div><br />
<br />
The expected result is that calling this function, for instance, in this way: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hload(16384, 6912)</code></div></div><br />
should be able to load standard ZX screen data correctly. Trying to load a screen this way indicates that the screen is indeed loaded into the right area of memory, but once the loading completes, the computer is reset.<br />
<br />
I'm pretty sure that this indicates that something is screwed up at the end of the function call. Could be due to the fact that SP or something else is modified from within 0556h and that changes the register state, or something else along those lines, but I can't quite figure it out :/ I would appreciate some help since I'm not sure how to proceed. I tried a few other cleanup tricks, but none of them worked. <br />
<br />
Another question is: how do I properly return a value from this function? As far as I understand, the return value can be stored in the A register. Suppose I wanted to indicate that the tape loaded correctly with a value of 0, would I simply LD A, 0 at the end of the function and that would be enough? This, of course, is a separate issue once I can actually get this function to load anything without resetting the PC or hanging <img src="https://forum.boriel.com/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
Thanks in advance.]]></description>
			<content:encoded><![CDATA[Hello,<br />
I'm trying to code a simple headerless LOAD routine in ZX Basic using the inline assembly feature of the compiler. The basic idea here is to write a function that uses assembly to set up the necessary registers and call the ROM routine 0556h for a headerless load (e.g. to load an extra level from the tape). I have some progress in this area, but it looks like I misunderstand how to clean up things correctly after the ROM routine returns and my function ends, so the poor Speccy either hangs or is reset after the code loading routine completes. I tried a few things so far, but the experiment that went the farthest so far is this one:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>function hload(addr as uInteger, size as uInteger) as uByte<br />
&nbsp;&nbsp;&nbsp;&nbsp;asm<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pop hl<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pop de<br />
        pop ix<br />
        ld a, 255<br />
        scf<br />
        call 0556h<br />
        push hl<br />
&nbsp;&nbsp;&nbsp;&nbsp;end asm<br />
end function</code></div></div><br />
<br />
The expected result is that calling this function, for instance, in this way: <br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>hload(16384, 6912)</code></div></div><br />
should be able to load standard ZX screen data correctly. Trying to load a screen this way indicates that the screen is indeed loaded into the right area of memory, but once the loading completes, the computer is reset.<br />
<br />
I'm pretty sure that this indicates that something is screwed up at the end of the function call. Could be due to the fact that SP or something else is modified from within 0556h and that changes the register state, or something else along those lines, but I can't quite figure it out :/ I would appreciate some help since I'm not sure how to proceed. I tried a few other cleanup tricks, but none of them worked. <br />
<br />
Another question is: how do I properly return a value from this function? As far as I understand, the return value can be stored in the A register. Suppose I wanted to indicate that the tape loaded correctly with a value of 0, would I simply LD A, 0 at the end of the function and that would be enough? This, of course, is a separate issue once I can actually get this function to load anything without resetting the PC or hanging <img src="https://forum.boriel.com/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
Thanks in advance.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Turn Off Keyword Hint]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2599</link>
			<pubDate>Thu, 30 Jan 2025 12:00:52 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2264">ChewBakker</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2599</guid>
			<description><![CDATA[Is it possible to turn off the Keyword hints in ZXBasicStudio ?<br />
<br />
I can't see them in the dropdown popup, and it annoyingly makes entering code awkward.]]></description>
			<content:encoded><![CDATA[Is it possible to turn off the Keyword hints in ZXBasicStudio ?<br />
<br />
I can't see them in the dropdown popup, and it annoyingly makes entering code awkward.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Unable to see Key Words]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2598</link>
			<pubDate>Wed, 29 Jan 2025 11:57:37 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2264">ChewBakker</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2598</guid>
			<description><![CDATA[I had an issue with my Boriel that prevented me from using the debugger. This has been fixed with help from the forum and me installing the latest version of the Boriel ZXBasicStudio.<br />
<br />
My issue now is that I can no longer see Key Words when entering code (see attachment). If anyone could help on this it would be highly appreciated.<br />
<br />
I checked with the older version and that does show the KeyWords, but won't run in debug mode.<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=348" target="_blank" title="">key words.jpg</a> (Size: 57.19 KB / Downloads: 548)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[I had an issue with my Boriel that prevented me from using the debugger. This has been fixed with help from the forum and me installing the latest version of the Boriel ZXBasicStudio.<br />
<br />
My issue now is that I can no longer see Key Words when entering code (see attachment). If anyone could help on this it would be highly appreciated.<br />
<br />
I checked with the older version and that does show the KeyWords, but won't run in debug mode.<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=348" target="_blank" title="">key words.jpg</a> (Size: 57.19 KB / Downloads: 548)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Just Installed ZXBasicStudio but cannot debug]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2597</link>
			<pubDate>Tue, 28 Jan 2025 17:20:13 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2264">ChewBakker</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2597</guid>
			<description><![CDATA[Hi, I am new to the forum, but not to the ZX Spectrum :-)<br />
<br />
I have installed the latest version of ZXBasicStudio and ZXBasic compiler onto my PC.<br />
<br />
I have created a very simple program than runs from within ZXBasicStudio.<br />
<br />
However, when I try and Debug it creates some new files in the project folder:<br />
<br />
Main.buildtemp.bas<br />
Main.buildtemp.bin<br />
Main.buildtemp.ir<br />
MEMORY_MAP<br />
<br />
<br />
but I get the following error mesage:<br />
<br />
Exception: Could not find file 'D:\BorielDev\Projects\HelloWorld\Main.buildtemp.ic' at<br />
<br />
.<br />
.<br />
.<br />
<br />
Screenshot below...<br />
<br />
If anyone could point me to where I am going wrong it would be highly appreciated.<br />
<br />
<br />
<br />
<br />
John<br />
<br />
<br />
<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=343" target="_blank" title="">ZXBasicIssue.jpg</a> (Size: 261.7 KB / Downloads: 620)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Hi, I am new to the forum, but not to the ZX Spectrum :-)<br />
<br />
I have installed the latest version of ZXBasicStudio and ZXBasic compiler onto my PC.<br />
<br />
I have created a very simple program than runs from within ZXBasicStudio.<br />
<br />
However, when I try and Debug it creates some new files in the project folder:<br />
<br />
Main.buildtemp.bas<br />
Main.buildtemp.bin<br />
Main.buildtemp.ir<br />
MEMORY_MAP<br />
<br />
<br />
but I get the following error mesage:<br />
<br />
Exception: Could not find file 'D:\BorielDev\Projects\HelloWorld\Main.buildtemp.ic' at<br />
<br />
.<br />
.<br />
.<br />
<br />
Screenshot below...<br />
<br />
If anyone could point me to where I am going wrong it would be highly appreciated.<br />
<br />
<br />
<br />
<br />
John<br />
<br />
<br />
<br />
<!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forum.boriel.com/images/attachtypes/image.png" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=343" target="_blank" title="">ZXBasicIssue.jpg</a> (Size: 261.7 KB / Downloads: 620)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Question on file extension]]></title>
			<link>https://forum.boriel.com/showthread.php?tid=2596</link>
			<pubDate>Sat, 18 Jan 2025 22:11:10 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.boriel.com/member.php?action=profile&uid=2220">zedex82</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.boriel.com/showthread.php?tid=2596</guid>
			<description><![CDATA[I am working my way through the book 'Boriel Basic for Beginners'. It is a very good book and well written. I have convinced my friend to buy a copy too.<br />
<br />
On page 166 in the example the first command is '#INCLUDE "ship.gdu.bas". When I exported the UDG's as per the instructions on page 165 it creates a file 'ship.gdu.zxbas'<br />
<br />
I was wondering why it did not export with the extension '.bas'. I understand I just need to change the extension in the code and it loads in fine, I just want to understand why. It may be something I have done wrong.<br />
<br />
ZeDeX82]]></description>
			<content:encoded><![CDATA[I am working my way through the book 'Boriel Basic for Beginners'. It is a very good book and well written. I have convinced my friend to buy a copy too.<br />
<br />
On page 166 in the example the first command is '#INCLUDE "ship.gdu.bas". When I exported the UDG's as per the instructions on page 165 it creates a file 'ship.gdu.zxbas'<br />
<br />
I was wondering why it did not export with the extension '.bas'. I understand I just need to change the extension in the code and it loads in fine, I just want to understand why. It may be something I have done wrong.<br />
<br />
ZeDeX82]]></content:encoded>
		</item>
	</channel>
</rss>