!cpu 6510 ; ============================================================================== save_num = 0x02 CHAROUT = 0xF1CA ; ============================================================================== *= 0x0801 ; basic TI$ timer wrapper program: ; -------------------------------- ; 0 TI$="000000":SYS2092 ; 1 PRINT"TIME:"TI/60 ; -------------------------------- ; RESULT: 8.91666667 !byte 0x18, 0x08, 0x00, 0x00 !byte 0x54, 0x49, 0x24, 0xB2 !byte 0x22, 0x30, 0x30, 0x30 !byte 0x30, 0x30, 0x30, 0x22 !byte 0x3A, 0x9E, 0x32, 0x30 !byte 0x39, 0x32, 0x00, 0x2A !byte 0x08, 0x01, 0x00, 0x99 !byte 0x22, 0x54, 0x49, 0x4D !byte 0x45, 0x3A, 0x22, 0x54 !byte 0x49, 0xAD, 0x36, 0x30 !byte 0x00, 0x00, 0x00 ; ============================================================================== *= 0x082C ldy #0 -- sty save_num ldx #0 - clc rol save_num bcc + lda #'1' !byte 0x2C + lda #'0' jsr CHAROUT inx cpx #8 bne - lda #0x0D jsr CHAROUT iny bne -- rts
!cpu 6510 ; ============================================================================== save_num = 0x02 CHAROUT = 0xF1CA ; ============================================================================== *= 0x0801 ; basic TI$ timer wrapper program: ; -------------------------------- ; 0 TI$="000000":SYS2092 ; 1 PRINT"TIME:"TI/60 ; -------------------------------- ; RESULT: 8.9 !byte 0x18, 0x08, 0x00, 0x00 !byte 0x54, 0x49, 0x24, 0xB2 !byte 0x22, 0x30, 0x30, 0x30 !byte 0x30, 0x30, 0x30, 0x22 !byte 0x3A, 0x9E, 0x32, 0x30 !byte 0x39, 0x32, 0x00, 0x2A !byte 0x08, 0x01, 0x00, 0x99 !byte 0x22, 0x54, 0x49, 0x4D !byte 0x45, 0x3A, 0x22, 0x54 !byte 0x49, 0xAD, 0x36, 0x30 !byte 0x00, 0x00, 0x00 ; ============================================================================== *= 0x082C !for i, 0, 255 { lda #i sta save_num !for j, 0, 7 { clc rol save_num bcc + lda #'1' !byte 0x2C + lda #'0' jsr CHAROUT } lda #0x0D jsr CHAROUT } rts
!cpu 6510 ; ============================================================================== save_num = 0x02 CHAROUT = 0xF1CA ; ============================================================================== *= 0x0801 ; basic TI$ timer wrapper program: ; -------------------------------- ; 0 TI$="000000":SYS2092 ; 1 PRINT"TIME:"TI/60 ; -------------------------------- ; RESULT: 8.88333334 !byte 0x18, 0x08, 0x00, 0x00 !byte 0x54, 0x49, 0x24, 0xB2 !byte 0x22, 0x30, 0x30, 0x30 !byte 0x30, 0x30, 0x30, 0x22 !byte 0x3A, 0x9E, 0x32, 0x30 !byte 0x39, 0x32, 0x00, 0x2A !byte 0x08, 0x01, 0x00, 0x99 !byte 0x22, 0x54, 0x49, 0x4D !byte 0x45, 0x3A, 0x22, 0x54 !byte 0x49, 0xAD, 0x36, 0x30 !byte 0x00, 0x00, 0x00 ; ============================================================================== *= 0x082C !for i, 0, 255 { lda #i sta save_num !for j, 0, 7 { asl save_num bcc + lda #'1' !byte 0x2C + lda #'0' jsr CHAROUT } lda #0x0D jsr CHAROUT } rts
If you're using Vice use the monitor command "stopwatch" (or "sw") to reset and display the stopwatch. Can be used at the start of the run command until it returns by adding a couple of break points. Also remember to SEI early to avoid the regular IRQ.