However when I run it using Qemulator it hangs and shows nothing. What's wrong with it?
Code: Select all
include "consts.asm"
ME equ -1
init
bra.s clock ;branch to clock code
ds.b 4 ;and skip along a bit so that
dc.w $4afb ;job flag is in bytes 6 and 7
dc.w 5 ;characters in job name
dc.b 'Clock' ;followed by ASCII characters
even
clock
suba.l a6,a6 ;clear a6 for CN_DATE now
moveq #MT_PRIOR,d0 ;set priority
moveq #ME,d1 ;...of this job
moveq #1,d2 ;...to 1 (the lowest)
trap #1
move.w #UT_SCR,a2 ;open window for clock output
lea scr(PC),a1 ;address of definition
jsr (a2)
move.l a0,a4 ;save channel id
clockLp
moveq #MT_RCLCK,d0 ;read the time into d1
trap #1
lea bufTop(PC),a1 ;use buffer from top down
move.w CN_DATE,a2 ;to convert date into
jsr (a2)
moveq #IO_SSTRG,d0 ;now send the resulting string
move.w (a1)+,d2 ;of 20 characters
moveq #-1,d3 ;...with no timeout
move.l a4,a0 ;to our window
trap #3
moveq #SD_TAB,d0 ;now set the cursor at the
moveq #0,d1 ;...start of the line
trap #3
moveq #MT_SUSJB,d0 ;suspend to reduce IO load
moveq #ME,d1
moveq #5,d3 ;for a 10th of a second
suba.l a1,a1 ;no flag
trap #1
bra.s clockLp
scr
dc.b 0 ;no border
dc.b 0 ;no border colour
dc.b 4 ;green background
dc.b 0 ;black characters
;window definition for monitor mode
dc.w 120 ;pixels wide (20 chr, all 6 wide)
dc.w 10 ;10 pixels high
dc.w 512-120 ;120 pixels from the HRS
dc.w 206 ;and at top of default window #0
buffer
ds.b 22
bufTop
end