Here's a program written in the Marie assembly language that performs the given calculation and stores the result in memory before printing it out on the display:
ORG 100
Load X ; Load the value of X into the AC
Add Y ; Add the value of Y to the AC
Subt Z ; Subtract the value of Z from the AC
Store Result ; Store the result in memory
Output ; Output the result on the display
Halt ; Terminate the program
X, DEC 10
Y, DEC 20
Z, DEC 5
Result, DEC 0
END
Please note that this is a simplified representation of the program using the Marie assembly language syntax. The actual implementation may vary depending on the specific assembler or simulator you are using. Make sure to consult the documentation of the tool you are using to run the program for any adjustments required.