Пример #1
0
int handleInterrupt21(int ax, int bx, int cx, int dx){
	if(ax == 0x00){
		return print(bx);
	} else if (ax == 0x11){
		bx = readChar();
		return 1;
	}else if (ax == 0x01){
		return readString(bx);
	}else if(ax == 0x03){
		return readfile(bx,cx);
	}else if(ax == 0x04){
		dx = executeProgram(bx);
		return dx;
	}else if(ax == 0x05){
		terminate();
		return 1;
	} else if (ax == 0x07){
		return deleteFile(bx);
	}else if (ax == 0x08){
		return writeFile(bx, cx, dx);
	}else if (ax == 0x09){
		yield();
		return 1;
	}else if(ax == 0x0A){
		showProcesses();
		return 1;
	}else if(ax == 0x0B){
		return kill(atoi(bx));
	}else{
		print("Quit Interrupting\0");
		return -1;
	}
}
Пример #2
0
//The handelInterrupt21 function
int handleInterrupt21(int ax, int bx, int cx, int dx){
    if (ax == 0x00) {
        printString(bx);
        return 1;
    }
    else if(ax == 0x11){
        ((char*)bx)[0] = readChar();
        return 1;
    }
    else if(ax == 0x01){
        readString(bx);
        return 1;
    }
    else if(ax == 0x02){
        readSector(bx,cx);
    }
    else if(ax == 0x03){
        readfile(bx,cx);
    }
    else if(ax == 0x04){
        executeProgram(bx);
    }
    else if(ax == 0x05){
        terminate();
    }
    else if(ax == 0x07){
        deleteFile(bx);
    }
    else if(ax == 0x08){
        writeFile(bx,cx,dx);
    }
    else if(ax == 0x09){
        yield();
        return 1;
    }
    else if(ax == 0x0A){
        showProcesses();
        return 1;
    }
    else if(ax == 0x0B){
        kill(bx);
    }
    else{
        return -1;
    }
    
}