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
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/