bios: fix mem_write address increment

This commit is contained in:
Franck Jullien 2022-01-14 13:11:44 +01:00 committed by Franck Jullien
parent add2746a54
commit 8f1d50525d
1 changed files with 6 additions and 3 deletions

View File

@ -111,13 +111,16 @@ static void mem_write_handler(int nb_params, char **params)
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
switch (size) { switch (size) {
case 1: case 1:
*(uint8_t *)addr++ = value; *(uint8_t *)addr = value;
addr += 1;
break; break;
case 2: case 2:
*(uint16_t *)addr++ = value; *(uint16_t *)addr = value;
addr += 2;
break; break;
case 4: case 4:
*(uint32_t *)addr++ = value; *(uint32_t *)addr = value;
addr += 4;
break; break;
default: default:
printf("Incorrect size"); printf("Incorrect size");