Final answer:
To add the numbers 2, -3, and 6 using machine-language on the Pep/8 simulator, you can use the provided assembly code.
Step-by-step explanation:
To write a machine-language program to add the three numbers 2, -3, and 6 and output the sum on the Pep/8 simulator, you can use the following assembly code:
lda 2 ; Load the first number into the accumulator
add -3 ; Add the second number to the accumulator
add 6 ; Add the third number to the accumulator
out ; Output the sum to the output device
hlt ; Halt the program
After writing the code in a text editor, save it with a .p8 extension, and load it into the Pep/8 simulator. Then, execute the program to see the sum displayed on the output device.
In this program, the 'lda' instruction is used to load a value into the accumulator, 'add' is used to perform addition, 'out' is used to output the result, and 'hlt' is used to halt the program.