{"action":"created","issue":{"url":"https://api.github.com/repos/uxmal/reko/issues/282","repository_url":"https://api.github.com/repos/uxmal/reko","labels_url":"https://api.github.com/repos/uxmal/reko/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/uxmal/reko/issues/282/comments","events_url":"https://api.github.com/repos/uxmal/reko/issues/282/events","html_url":"https://github.com/uxmal/reko/issues/282","id":168508628,"number":282,"title":"dos x86 int 0x21 and stack operations wrongly decompiled","user":{"login":"xor2003","id":1642627,"avatar_url":"https://avatars.githubusercontent.com/u/1642627?v=3","gravatar_id":"","url":"https://api.github.com/users/xor2003","html_url":"https://github.com/xor2003","followers_url":"https://api.github.com/users/xor2003/followers","following_url":"https://api.github.com/users/xor2003/following{/other_user}","gists_url":"https://api.github.com/users/xor2003/gists{/gist_id}","starred_url":"https://api.github.com/users/xor2003/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xor2003/subscriptions","organizations_url":"https://api.github.com/users/xor2003/orgs","repos_url":"https://api.github.com/users/xor2003/repos","events_url":"https://api.github.com/users/xor2003/events{/privacy}","received_events_url":"https://api.github.com/users/xor2003/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-31T08:52:22Z","updated_at":"2016-07-31T08:56:09Z","closed_at":null,"body":"1. int 0x21 become syscall 0x33\r\n2. ax argument is not indicated in the decompilation.\r\n3. bl is not an argument.\r\n\r\nListing:\r\n  16028\t    7521\t\t\t proc\t\t setmemallocstrat near\t ; CODE\tXREF: deinit_125B9+15\u0018p\r\n  16029\t\t\t\t\t\t\t\t\t\t ; sub_12D35+22\u0018p ...\r\n  16030\t    7521  50\t\t\t\t\t **push\t ax**\r\n  16031\t    7522  0F B6\tD8\t\t\t\t movzx\t bx, **al**\r\n  16032\t    7525  B8 5801\t\t\t\t mov\t ax, 5801h\r\n  16033\t    7528  CD 21\t\t\t\t\t int\t 21h\t\t ; DOS - 3+ - GET/SET MEMORY ALLOCATION\tSTRATEGY\r\n  16034\t\t\t\t\t\t\t\t\t\t ; AL =\tfunction code: set allocation strategy\r\n  16035\t    752A  5B\t\t\t\t\t **pop\t bx**\r\n  16036\t    752B  C1 EB\t08\t\t                 **shr\t bx, 8**\r\n  16037\t    752E  B8 5803\t\t\t\t mov\t ax, 5803h\r\n  16038\t    7531  CD 21\t\t\t\t\t int\t 21h\t\t ; DOS - 3+ - GET/SET MEMORY ALLOCATION\tSTRATEGY\r\n  16039\t\t\t\t\t\t\t\t\t\t ; AL =\tfunction code: (DOS 5beta) set UMB link\tstate\r\n  16040\t    7533  C3\t\t\t\t\t retn\r\n  16041\t    7534\t\t\t endp\t\t setmemallocstrat\r\n\r\nDecompiled to:\r\nbyte setmemallocstrat(word16 ax, byte bl)\r\n// stackDelta: 0; fpuStackDelta: 0; fpuMaxParam: -1\r\n\r\n// MayUse:  ax bl\r\n// LiveOut: al\r\n// Trashed: SCZO ah al ax bh bl bx eax ebx rax rbx\r\n// Preserved: sp\r\nsetmemallocstrat_entry:\r\n// DataOut: ax bl ds ss\r\n// DataOut (flags): \r\n// SymbolicIn: sp:fp\r\n// LocalsOut: fp(16)\r\n\r\nl0800_7521:\r\n\tmsdos_set_memory_allocation_strategy(bl)\r\n\t**__syscall(0x21)**\r\n\treturn 0x03\r\n// DataOut: al ds ss\r\n// DataOut (flags): \r\n// SymbolicIn: sp:fp\r\n\r\nsetmemallocstrat_exit:\r\n// DataOut: al\r\n// DataOut (flags): \r\n// SymbolicIn: sp:fp bx:ax >>u 0x0008 ax:0x5803 -2(fp):ax\r\n\r\nbyte setmemallocstrat(**word16 ax**, **byte bl**)\r\n{\r\n\tmsdos_set_memory_allocation_strategy(bl);\r\n\t**__syscall(33);**\r\n\treturn 0x03;\r\n}\r\n"},"comment":{"url":"https://api.github.com/repos/uxmal/reko/issues/comments/236418997","html_url":"https://github.com/uxmal/reko/issues/282#issuecomment-236418997","issue_url":"https://api.github.com/repos/uxmal/reko/issues/282","id":236418997,"user":{"login":"uxmal","id":10154465,"avatar_url":"https://avatars.githubusercontent.com/u/10154465?v=3","gravatar_id":"","url":"https://api.github.com/users/uxmal","html_url":"https://github.com/uxmal","followers_url":"https://api.github.com/users/uxmal/followers","following_url":"https://api.github.com/users/uxmal/following{/other_user}","gists_url":"https://api.github.com/users/uxmal/gists{/gist_id}","starred_url":"https://api.github.com/users/uxmal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uxmal/subscriptions","organizations_url":"https://api.github.com/users/uxmal/orgs","repos_url":"https://api.github.com/users/uxmal/repos","events_url":"https://api.github.com/users/uxmal/events{/privacy}","received_events_url":"https://api.github.com/users/uxmal/received_events","type":"User","site_admin":false},"created_at":"2016-07-31T08:56:09Z","updated_at":"2016-07-31T08:56:09Z","body":"Wow,  good catch. I guess I have a few things to work on on Tuesday! "}}
{"actor":{"display_login":"uxmal"}}