Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Z80 PRINT AT?

477 views
Skip to first unread message

Mark Szolkowski

unread,
Sep 3, 2005, 6:00:15 PM9/3/05
to
Sorry if this is a trivial question, but I can't find an answer to this
in any FAQs, web searches, etc.

I know about using RST 10h to print a character, but how do I specify
x/y co-ordinates? I tried the locations that a BASIC PRINT AT sets up
(22528 and 22529, I think they were), even though I read somewhere that
I shouldn't do this...

Or do I need to "roll my own" routine for this functionality?

I'm willing to go RTFM if somebody would be kind enough to tell me
which FM TR :)

--Mark

PS Only found out about Cronosoft last week - "Higgledy Piggledy"
arrived in the post this morning. Fantastic - i.e. the game, as well as
being able to buy it in the first place!

Darren Salt

unread,
Sep 3, 2005, 6:16:15 PM9/3/05
to
I demand that Mark Szolkowski may or may not have written...

[snip]


> I know about using RST 10h to print a character, but how do I specify x/y
> co-ordinates? I tried the locations that a BASIC PRINT AT sets up (22528
> and 22529, I think they were), even though I read somewhere that I
> shouldn't do this...

PRINT CHR$ 22; CHR$ y; CHR$ x;

[snip]
--
| Darren Salt | d youmustbejoking,demon,co,uk | nr. Ashington,
| RISC OS, | s zap,tartarus,org | Northumberland
| Linux | @ | Toon Army
| We've got Souness, we don't want him

PC card not responding (probably running Windows)

Mark Szolkowski

unread,
Sep 4, 2005, 3:49:28 AM9/4/05
to
Thanks for the reply, Darren, but how do I translate that?

That is, how do I put it in the '...' if I have code like the
following:

LD A,2
CALL 1601 ; select screen
... ; set x and y co-ords
LD A,66 ; character 'B'
RST 16 ; print 'B' to screen

Woody

unread,
Sep 4, 2005, 5:23:46 AM9/4/05
to
On 4 Sep 2005 00:49:28 -0700, "Mark Szolkowski"
<mark.sz...@gmail.com> wrote:

Same as for your character 'B'. See Darren's reply again ;)

Geoff Wearmouth

unread,
Sep 4, 2005, 6:41:03 AM9/4/05
to
In message <1125820168....@g14g2000cwa.googlegroups.com>, Mark
Szolkowski <mark.sz...@gmail.com> writes

Hi Mark,

Your title should refer to the ZX Spectrum as all ROM routines are
different as are the restarts. On the Jupiter Ace, RST 08 prints the
character in the accumulator.

Remember that 1601 is the hexadecimal address of the open channel
routine. Depending on the assembler, you would use a qualifier such as
1601H, $1601 or #1601 having loaded the accumulator with 2 first - then

LD A,22
RST 16 (or RST 10H)
LD A,4
RST 16
LD A,9
RST 16
LD A,66
RST 16
RET

is the equivalent of PRINT AT 4,9,"B"

You can't POKE just the S_POSN system variables as DF_CC must be kept in
line. The former are counters used to decide when newlines and scrolling
are required. The latter is the absolute screen address of the first
byte.

LD BC, #0409
CALL #0DD9

is a way to position the text with six bytes of code.

--
Geoff Wearmouth
GOSH WONDERFUL BASIC ROM: http://www.wearmouth.demon.co.uk/zz/zz.htm

Mark Szolkowski

unread,
Sep 4, 2005, 7:54:33 AM9/4/05
to
Thanks everyone.

(1) Yes, sorry: I realised as soon as I posted that I'd missed "ZX
Spectrum" out of the title but couldn't see a way of amending it :(

(2) I hadn't made the link that the "22" in Darren's post was a control
code for "AT y,x" - oops.

--Mark

spi...@freenet.co.uk

unread,
Sep 4, 2005, 9:31:25 AM9/4/05
to
Mark Szolkowski <mark.sz...@gmail.com> did eloquently scribble:

> Sorry if this is a trivial question, but I can't find an answer to this
> in any FAQs, web searches, etc.
>
> I know about using RST 10h to print a character, but how do I specify
> x/y co-ordinates? I tried the locations that a BASIC PRINT AT sets up
> (22528 and 22529, I think they were), even though I read somewhere that
> I shouldn't do this...

Try using the AT control character followed by the 2 coordinates.
That's how some games managed to print the name without Program: when
loading.
--
______________________________________________________________________________
| spi...@freenet.co.uk | "Are you pondering what I'm pondering Pinky?" |
|Andrew Halliwell BSc(hons)| |
| in | "I think so brain, but this time, you control |
| Computer Science | the Encounter suit, and I'll do the voice..." |
------------------------------------------------------------------------------

spi...@freenet.co.uk

unread,
Sep 4, 2005, 9:31:25 AM9/4/05
to
Mark Szolkowski <mark.sz...@gmail.com> did eloquently scribble:
LD A, 22
RST 16
LD A, x
RST 16
LD A, 66
RST 16
--
______________________________________________________________________________
| spi...@freenet.co.uk | "I'm alive!!! I can touch! I can taste! |
|Andrew Halliwell BSc(hons)| I can SMELL!!! KRYTEN!!! Unpack Rachel and |
| in | get out the puncture repair kit!" |
| Computer Science | Arnold Judas Rimmer- Red Dwarf |
------------------------------------------------------------------------------

Geoff Wearmouth

unread,
Sep 4, 2005, 2:27:07 PM9/4/05
to
In message <1125834873.8...@g43g2000cwa.googlegroups.com>, Mark
Szolkowski <mark.sz...@gmail.com> writes

>Thanks everyone.
>
>(1) Yes, sorry: I realised as soon as I posted that I'd missed "ZX
>Spectrum" out of the title but couldn't see a way of amending it :(

That's OK. I didn't read it properly either and spent some time looking
through my ZX80 documentation. :-)

I'm awake now and when calling CLS-SET #0DD9, B should contain 24-y and
C should contain 33-x not the same values that are used in BASIC. Oops.

--
Geoff Wearmouth

0 new messages