Get system command output: Difference between revisions

m
→‎{{header|68000 Assembly}}: added more comments to explain what's going on
m (→‎{{header|68000 Assembly}}: forgot to close lang)
m (→‎{{header|68000 Assembly}}: added more comments to explain what's going on)
Line 17:
MOVE.L BIOS_HOUR,D0 ;D0 = HHMMSS00
LSR.L #8,D0 ;shift out the zeroes.
MOVE.L frame_timer,D1 ;this value is incremented by 1 every vBlank (i.e. just before this procedure is run)
MOVE.L frame_timer,D1
NOT.L D1 ;flip all the bits of D1
NOT.L D1
MULS D1,D0
MULU D1,D0
MOVE.L JOYPAD1,D1 ;get the most recent button presses.
CloneByte D1 ;copy this byte to all 4 bytes of D1
CloneByte D1
EOR.L D1,D0
MOVE.L RNGout_32,D2 ;look at last time's results.
AND.B #1,D2 ;check if it's odd or even
BNE SwapRNGifEven
SWAP D0 ;if even, swap the low and high words of D0
SWAP D0
SwapRNGifEven:
MOVE.L D0,RNGout_32
1,489

edits