static void busPortConnections(void) { rtcWindow = ppmCreateSlaveBusPort("RTC", 0x1000); if (!rtcWindow) { bhmMessage("E", "PPM_SPNC", "Could not connect port 'rtc_window'"); } createRegisters(rtcWindow); }
void main() { //Informs error on code (0 - correct, 1 - error) int fileError = 0; //User choice char choice; //Creates the registers and instructions createRegisters(); createInstructions(); while(1){ //Wait for a correct assembly file while(assemblyChoice() == 0) system("cls"); printf("\n*Press Y to assemble the file or other button to entry with other file*\n"); choice = getch(); if(choice == 'y'){ //Checks the assembly program fileError = checksAssembly(); //If the program not has error if(fileError == 0){ fileError = verifyAndTranslate(); if(fileError == 1){ //Calculates the program memory usage in Bytes float memoryUsageB = ((numberOfData + numberOfInstructions)*4); printf("\nPROGRAM ASSEMBLED\n"); printf("Number of instructions: %d\nNumber of data: %d\nMemory usage: %.4fKB\n", numberOfInstructions, numberOfData, memoryUsageB/1024); writeOnFile(); } } printf("\n*Press any button to entry with other file*\n"); getch(); //Clean all past data cleanCommands(); labels = NULL; numberOfData = 0; numberOfInstructions = 0; fileError = 0; } system("cls"); } }