128k Programming basics using Z88DK and the SCCZ80 compiler Lesson 4

Placing C Routines in Sections

This is the fourth lesson of programming the 128k ZX Spectrum. Today, I’m going to write about placing C routines in a specific memory space (SECTION) and calling it from main() in uncontended.c. This allows you to choose if you want to run your functions in either contended RAM, uncontended RAM, or the home bank 0. In another lesson, we will expand this to having functions in other RAM banks. Having code in other RAM banks is rather easy using the framework that I am going to show.

Continue reading “128k Programming basics using Z88DK and the SCCZ80 compiler Lesson 4”

128k Programming basics using Z88DK and the SCCZ80 compiler Lesson 3

Placing Assembly Routines in Sections

This is the third lesson of programming the 128k ZX Spectrum. Today, I’m going to write about placing simple assembly routines in a specific memory space (SECTION) and calling it from C. This lesson is NOT about programming in assembly, I would quite possibly be the worst person to do so. I never really learned assembler and can sometimes muddle through simple stuff, many resources teach assembly language.

Continue reading “128k Programming basics using Z88DK and the SCCZ80 compiler Lesson 3”

128k Programming basics using Z88DK and the SCCZ80 compiler Lesson 2 part 3

NOTES

This is our second lesson, part 3 of programming the 128k ZX Spectrum. I have split up this lesson into several parts as I have greatly expanded the source code. In my last part, I covered the C code that brings together the 3 parts of contended, uncontended, and RAM0. Here we are going to cover some detailed notes before we start moving to lesson 3.

Continue reading “128k Programming basics using Z88DK and the SCCZ80 compiler Lesson 2 part 3”

128k Programming basics using Z88DK and the SCCZ80 compiler Lesson 2 part 2

OBJECT files and linking to associate sections

This is our second lesson, part 2 of programming the 128k ZX Spectrum. I have split up this lesson into several parts as I have greatly expanded the source code. In my last part, I covered the many batch files that I am using to compile the separate files

Continue reading “128k Programming basics using Z88DK and the SCCZ80 compiler Lesson 2 part 2”

128k Programming basics using Z88DK and the SCCZ80 compiler lesson 2, part 1

Setting up BATCH files

This is our second lesson, part 1 of programming the 128k ZX Spectrum. I have split up this lesson into several parts as I have greatly expanded the source code. Even though the code is still simple, I have split up the code into three different areas. Our eventual goal for this lesson is to combine our 3 memory sections into one program. We are not, in this lesson, going for anything spectacular, this is going to be simple code. Even though we are combining 3 sections into one program, the ram-low section and Ram 0 section are going to be storing assembly variables. The nice thing is that assembly variables can be easily seen in C. The irritating thing is that you have to slightly alter the name making it difficult to trace at times. In the end, we are going to be able to place different routines in different memory sections.

Continue reading “128k Programming basics using Z88DK and the SCCZ80 compiler lesson 2, part 1”

128k Programming basics using Z88DK and the SCCZ80 compiler lesson 1

Unassociated Programming

This is the first part of a multipart series that will ease us into programming on the 128k Sinclair ZX Spectrum. Today, we are going to start by creating 3 unassociated programs that will compile to different sections of memory. Since the lower portion of memory in the ZX Spectrum is contended (meaning shared with the ULA), it is thus a bit slower and programs running in it are subject to being halted for a short while. We will still compile for contended as well as uncontended memory.

Today, we are going to start at some basics of 128k programming, this will be creating 3 simple programs all very similar with 1 exception, where the program is placed in memory.

Continue reading “128k Programming basics using Z88DK and the SCCZ80 compiler lesson 1”

128k Programming basics using Z88DK and the SCCZ80 compiler – Introduction

I have received a few private messages wanting to know some of the basics of programming on the 128k ZX Spectrum using Z88dk. My prior articles seem to jump the basics without some explanations. So the next few articles will attempt to fill in some of the basics.

Continue reading “128k Programming basics using Z88DK and the SCCZ80 compiler – Introduction”

Z88dk Bank Switching Part 6: Object files

This is the sixth part of a multi-part series of using Z88dk to create a 128k program with Bank Switching. The code is available from https://github.com/andydansby/zx-spectrum-128k-screen-paging-sccz80

Z88dk Bank Switching Part 6: Object file

An object file is the real output of the compiling phase which is mainly assembler but has symbols and information within it that a linker uses to build the final output. Building an object file is important to make a 128k TAP to output each section to a separate binary, which happens during the linking stage. The linking stage will be covered in another blog post, today I’m just covering the object file(s).
Continue reading “Z88dk Bank Switching Part 6: Object files”

Z88dk Bank Switching– Notes for the ZX Next machine

This blog usually only covers classic ZX Spectrums, the standard 48k, and 128k variety. However, due to the popularity of the upcoming ZX Spectrum Next machines, I want to place some notes from Allen Albright about Bank switching for the ZX Spectrum Next

These notes are posted with permission, to preserve them.
Continue reading “Z88dk Bank Switching– Notes for the ZX Next machine”

Z88dk Bank Switching Part 5: SECTIONS

This is the fifth part of a multi-part series of using Z88dk to create a 128k program with Bank Switching. The code is available from https://github.com/andydansby/zx-spectrum-128k-screen-paging-sccz80

Z88dk Bank Switching Part 5: SECTIONS

Today, let’s take a look at sections which is a mechanism that Z88dk uses to place bits of code and data within a certain section of memory. This allows Z88dk to manage your memory and automatically make adjustments without having to manually link via code data and code blocks. This is what we need for bank switching.

Continue reading “Z88dk Bank Switching Part 5: SECTIONS”

Design a site like this with WordPress.com
Get started