DEFINE PRAGMAS: STACK POSITION AND SIZE (1)

Although ugBASIC is a stackless language, it can still interact with the processor's stack. Not all processors allow you to change the size and position of the stack, and sometimes there are limitations due to hardware features (e.g., consoles). As with other instructions, ugBASIC's isomorphism still allows the instruction to be used on processors that have a programmable stack.

source compile sandbox issues? back to examples

SOURCE CODE ()

OPTION COMPILE ON COCO,COCO3,DRAGON32,DRAGON64,MO5,PC128OP,TO8,ZX

	DEFINE STACK SIZE 100
	DEFINE STACK START &H7000

PROCEDURE hello

	PRINT "hello!"

END PROCEDURE

	hello[]
	

How to compile and run the example

The instructions here refer to compiling the example from the command line. For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile each single example with just one click.



Are instructions for your specific home computer / console missing? First of all, check if your computer is supported by clicking here. If so, since ugBASIC is a language which does not provide abstractions, it is possible that this example will not work on your target. If you think this is an issue, please click here.

COCO 1/2 (Hitachi 6309)

In order to compile the example, type this command on the command line:

Linux

ugbc.cocob -O bin -o defines_stack.bin defines_stack.bas

Windows

ugbc.cocob.exe -O bin -o defines_stack.bin defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

COCO 1/2 (Motorola 6809)

In order to compile the example, type this command on the command line:

Linux

ugbc.coco -O bin -o defines_stack.bin defines_stack.bas

Windows

ugbc.coco.exe -O bin -o defines_stack.bin defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

COCO 3 (Hitachi 6309)

In order to compile the example, type this command on the command line:

Linux

ugbc.coco3b -O -o defines_stack. defines_stack.bas

Windows

ugbc.coco3b.exe -O -o defines_stack. defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

COCO 3 (Motorola 6809)

In order to compile the example, type this command on the command line:

Linux

ugbc.coco3 -O bin -o defines_stack.bin defines_stack.bas

Windows

ugbc.coco3.exe -O bin -o defines_stack.bin defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Dragon 32 (Hitachi 6309)

In order to compile the example, type this command on the command line:

Linux

ugbc.d32b -O -o defines_stack. defines_stack.bas

Windows

ugbc.d32b.exe -O -o defines_stack. defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Dragon 32 (Motorola 6809)

In order to compile the example, type this command on the command line:

Linux

ugbc.d32 -O bin -o defines_stack.bin defines_stack.bas

Windows

ugbc.d32.exe -O bin -o defines_stack.bin defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Dragon 64 (Hitachi 6309)

In order to compile the example, type this command on the command line:

Linux

ugbc.d64b -O -o defines_stack. defines_stack.bas

Windows

ugbc.d64b.exe -O -o defines_stack. defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Dragon 64 (Motorola 6809)

In order to compile the example, type this command on the command line:

Linux

ugbc.d64 -O bin -o defines_stack.bin defines_stack.bas

Windows

ugbc.d64.exe -O bin -o defines_stack.bin defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Thomson MO5

In order to compile the example, type this command on the command line:

Linux

ugbc.mo5 -O k7 -o defines_stack.k7 defines_stack.bas

Windows

ugbc.mo5.exe -O k7 -o defines_stack.k7 defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Thomson TO8

In order to compile the example, type this command on the command line:

Linux

ugbc.to8 -O k7 -o defines_stack.k7 defines_stack.bas

Windows

ugbc.to8.exe -O k7 -o defines_stack.k7 defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

ZX Spectrum +2, ZX Spectrum 128K, ZX Spectrum 48K

In order to compile the example, type this command on the command line:

Linux

ugbc.zx -O tap -o defines_stack.tap defines_stack.bas

Windows

ugbc.zx.exe -O tap -o defines_stack.tap defines_stack.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Any problem?

If you have found a problem trying to run this example, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO EXAMPLES