os_system_config:
cmp rdx, 0
je os_system_config_timecounter
cmp rdx, 1
je os_system_config_argc
cmp rdx, 2
je os_system_config_argv
cmp rdx, 3
je os_system_config_networkcallback_get
cmp rdx, 4
je os_system_config_networkcallback_set
cmp rdx, 5
je os_system_config_clockcallback_get
cmp rdx, 6
je os_system_config_clockcallback_set
cmp rdx, 20
je os_system_config_video_base
cmp rdx, 21
je os_system_config_video_x
cmp rdx, 22
je os_system_config_video_y
cmp rdx, 23
je os_system_config_video_bpp
cmp rdx, 30
je os_system_config_mac
ret
os_system_functions dq os_system_config_timecounter, os_system_config_argc, os_system_config_argv, os_system_config_networkcallback_get, os_system_config_networkcallback_set, os_system_config_clockcallback_get, os_system_config_clockcallback_get, os_system_config_clockcallback_set, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_video_x, os_system_config_video_y, os_system_config_video_bpp, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_no_function, os_system_config_mac
os_system_config:
jmp qword [os_system_functions+rdx*4]
os_system_config_no_function:
ret
And I believe it would be much faster, I also believe this is what GCC does (or at least, something similar) for switch statements.
Instead of doing stuff like:
You could do:
And I believe it would be much faster, I also believe this is what GCC does (or at least, something similar) for switch statements.