Assembly
Assembly
*-----------------------------------------------------------
* Title :
* Written by :
* Date :
* Description:
*-----------------------------------------------------------
ORG $1000
START: LEA MESSAGE,A1 ; load the message into A1
MOVE.B #14,D0
TRAP #15 ; display the message
MOVE #5,D0
TRAP #15 ; read a char from keyboard into D1.B
SUB.B #$73,D1
BNE end ; if the char is not S, it ends the program.
SUB.L D2,D1 ; substract the start time, get the time that has passed.
SWAP D1
AND.L #$0000FFFF,D1 ; swap D1 and clean the LH, only reminder left
MOVE.L D1,D4 ; put the reminder to D4
SWAP D3
AND.L #$0000FFFF,D3 ; swap D3, and set LH to zeros, only sec is left
SUB.B #$A,D5
BEQ end ; if the min, D5, is 10, then program ends
CR EQU $0D
LF EQU $0A
MESSAGE DC.B 'Press s to start the program',CR,LF,0
OUTPUT:-