Assembly Help

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
Ast A. Moore
Dynamite Dan
Posts: 1217
Joined: Mon Nov 13, 2017 3:16 pm

Re: Assembly Help

Post by Ast A. Moore » Mon Dec 03, 2018 7:46 pm

Bizzley wrote:
Mon Dec 03, 2018 7:37 pm
Ast A. Moore wrote:
Mon Dec 03, 2018 7:12 pm
Hah! Neat. A bit tough to use with custom fonts, though, which was what I initially wrote mine for. ;)
Not really. As long as you're careful on what specific page boundary you put the font then it's just a matter of changing the LD H,n command to the appropriate value. While there are some values you can't use there are others where you don't need to apply the OR n command at all and can reduce the routine to 15 bytes. It's a bit like setting up interrupt vector tables, you tend to pick something and code around it...well at least I do :)
True. Although with fonts, I only align them with an 8-byte window boundary (to keep the INC L instruction instead of INC HL for speed). That way I only lose seven bytes at most. Besides, I let the assembler worry about where to stick the font. One less thing to worry about. :P
0 x
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.

User avatar
PeterJ
Site Admin
Posts: 1347
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Assembly Help

Post by PeterJ » Mon Dec 03, 2018 8:22 pm

Thanks for all the replies guys.
0 x

AndyC
Manic Miner
Posts: 251
Joined: Mon Nov 13, 2017 5:12 am

Re: Assembly Help

Post by AndyC » Mon Dec 03, 2018 8:23 pm

Ast A. Moore wrote:
Mon Dec 03, 2018 7:46 pm
Bizzley wrote:
Mon Dec 03, 2018 7:37 pm
Ast A. Moore wrote:
Mon Dec 03, 2018 7:12 pm
Hah! Neat. A bit tough to use with custom fonts, though, which was what I initially wrote mine for. ;)
Not really. As long as you're careful on what specific page boundary you put the font then it's just a matter of changing the LD H,n command to the appropriate value. While there are some values you can't use there are others where you don't need to apply the OR n command at all and can reduce the routine to 15 bytes. It's a bit like setting up interrupt vector tables, you tend to pick something and code around it...well at least I do :)
True. Although with fonts, I only align them with an 8-byte window boundary (to keep the INC L instruction instead of INC HL for speed). That way I only lose seven bytes at most. Besides, I let the assembler worry about where to stick the font. One less thing to worry about. :P
I normally find I have enough 256-byte aligned tables that adding another doesn't actually lose any bytes.
0 x

User avatar
Ivanzx
Site Admin
Posts: 210
Joined: Tue Nov 14, 2017 9:51 am

Re: Assembly Help

Post by Ivanzx » Mon Dec 03, 2018 8:45 pm

Aaaaaaaaand, what game are you coding? :)
0 x

namco
Dizzy
Posts: 98
Joined: Mon Dec 04, 2017 8:55 pm

Re: Assembly Help

Post by namco » Mon Dec 03, 2018 8:46 pm

Here's my RST command for Print At. I'm currently using this on the ZX Spectrum Next to check on the number in my sprite rotation.:

Code: Select all

ld a,22 ; Set A with PRINT AT command
rst 10h ; Call

ld a,10 ; Set A with 7 (Y coord)
rst 10h

ld a,10 ; Set A with 8 (X coord)
rst 10h

ld a,0
ld a,(rightplayer)
ld bc,0
ld c,a
call 6683
0 x

User avatar
PeterJ
Site Admin
Posts: 1347
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Assembly Help

Post by PeterJ » Mon Dec 03, 2018 9:01 pm

Ivanzx wrote:
Mon Dec 03, 2018 8:45 pm
Aaaaaaaaand, what game are you coding? :)
Its a simple platform game. Nothing that will shake the world, but I try and get back to developing it when I can.
0 x

User avatar
Cosmium
Berk
Posts: 38
Joined: Tue Dec 04, 2018 10:20 pm
Location: USA

Re: Assembly Help

Post by Cosmium » Mon Dec 10, 2018 5:34 pm

PeterJ wrote:
Mon Dec 03, 2018 1:25 pm
Hi,

I'm coming back to working on my game, and because I have left it so long I seem to have forgotten so much!
Hi Peter - I know the feeling! Six months ago I was in a similar position to you and a bit rusty on the Z80 having not touched it since the early 1990s. But it's funny how quickly it comes back. Really enjoyable to be back on this 8-bit processor.

Good luck completing your game!

Cosmium
0 x

Post Reply