FreeCalypso > hg > freecalypso-hwlab
diff simtool/select.c @ 89:fb75855a74a9
fc-simtool: select response parsing: show number of records
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 24 Jan 2021 18:03:55 +0000 |
parents | 2a0d1d5b9313 |
children | d4150123ca45 |
line wrap: on
line diff
--- a/simtool/select.c Sun Jan 24 05:09:48 2021 +0000 +++ b/simtool/select.c Sun Jan 24 18:03:55 2021 +0000 @@ -83,6 +83,7 @@ char **argv; { int file_id, rc; + unsigned file_size; if (isxdigit(argv[1][0]) && isxdigit(argv[1][1]) && isxdigit(argv[1][2]) && isxdigit(argv[1][3]) && !argv[1][4]) @@ -127,8 +128,8 @@ break; case 0x04: printf("File type: EF\n"); - printf("File size: %u\n", - (sim_resp_data[2] << 8) | sim_resp_data[3]); + file_size = (sim_resp_data[2] << 8) | sim_resp_data[3]; + printf("File size: %u\n", file_size); switch (sim_resp_data[13]) { case 0x00: printf("Structure: transparent\n"); @@ -146,6 +147,10 @@ return(-1); } printf("Record length: %u\n", sim_resp_data[14]); + curfile_record_len = sim_resp_data[14]; + if (file_size % curfile_record_len == 0) + printf("Number of records: %u\n", + file_size / curfile_record_len); break; default: printf("Structure: %02X (unknown)\n",