diff --git a/Programs/CosmOS/Source/cosmos.asm b/Programs/CosmOS/Source/cosmos.asm index 4ce700e..9f8ccef 100644 --- a/Programs/CosmOS/Source/cosmos.asm +++ b/Programs/CosmOS/Source/cosmos.asm @@ -1691,18 +1691,9 @@ handlePrintString: handleReadLine: CALL readLine - ; readLine works out how long the line was, and RETI would throw that away: it restores - ; every register from the frame, which is exactly what makes an interrupt safe to arrive - ; unannounced and exactly what stops a service answering. So the answer is written into - ; the frame, over the saved Q, and RETI puts it back as though the caller had computed it. - ; - ; This has to be here rather than in a routine, because the offset is from where the - ; Stack Pointer is now and a CALL moves it by ten. - MVQA - MVSD.1 - DPUP.1 0d02 - STA.1 - RETI + ; readLine works out how long the line was, and it is already in Q where readLine left + ; it. SRET keeps Q and DP3 and puts everything else back, so the answer simply stands. + SRET ; What the program was asked to work on. DP0 says where to put it and B how much room ; there is, counting the zero on the end, which is the same bargain readLine offers.