Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Load a BasicML program file into UVSim
Steps:
- Open the UVSim application.
- Select the "Load Program" option.
- Browse and select the BasicML program file from the file system.
- Parse the selected file to read the machine language instructions.
- Load the parsed instructions into the UVSim memory.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Execute a BasicML program and follow instruction sequences
Steps:
- Load a BasicML program into UVSim.
- Set the program counter to the starting address.
- Fetch the instruction from the memory location pointed to by the program counter.
- Decode the fetched instruction to identify the operation and operands.
- Execute the instruction.
- Increment the program counter to point to the next instruction.
- Repeat steps 3-6 until a HALT instruction is encountered.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Display the current state of UVSim memory during program execution
Steps:
- Execute the BasicML program step-by-step or continuously.
- At each step, access the current state of the UVSim memory.
- Format the memory state into a human-readable format.
- Display the formatted memory state on the screen or in a designated area of the UI.
- Update the display after each instruction execution.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Input data from the keyboard into memory using the READ operation (10##)
Steps:
- Fetch the READ instruction (10##) from memory.
- Decode the instruction to identify the target memory address.
- Prompt the user to enter data via the keyboard.
- Read the entered data and validate it.
- Store the validated data into the specified memory address.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Output data from memory to the screen using the WRITE operation (11##)
Steps:
- Fetch the WRITE instruction (11##) from memory.
- Decode the instruction to identify the source memory address.
- Retrieve the data from the specified memory address.
- Format the data for display.
- Output the formatted data to the screen or console.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Transfer data from memory to the accumulator using the LOAD operation (20##)
Steps:
- Fetch the LOAD instruction (20##) from memory.
- Decode the instruction to identify the source memory address.
- Retrieve the data from the specified memory address.
- Copy the retrieved data into the accumulator register.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Transfer data from the accumulator to memory using the STORE operation (21##)
Steps:
- Fetch the STORE instruction (21##) from memory.
- Decode the instruction to identify the target memory address.
- Retrieve the data from the accumulator register.
- Store the retrieved data into the specified memory address.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Perform addition operation using the ADD instruction (30##)
Steps:
- Fetch the ADD instruction (30##) from memory.
- Decode the instruction to identify the source memory address.
- Retrieve the data from the specified memory address.
- Add the retrieved data to the value in the accumulator register.
- Store the result back into the accumulator register.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Perform subtraction operation using the SUBTRACT instruction (31##)
Steps:
- Fetch the SUBTRACT instruction (31##) from memory.
- Decode the instruction to identify the source memory address.
- Retrieve the data from the specified memory address.
- Subtract the retrieved data from the value in the accumulator register.
- Store the result back into the accumulator register.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Perform multiplication operation using the MULTIPLY instruction (33##)
Steps:
- Fetch the MULTIPLY instruction (33##) from memory.
- Decode the instruction to identify the source memory address.
- Retrieve the data from the specified memory address.
- Multiply the retrieved data by the value in the accumulator register.
- Store the result back into the accumulator register.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Perform division operation using the DIVIDE instruction (32##)
Steps:
- Fetch the DIVIDE instruction (32##) from memory.
- Decode the instruction to identify the source memory address.
- Retrieve the data from the specified memory address.
- Divide the value in the accumulator register by the retrieved data.
- Store the result back into the accumulator register.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Execute a branch operation using the BRANCH instruction (40##)
Steps:
- Fetch the BRANCH instruction (40##) from memory.
- Decode the instruction to identify the target memory address.
- Set the program counter to the target memory address.
- Continue program execution from the new program counter location.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Execute a branch if negative operation using the BRANCHNEG instruction (41##)
Steps:
- Fetch the BRANCHNEG instruction (41##) from memory.
- Decode the instruction to identify the target memory address.
- Check if the value in the accumulator register is negative.
- If negative, set the program counter to the target memory address.
- Continue program execution from the new program counter location.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Execute a branch if zero operation using the BRANCHZERO instruction (42##)
Steps:
- Fetch the BRANCHZERO instruction (42##) from memory.
- Decode the instruction to identify the target memory address.
- Check if the value in the accumulator register is zero.
- If zero, set the program counter to the target memory address.
- Continue program execution from the new program counter location.
Actor: Computer Science Student
System: UVSim (simulate machine language programs)
Goal: Halt program execution using the HALT instruction (43##)
Steps:
- Fetch the HALT instruction (43##) from memory.
- Decode the instruction to identify it as a halt command.
- Stop the execution of the BasicML program.
- Display a message indicating the program has halted.
- Optionally, display the final state of the UVSim memory and registers.