Converted GEMDOS from switch-based on table-based