thamugadi / jit-chip8

Just-in-time compiler for CHIP-8
GNU General Public License v3.0
8 stars 0 forks source link

Potential things you could do #1

Open wheremyfoodat opened 1 year ago

wheremyfoodat commented 1 year ago

Hello. I saw your project on Github and Discord and would like to provide some further feedback to improve the code

wheremyfoodat commented 1 year ago

You also don't need to preserve rax/rcx/rdx most of the time. The calling convention says they're volatile on both MS ABI (Windows) and Sys-V (Linux, Mac, BSD, and everything not Windows).

One of my introduction-to-x86 PDFs in the emudev devnull channel explains this stuff. Of course you should respect the ABI of whatever system you're running on, and the ABIs do have some stack-related requirements that may break if you remove the pushes n pops

thamugadi commented 1 year ago

Thank you very much for the very detailed analysis !! :heart_eyes: This will help me enormously to improve the code :smile: