{"action":"created","issue":{"url":"https://api.github.com/repos/radare/radare2/issues/3607","labels_url":"https://api.github.com/repos/radare/radare2/issues/3607/labels{/name}","comments_url":"https://api.github.com/repos/radare/radare2/issues/3607/comments","events_url":"https://api.github.com/repos/radare/radare2/issues/3607/events","html_url":"https://github.com/radare/radare2/issues/3607","id":113820046,"number":3607,"title":"Issues with ESIL flag computation","user":{"login":"sushant94","id":3993360,"avatar_url":"https://avatars.githubusercontent.com/u/3993360?v=3","gravatar_id":"","url":"https://api.github.com/users/sushant94","html_url":"https://github.com/sushant94","followers_url":"https://api.github.com/users/sushant94/followers","following_url":"https://api.github.com/users/sushant94/following{/other_user}","gists_url":"https://api.github.com/users/sushant94/gists{/gist_id}","starred_url":"https://api.github.com/users/sushant94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushant94/subscriptions","organizations_url":"https://api.github.com/users/sushant94/orgs","repos_url":"https://api.github.com/users/sushant94/repos","events_url":"https://api.github.com/users/sushant94/events{/privacy}","received_events_url":"https://api.github.com/users/sushant94/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-28T13:23:12Z","updated_at":"2015-10-28T22:01:47Z","closed_at":null,"body":"There are some issues when esil computes flags. This bug is to consolidate these and work towards a fix.\r\n\r\n- [x] Carry flag for subtraction is set using `$c,cf,=` rather than using `$b,cf,=`\r\n- [ ] Overflow flag is not computed correctly (for subtraction)\r\n- [ ] ESIL never sets Adjust Flag (AF)\r\n- [x] x86 add (`+=`) does not set flags.\r\n- [x] x86 sub  does not set `pf`\r\n- [x] Parity flag is not computed correctly.\r\n\r\nI'm working towards a fix (and respective tests). Will update this issue when I find more bugs.\r\n\r\n__EDIT:__ Checked the ones that I fixed"},"comment":{"url":"https://api.github.com/repos/radare/radare2/issues/comments/152010250","html_url":"https://github.com/radare/radare2/issues/3607#issuecomment-152010250","issue_url":"https://api.github.com/repos/radare/radare2/issues/3607","id":152010250,"user":{"login":"sushant94","id":3993360,"avatar_url":"https://avatars.githubusercontent.com/u/3993360?v=3","gravatar_id":"","url":"https://api.github.com/users/sushant94","html_url":"https://github.com/sushant94","followers_url":"https://api.github.com/users/sushant94/followers","following_url":"https://api.github.com/users/sushant94/following{/other_user}","gists_url":"https://api.github.com/users/sushant94/gists{/gist_id}","starred_url":"https://api.github.com/users/sushant94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushant94/subscriptions","organizations_url":"https://api.github.com/users/sushant94/orgs","repos_url":"https://api.github.com/users/sushant94/repos","events_url":"https://api.github.com/users/sushant94/events{/privacy}","received_events_url":"https://api.github.com/users/sushant94/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T22:01:47Z","updated_at":"2015-10-28T22:01:47Z","body":"@condret\r\nWhy do you say just `$b` dies not work? Cause this seems to be working. Then again, I might be wrong and it might have just worked for this case.\r\n\r\n I don't know about gb, but for x86, the carry flag is not defined if the number of bits shifted out is more than the width of the destination. I'm not sure on how to account for this.\r\n\r\nAnd I don't know where `>>>` and `<<<` are used and who introduced it. It __could__ be used here but we need to find a way around for RCL/RCR."}}