News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_johnlobo

Silly question, inc(ix+3) in sdasz80 (SDCC assembler)??

Started by johnlobo, 18:10, 22 February 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

johnlobo

Hi all,
One silly question for the experts in CPCTelera assembler.

In sdasz80, the assembler of SDCC, the syntax for using ix and iy registers is something like...

ld a, 3(ix)
and can be also used with constants

ld a, e_life(ix)

...but does anybody know what's the syntax for the increment of the referenced value ??

inc (e_life(ix)) produces a "missing or improper operators, terminators, or delimiters error" 

But, in plain assembler something like this...

inc (ix +3)
proceduces the code 34 ff 03.. so it's a valid opcode, and I guess that must be implemented somehow in sdasz80, even though I've been trying different sytax alternatives with no success.

Any help??

Thanks in advance.

reidrac

I just tried "inc 3 (ix)" and it works, and "inc CONSTANT (ix)" works too. This is SDCC 4.0.

EDIT: of course, I encourage you to avoid using ix and iy. That's slow!  :laugh:
Released The Return of Traxtor, Golden Tail, Magica, The Dawn of Kernel, Kitsune`s Curse, Brick Rick and Hyperdrive for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

johnlobo

Great!!  it works.
Thank you very much.

Must be the only combination I didn't try myself...  :D
In any case, you're right, I'll try not tu abuse of index registries, even though in my current game speed is not a key factor.
Regards.



Quote from: reidrac on 19:32, 22 February 22I just tried "inc 3 (ix)" and it works, and "inc CONSTANT (ix)" works too. This is SDCC 4.0.

EDIT: of course, I encourage you to avoid using ix and iy. That's slow!  :laugh:

Powered by SMFPacks Menu Editor Mod