News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Fran123

searching a rom command

Started by Fran123, 07:29, 11 April 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fran123

Hello

I'm trying execute a command from my custom rom.

I have this code:
my_function:
ld hl, cmd_read_sector
call #bcd4 ; <hl=address <c=rom number

...

.cmd_read_sector equ #84


If I execute that from a program in RAM it works (HL=#C030 and C=7=AMSDOS ROM),
but if I execute it from my ROM, HL gets #C045 and C=#10 (empty ROM)

What is wrong?

Thanks

pelrun

HL points at a RAM address, but I bet you're assembling cmd_read_sector to ROM. You'll need to put the command name somewhere in RAM for KL FIND COMMAND to work; the link below suggests a convenient method is to push it onto the stack.

https://www.cpcwiki.eu/forum/programming/kl_find_command-within-a-rom/

Powered by SMFPacks Menu Editor Mod