How to place assembly code at a specific address with z88dk ?

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
zx81ultra
Posts: 31
Joined: Thu Feb 13, 2020 4:19 am
Location: Bolivia

How to place assembly code at a specific address with z88dk ?

Post by zx81ultra »

Hello,

How do I place assembly code at a specific address ?

Code: Select all

void SetPseudoHiRes(void)
{
#asm

start:			ld a,04h
			ld i,a
			ld ix,042c4h
			ret

42c4			ld hl,0e6dfh	//code to be placed at 0x42c4
			ld de,0021h
			di	
			ld c,0feh	
			ld b,016h

42cf			djnz 042cfh		//code to be placed at 0x42cf
			ld b,0c0h
Thank you !
Camilo Eid - ZX81
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: How to place assembly code at a specific address with z88dk ?

Post by XavSnap »

Hi,
Try to use the ORG directive...
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
zx81ultra
Posts: 31
Joined: Thu Feb 13, 2020 4:19 am
Location: Bolivia

Re: How to place assembly code at a specific address with z88dk ?

Post by zx81ultra »

Thank you Xavier,

I was trying to test some Pseudo Hires routines I saw at http://www.pictureviewerpro.com/hosting ... ighres.txt and http://www.user.dccnet.com/wrigter/inde ... torial.htm but it is clear that my assembler capabilities are too limited.

I just finished coding a game for the zx81 with z88dk in text mode and I wanted to see how difficult it would be to port it to pseudo hires before releasing it but I couldn't find "ready to use" pseudo hires routines.
Camilo Eid - ZX81
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: How to place assembly code at a specific address with z88dk ?

Post by mrtinb »

Z88dk has built in support for graphics on the ZX81. But I don’t think pseudo hires is supported. I know WRX and UDG graphics is created with z88dk libraries.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
SM7I
Posts: 10
Joined: Fri Dec 06, 2019 11:13 am

Re: How to place assembly code at a specific address with z88dk ?

Post by SM7I »

It might be that I´m wrong here, but the ORG statement does not work with inline asm when compiled with Z88dk. You might as well set it on the commandline when compiling instead...
Post Reply