cdq == Convert Doubleword to Quadword sub == Subtract
어차피 sar 쓸거면 부호확장은 필요없는거같은데..
어셈 잘 모르긴 하지만 unsigned에다가 최적화 플래그 걸면 같게 나오지 않을까
unsigned 하면 같게나오네여
둘다 똑같이 sar 쓰는거임. cdq 는 메모리에서 불러올때 한번만 해서 그런것 같고
개소리구나;; ㅈㅅ
부호비트 있으면 결과 다름
음수 반올림때문이네요 이해했습니다 다들 ㄱㅅㄱㅅ
혹시 더 궁금하신 분들 있을까바 링크 냄겨여https://stackoverflow.com/questions/62246863/why-is-2-different-from-1-for-signed-integers-and-compiles-to-different-as/62246970?noredirect=1#comment110089108_62246970cdq;부호확장(edx=eax>0?0 :-1) sub;음수면1더하고나눔 반올림땜시(eax-=edx)
cdq == Convert Doubleword to Quadword sub == Subtract
어차피 sar 쓸거면 부호확장은 필요없는거같은데..
어셈 잘 모르긴 하지만 unsigned에다가 최적화 플래그 걸면 같게 나오지 않을까
unsigned 하면 같게나오네여
둘다 똑같이 sar 쓰는거임. cdq 는 메모리에서 불러올때 한번만 해서 그런것 같고
개소리구나;; ㅈㅅ
부호비트 있으면 결과 다름
음수 반올림때문이네요 이해했습니다 다들 ㄱㅅㄱㅅ
혹시 더 궁금하신 분들 있을까바 링크 냄겨여
https://stackoverflow.com/questions/62246863/why-is-2-different-from-1-for-signed-integers-and-compiles-to-different-as/62246970?noredirect=1#comment110089108_62246970
cdq;부호확장(edx=eax>0?0 :-1) sub;음수면1더하고나눔 반올림땜시(eax-=edx)