NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
50.08k stars 5.74k forks source link

Z80: SCF/CCF - return carry flag #2377

Open lab313ru opened 3 years ago

lab313ru commented 3 years ago

For example:

ram:0502 cd 0e 05        CALL                                       FUN_ram_050e                                     byte FUN_ram_050e(char * param_1)
ram:0505 d8              RET                                        C

FUN_ram_050e: image

Selection of C as the return value storage doesn't help: image

image

image

Seems, I can't specify an exact F register bit as the return result.

esaulenka commented 3 years ago

You should specify F register as return value, not C. Here C is a not carry, its a part of BC register.

Yes, your FUN_050e will look ugly, but I think it cannot be written in C language correctly.