Search found 5 matches

by _dw
Fri Sep 06, 2024 2:44 am
Forum: General Off topic
Topic: Forth compiler for ZX
Replies: 4
Views: 25736

Re: Forth compiler for ZX

Hi everyone,

I've been working these days on more support for unsigned 16-bit binary division by a constant on Z80.
I had some low values ​​ready that count well.
Such as dividing by a power of two such as 2, 4, 8, 16 ...
Furthermore, the values ​​contained in the decomposition of the number 255 ...
by _dw
Sat Dec 30, 2023 6:36 am
Forum: General Off topic
Topic: Forth compiler for ZX
Replies: 4
Views: 25736

Re: Forth compiler for ZX

For the last 3 nights I have been solving signed and unsigned comparisons of 8-bit numbers. Before it occurred to me that the Z80's support for the overflow flag could also be used in 16-bit numbers.
I had a pretty good solution (better than the best you can find on the internet)
dworkin@dw-A15 ...
by _dw
Thu Dec 07, 2023 8:21 pm
Forum: General Off topic
Topic: Forth compiler for ZX
Replies: 4
Views: 25736

Re: Video: Lesson P37 - Playing Digital Sound with WAV on the ZX Spectrum

I try play music with beeper (ZX 48kb). Adding songs isn't that difficult when using a music engine, but this topic is incredibly hard for me.
[youtube]https://www.youtube.com/watch?v=4D28quLwQG0[/youtube]
https://www.youtube.com/watch?v=4D28quLwQG0

In M4 FORTH, this can be achieved with the help ...
by _dw
Thu Dec 07, 2023 8:06 pm
Forum: ZX Spectrum Assembly Programming
Topic: Lesson H2 - Hello World on the ZX Spectrum
Replies: 1
Views: 20890

Re: Lesson H2 - Hello World on the ZX Spectrum

For comparison

Forth (hello.fth)
." Hello Word!"
M4 FORTH (use ../fth2m4.sh hello.fth > hello.m4)
include(`../M4/FIRST.M4')dnl
ifdef __ORG
org __ORG
else
org 32768
endif
INIT(60000)
PRINT({"Hello World!"})
STOP
ZX Spectrum asm (use ../compile.sh hello 32768)
ifdef __ORG
org __ORG
else ...
by _dw
Thu Dec 07, 2023 6:21 pm
Forum: General Off topic
Topic: Forth compiler for ZX
Replies: 4
Views: 25736

Forth compiler for ZX

Hello,

I tried using macros to simulate loops in assembler and finally ended up with a higher language compiler into Z80 assembler. I chose Forth as a language because it is simpler than C and in a sense it is somewhere halfway between C and Asm.

When I started I knew almost nothing about Forth ...

Go to advanced search