ca65 V2.15 - Git a85ac88
Main file   : tools.s65
Current file: tools.s65

000000r 1                           .include "zeropage.inc65"
000000r 2               .globalzp sp
000000r 2               .globalzp sreg
000000r 2               .globalzp regsave
000000r 2               .globalzp regbank
000000r 2               .globalzp tmp1
000000r 2               .globalzp tmp2
000000r 2               .globalzp tmp3
000000r 2               .globalzp tmp4
000000r 2               .globalzp tmpstack
000000r 2               .globalzp ptr1
000000r 2               .globalzp ptr2
000000r 2               .globalzp ptr3
000000r 2               .globalzp ptr4
000000r 2               .globalzp _millis
000000r 2               .globalzp _jiffies
000000r 2               .globalzp _seconds
000000r 2               .globalzp _minutes
000000r 2               .globalzp _hours
000000r 2               .globalzp key_code
000000r 2               .globalzp key_modifiers
000000r 2               .globalzp key_tmp1
000000r 2               .globalzp key_tmp2
000000r 2               .globalzp lcd_enable_bits
000000r 2               .globalzp lcd_cursor
000000r 2               .globalzp lcd_row
000000r 2               .globalzp lcd_column
000000r 2               .globalzp _interrupted
000000r 2               
000000r 1               
000000r 1                           .export _delay_ms
000000r 1               
000000r 1                           .code
000000r 1               
000000r 1                           ;.align 256
000000r 1               
000000r 1                ;void _delay_ms(unsigned char delay)
000000r 1               ; Delay the number of miliseconds specified by A
000000r 1               ; This is hardcoded for a 1 MHz system clock
000000r 1               ; @in A (delay) The delay in ms
000000r 1               ; @mod tmp1
000000r 1  85 rr        _delay_ms:          sta tmp1      ; 3
000002r 1  8A                               txa           ; 2
000003r 1  48                               pha           ; 3
000004r 1  98                               tya           ; 2
000005r 1  48                               pha           ; 3
000006r 1  A6 rr                            ldx tmp1      ; 3
000008r 1               
000008r 1  A0 BE                            ldy #190      ; 2
00000Ar 1  88           @loop1:             dey           ; 190 * 2
00000Br 1  D0 FD                            bne @loop1    ; 190 * 3 - 1
00000Dr 1               
00000Dr 1  CA           @loop2:             dex           ; 2
00000Er 1  F0 09                            beq @return   ; (x - 1) * 2 + 3
000010r 1               
000010r 1  EA                               nop           ; 2
000011r 1  A0 C6                            ldy #198      ; 2
000013r 1  88           @loop3:             dey           ; 198 * 2
000014r 1  D0 FD                            bne @loop3    ; 198 * 3 - 1
000016r 1               
000016r 1  4C rr rr                         jmp @loop2    ; 3
000019r 1               
000019r 1  68           @return:            pla           ; 4
00001Ar 1  A8                               tay           ; 2
00001Br 1  68                               pla           ; 4
00001Cr 1  AA                               tax           ; 2
00001Dr 1  A5 rr                            lda tmp1      ; 3
00001Fr 1  60                               rts           ; 6 (+ 6 for JSR)
000020r 1               
000020r 1               
