]> git.sur5r.net Git - cc65/blob - libsrc/conio/cputhex.s
clrscr.s switch to text mode
[cc65] / libsrc / conio / cputhex.s
1 ;
2 ; Ullrich von Bassewitz, 08.08.1998
3 ;
4 ; void cputhex8 (unsigned char val);
5 ; void cputhex16 (unsigned val);
6 ;
7
8         .export         _cputhex8, _cputhex16
9         .import         _cputc
10         .import         __hextab
11
12
13 _cputhex16:
14         pha                     ; Save low byte
15         txa                     ; Get high byte into A
16         jsr     _cputhex8       ; Output high byte
17         pla                     ; Restore low byte and run into _cputhex8
18
19 _cputhex8:
20         pha                     ; Save the value
21         lsr     a
22         lsr     a
23         lsr     a
24         lsr     a
25         tay
26         lda     __hextab,y
27         jsr     _cputc
28         pla
29         and     #$0F
30         tay
31         lda     __hextab,y
32         jmp     _cputc
33
34
35
36
37
38
39