More Assembly/Spectrum confusion for me :D

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
chilledgamer
Berk
Posts: 46
Joined: Wed Jun 24, 2020 1:22 am
Location: Torquay
Contact:

More Assembly/Spectrum confusion for me :D

Post by chilledgamer »

OK I wanted to try to figure this out myself but yet again I'm stumped (even after much googling/pdf reading)

Hopefully it's a simple question to you experts.

In my example program (Z80 Assembly Spectrum Simple Game) there is a line near the start,

Code: Select all

call 3503 ;ROM routine, clears screen + open ch2
My question is, where does he find this information. I have read the 48k and 128k Spectrum Manuals. Zilog User manual (didn't expect to find answer there). I have googled "ZX Spectrum Memory map" "Rom routines" and many other things.

Surely there is a list somewhere with all of those memory address which have functions built-in on the Spectrum (unless I am still misunderstanding the whole thing here!) but I cannot find it anywhere
0 x

edjones
Berk
Posts: 6
Joined: Fri Feb 28, 2020 1:42 pm

Re: More Assembly/Spectrum confusion for me :D

Post by edjones »

0 x

Ersh
Manic Miner
Posts: 289
Joined: Mon Nov 13, 2017 1:06 pm

Re: More Assembly/Spectrum confusion for me :D

Post by Ersh »

and this.
0 x

User avatar
Morkin
Manic Miner
Posts: 888
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: More Assembly/Spectrum confusion for me :D

Post by Morkin »

I'm sure this has come up before, and the eventual answer always seems to be 'there isn't one'... (Maybe you could start one..? ;) )

When I say there isn't one, I mean I've never seen a "hey, here's the top 4 or 5 useful ROM routines that a lot of people found useful when learning assembly".

There's a few 'here's the entire ROM documented' like the skoolkit one, but while that may be useful for reference, it's only useful if you already know what you're looking for. Otherwise it's a needle-in-a-haystack situation.

I reckon the best I've seen on this is the very tutorial/guide you've been looking at - from what I remember, it covers:

- clearing the screen with different PAPER, BORDER colours
- playing sound effects/music (the BEEPER sound routine)
- printing strings of characters/text using the ROM print routine

To be honest I don't think I've ever used any other ROM calls, from what I remember.
0 x

User avatar
chilledgamer
Berk
Posts: 46
Joined: Wed Jun 24, 2020 1:22 am
Location: Torquay
Contact:

Re: More Assembly/Spectrum confusion for me :D

Post by chilledgamer »

thanks for the links guys. I have already been looking extensively at the first link, would you be kind enough to show me where the function "3503" is described?

Also I do have that book already. I found the page as pictured in my screenshot , but again that function couldnt be found


Image
0 x

User avatar
chilledgamer
Berk
Posts: 46
Joined: Wed Jun 24, 2020 1:22 am
Location: Torquay
Contact:

Re: More Assembly/Spectrum confusion for me :D

Post by chilledgamer »

Morkin wrote:
Thu Jun 25, 2020 3:46 pm
I'm sure this has come up before, and the eventual answer always seems to be 'there isn't one'... (Maybe you could start one..? ;) )

When I say there isn't one, I mean I've never seen a "hey, here's the top 4 or 5 useful ROM routines that a lot of people found useful when learning assembly".

There's a few 'here's the entire ROM documented' like the skoolkit one, but while that may be useful for reference, it's only useful if you already know what you're looking for. Otherwise it's a needle-in-a-haystack situation.

I reckon the best I've seen on this is the very tutorial/guide you've been looking at - from what I remember, it covers:

- clearing the screen with different PAPER, BORDER colours
- playing sound effects/music (the BEEPER sound routine)
- printing strings of characters/text using the ROM print routine

To be honest I don't think I've ever used any other ROM calls, from what I remember.

I guess I will start one :D It will take me a long time since I don't even understand how to use 3503 yet lol

Seems insane that after around 40 years there is not a table of detailed description, in order of all functions that exist in memory
0 x

User avatar
chilledgamer
Berk
Posts: 46
Joined: Wed Jun 24, 2020 1:22 am
Location: Torquay
Contact:

Re: More Assembly/Spectrum confusion for me :D

Post by chilledgamer »

while i have your attention. Why is "RST 16" used for print?
Sometimes in that simple game example he just uses it to 'set' a position coordinate instead. But again I can't find much documentation that is actually helpful to me.

I mean this reference site has been a godsend for me so far,
http://z80-heaven.wikidot.com/opcode-reference-chart

aswell as this excellent tutorial of course (which I would have been lost ages ago without!)
0 x

Ralf
Dynamite Dan
Posts: 1521
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: More Assembly/Spectrum confusion for me :D

Post by Ralf »

Speking of ROM procedures surprisingly I found this quite useful:

https://spectrumcomputing.co.uk/entry.php?id=8636
Image

It's in German but you can get general sense from it even if your German sucks.
1 x

User avatar
PROSM
Manic Miner
Posts: 200
Joined: Fri Nov 17, 2017 7:18 pm
Location: Sunderland, England
Contact:

Re: More Assembly/Spectrum confusion for me :D

Post by PROSM »

chilledgamer wrote:
Thu Jun 25, 2020 3:49 pm
thanks for the links guys. I have already been looking extensively at the first link, would you be kind enough to show me where the function "3503" is described?

Also I do have that book already. I found the page as pictured in my screenshot , but again that function couldnt be found


Image
I think the confusion here is because of a mix-up between decimal and hexadecimal. The reference you've posted is using hexadecimal, but you're looking up the decimal address of 3503, which is in fact 0x0DAF in hex.

It would definitely help to learn hex, but for now, you can probably get by just using the decimal version of the ROM disassembly. Here's the link for that function you were mentioning by the way.
0 x
All software to-date
Host of CSSCGC 2020
Working on ZAD, among other things

User avatar
chilledgamer
Berk
Posts: 46
Joined: Wed Jun 24, 2020 1:22 am
Location: Torquay
Contact:

Re: More Assembly/Spectrum confusion for me :D

Post by chilledgamer »

Ok I do understand hex quite well having played with NES roms for a long time.
I didn't see any prefix such as 0x & etc so assumed it was both decimal. So really I am 'calling' 13751?

Or am i looking for documentation reference to 13751?

EDIT: just found your link thank you very much
0 x

Post Reply