/* M-E - Memory Execute */ static int fsdevice_flush_me(vdrive_t *vdrive, char *realarg) { unsigned int dnr = vdrive->unit - 8; unsigned int length; WORD addr; addr = fsdevice_dev[dnr].cmdbuf[3] | (fsdevice_dev[dnr].cmdbuf[4] << 8); length = 5 + ((realarg != NULL) ? strlen(realarg) : 0); /* FIXME */ return vdrive_command_memory_exec(vdrive, &fsdevice_dev[dnr].cmdbuf[5], addr, length); }
/* The buffer pointer passed to this function points to the character following '-' in the memory command. The buffer pointer passed to the sub-functions points to the byte after the first argument (address) which is passed separately. */ static int vdrive_command_memory(vdrive_t *vdrive, BYTE *buffer, unsigned int length) { WORD addr; if (length < 5) { return CBMDOS_IPE_SYNTAX; } addr = util_le_buf_to_word(buffer + 1); switch (*buffer) { case 'W': return vdrive_command_memory_write(vdrive, buffer + 3, addr, length); case 'R': return vdrive_command_memory_read(vdrive, buffer + 3, addr, length); case 'E': return vdrive_command_memory_exec(vdrive, NULL, addr, length); default: break; } return CBMDOS_IPE_INVAL; }