Hello!

> I need to obtain the PC address (one of the commands that I want to have is
> dump the registers). My problem is that I can not see a way to obtain
the PC,
> I can set it using HL but I do not have a way to obtain its value. There
is a
> way to do so

Usually a programmer knows the address where he loads some code, anyway
you can "call loadhlpc" to obtain "ld  hl, pc", the function follows:

loadhlpc:
        pop   hl
        push  hl
        ret

All calls (and interrupt) put the PC on the stack...

Cheers,
Marco

-- 
http://bodrato.it/


------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to