How to place assembly code at a specific address ?

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
zx81ultra
Member
Posts: 36
Joined: Thu Feb 13, 2020 1:56 am

How to place assembly code at a specific address ?

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.
stefano
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

This is part of the complexity of the thing you're trying to get. you need to deal with the position of the code blocks in zx81_crt0, it begins at 16515 (decimal) and includes external pieces of code, like the current display driver chosen with the compiler options.
don't give up, your concept code looks promising ;)
Post Reply