;video.asm ; ;neil barnes / nailed_barnacle 2003 ; ;Timing and sync code ideas are taken from Alberto Ricci Bitti's code ;for the AT1200 ; ;this is intended to run on the AVRMega8 at 16MHz .include "m8def.inc" ;*************************************************************************** ;* most variables live in the registers full time ;*************************************************************************** .CSEG ;r1 and r0 are needed by multiply .def SaveStatus = r2 ;status buffer during interrupts .def VSync = r3 ;true if we're on line 0,1,2 .def LineLo = r4 ;video line currently being output .def LineHi = r5 ;(counts to 312) .def VCell = r6 ;which vertical cell position .def VCount = r7 ;position within vertical cell .def LineLongLo = r8 ;counts to 15625 in one second .def LineLongHi = r9 ; .def Hours = r10 ;time - written by interrupt, read by .def Minutes = r11 ;main loop .def Seconds = r12 .def OldMins = r13 ;need to check when to update display .def Oldhours = r14 .def twelve = r15 ;set for 12 hour, clear for 24 .def IntCount = r16 ;which interrupt are we on? ;common data space used under interrupt .def Arg1 = r18 ;Temp variable used by interrupt .def Arg2 = r19 ; " " " " .def Arg3 = r20 ; " " " " .def Arg4 = r21 ; " " " " ;common data space used by main program .def Main1 = r22 ;Temp variable used by main program .def Main2 = r23 ; " " " " " .def Main3 = r24 ; " " " " " .def Main4 = r25 ; " " " " " ;*************************************************************************** ;* Port Pin Assignements ;*************************************************************************** ;port D bit definitions (OUTPUTS) .equ CSyncBit = 0 ;set video output to composite sync level when low .equ VideoBit1 = 1 ;set video level to white when high, black when low .equ VideoBit2 = 2 .equ VideoBit3 = 3 .equ VideoBit4 = 4 ;port B bit definitions (INPUTS) ;general equates .equ VOffset = 15 ;change this to move the start of picture up/down ;*************************************************************************** ;* Interrupt vectors ;*************************************************************************** .org 0 rjmp RESET ;reset rjmp RESET ;external int 0 rjmp RESET ;external int 1 rjmp RESET ;timer 2 compare rjmp RESET ;timer 2 overflow rjmp RESET ;timer 1 capture rjmp RESET ;timer 1 compare a rjmp RESET ;timer 1 compare b rjmp RESET ;timer 1 overflow rjmp TIMER ;timer 0 overflow rjmp RESET ;serial xfer complete rjmp RESET ;usart rx complete rjmp RESET ;usart data register empty rjmp RESET ;usart tx complete rjmp RESET ;adc conversion complete rjmp RESET ;eeprom ready rjmp RESET ;analogue comparator rjmp RESET ;two-wire serial rjmp RESET ;store program memory ready ;*************************************************************************** ;* ;* MAIN PROGRAM ;* ;*************************************************************************** ;* INITAILIZATION ;*************************************************************************** RESET: set ;set T bit flag ;VERY important: ;used to indicate that the next interrupt ;will be a line sync ldi Arg1, 0b01111111 ;set port D bits to outputs out DDRD, Arg1 ldi Arg1, 0b00000001 ;preset output state out PortD, Arg1 ldi Arg1, 0b00000000 ;set port B to inputs out DDRB, Arg1 ldi Arg1, 0b11111111 ;turn on pullups on inputs out PortB, Arg1 ldi Arg1, 1 out TCCR0, Arg1 ;dont'use timer prescaler ldi Arg1, $80 out MCUCR, Arg1 ;enable sleep idle mode ldi Arg1, 1 ;M8 uses bit 1 to out TIMSK, Arg1 ;enable timer interrupt clr IntCount ;first interrupt clr LineLo clr LineHi ;first line ldi Arg1,-VOffset ;we start so that VCell zeros when mov VCell,Arg1 ;the picture starts clr VCount clr LineLongLo clr LineLongHi clr VSync ;start with a field sync ;we need to set the stack pointer to top of ram ldi Arg1,$04 out SPH, Arg1 ldi Arg1,$5f out SPL, Arg1 ;top of ram is $045f clr Hours clr Minutes clr Seconds clr OldMins clr OldHours clr twelve ;twelve hour node? inc twelve ;nah... sei ;at last, allow interrupts sleep ;goodnight... ;*************************************************************************** ;* MAIN LOOP ;*************************************************************************** ldi main2,0 rcall clearscreen ldi main2,1 rcall clearscreen ldi main2,2 rcall clearscreen ldi main2,3 rcall clearscreen FOREVER: ; in here will be the main loop which examines switches, ; updates time, and writes the time to the video memory rjmp FOREVER ;loop forever ;**************************************************************************** ;* Subroutines ;**************************************************************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; void ClearScreen (int screen) ; ; inputs: main2 = screen to erase ; ; outputs: none ; ; comments: not reentrant - do not use in interrupt routine ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; clearscreen: ldi r31, high (screen0) ldi r30,low (screen0) ;point to screen start add r30,main2 ldi main2,0 ;add offset to required screen adc r31,main2 ldi main1,4 ldi main3,192 ;number of bytes in a screen cs_0: st Z,main2 ;clear the byte add r30,main1 adc r31,main2 ;add four dec main3 brne cs_0 ;loop till done ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; void ShowDigit (int digit, int screen) ; ; inputs: main1 = digit to display ; main2 = screen on which to show it ; ; outputs: none ; ; comments: not reentrant - do not use in interrupt routine ; copies the desired digit from program rom to screen ram ; in one go so no need to erase screen first ; each screen has 192 bytes ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; showdigit: ;make z as pointer to read image from ldi main3,192 mul main1,main3 ;leaves an offset to the digit in r0,r1 ldi r31,high(digit<<1) ldi r30,low(digit<<1) add r30,r0 adc r31,r1 ;add offset to start of digit ;and make y as pointer to write it ldi r29,high(screen0) ldi r28,low(screen0) add r28,main2 ;offsets to appropriate screen ldi main3,4 clr main4 ;update for each y step ldi main2,192 ;number of bytes to move sd_0: lpm main1,Z+ ;get a byte st Y,main1 ;write it add r28,main3 adc r29,main4 ;point to next write address dec main2 brne sd_0 ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; void ShowTime (void) ; ; inputs: none ; ; outputs: none ; ; comments: not reentrant - do not use in interrupt routine ; writes all four screens at once - so only call ; if there is a change to one of them ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;**************************************************************************** ;* ;* Timer Interrupt: occurs four times in each video line. ;* ;* The video is displayed as a pixel display - 32 pixels across, ;* 48 pixels down ;* Each pixel is four lines high and 1.0uS wide ;* The display starts at 24uS and fifteen pixels down ;* ;* Each count has a different requirement ;* On int 0 we generate a sync pulse and go to sleep till int 1 ;* On int 1 we delay 8uS and then start the output of the display, which ;* inhibits int 2 until we've finished at 40uS ;* On int 2 we return to give the background program some time ;* On int 3 we increment line counts and go to sleep until int 0 ;* ;**************************************************************************** ; start with a macro to dump stuff to the output pins .macro squirt ; we output the high bit from each of four registers ; and shift the registers so the next bit is available ldi Arg1,1 ;the sync needs to be high, all others low lsl @0 ;bit into carry brcc PC+2 ;zero? yes sbr Arg1,VideoBit1 ;set bit lsl @1 brcc PC+2 sbr Arg1,VideoBit2 lsl @2 brcc PC+2 sbr Arg1,VideoBit3 lsl @3 brcc PC+2 sbr Arg1,VideoBit4 out PortD,Arg1 ;output the bit pattern nop nop ;make the whole output last 1uS .endmacro TIMER: ;if we were sleeping, then this is a synchronizing cycle: ;either the sync pulse is coming along or we've just done it in Arg1,sreg ;save flags push Arg1 inc IntCount ;increment the interrupt counter cpi IntCount,1 breq INT_COUNT_0 ;if count was 0, do sync stuff cpi IntCount,2 brne PC+2 rjmp INT_COUNT_1 ;if was 1, start of video display cpi IntCount,3 brne PC+2 rjmp INT_COUNT_2 ;if was 2, return or was faked clr IntCount ;reset the counter rjmp INT_COUNT_3 ;default = 3 INT_COUNT_0: ; when awakened, we will restart here ; generate the field pulse if necessary ; being lazy we will just drop three lines ; so field pulse = 3 lines + 4.7uS ; who needs equalising pulses anyway? ; note that we do not *want* to generate a real ; 625 line two field frame to avoid vertical flicker ; we generate a 624 line frame of two 312 line ; identical fields ; of course this means we can't count frames to get seconds ; we have to count lines... in Arg1, PortD ;get port for action andi Arg1, 0xfe ;bit 1 is low for sync out PortD, Arg1 ;now we are in the horizontal sync pulse ;but if we find vsync = 0 then we keep the ;pin low to make a field pulse tst VSync breq IC_0_02 ;return if field pulse ldi Arg4,23 IC_0_01: ;delay loop dec Arg4 brne IC_0_01 nop nop ori Arg1,1 ;raise the sync pulse out PortD, Arg1 ;4.7uS later... ; now we've got eleven microseconds or so to fill ; we need to be in sleep mode when interrupt 1 comes along ; however this is only necessary when we have a line to draw ; we have 48 rows of 4 lines each to display so there are only ; 192 active lines of 312 lines, so we might be able to return ; some time to the main prog here ; if VCell is less than 48, we're displaying things ; otherwise, we're not... ldi Arg1,48 cp VCell,Arg1 brge IC_0_02 sei ;reenable interrupts sleep ;and go bye bye IC_0_02: pop Arg1 out sreg,Arg1 reti ;give the main prog some time INT_COUNT_3: ; this is where we do necessary housekeeping which must be done ; each line. afterwards we go to sleep to make sure we have a constant ; time for the interrupt response which will generate the sync pulse ; we also set the vsync flag to simplify timing constraints in the hsync ; code ldi Arg1,3 inc VCount ;which line on the cell are we in? and VCount,Arg1 ;sneaky sneaky... brne IC_3_06 inc VCell ldi Arg2,78 ;there are 78 cells, we display 48 of them cp VCell,Arg2 brne IC_3_06 clr VCell ;so zero at the start of image IC_3_06: inc LineLo brne IC_3_01 inc LineHi ;increase line count IC_3_01: cp LineLo,Arg1 ;have we got to line three yet? brlo IC_3_05 ;nope, skip andi Arg1,1 mov VSync,Arg1 ;otherwise vsync = 1 IC_3_05: ldi Arg1,LOW(312) ldi Arg2,HIGH(312) ;see if we've got to 312 yet cp LineLo,Arg1 brne IC_3_02 ;no, skip cp LineHi,Arg2 brne IC_3_02 ;no, skip clr LineLo clr LineHi ;else zero line counter clr VSync ;vsync = 0 IC_3_02: inc LineLongLo brne IC_3_03 inc LineLongHi ;increment the long line counter ;when this gets to 15625 ;we can't count 50 frames because we lose 64uS ;every frame IC_3_03: ldi Arg1,LOW(15625) ldi Arg2,HIGH(15625) cp LineLongHi,Arg2 brne IC_3_04 cp LineLongLo,Arg1 brne IC_3_04 clr LineLongLo clr LineLongHi ; do the timekeeping seconds update here ; remembering that we must finish worst case in ; less than 16uS ldi Arg1,60 inc Seconds ;update seconds cp Seconds,Arg1 brne IC_3_04 clr Seconds inc Minutes ;update minutes cp Minutes,Arg1 brne IC_3_04 clr Minutes ldi Arg1,24 ;update hours cp Hours,Arg1 brne IC_3_04 clr Hours ;midnight :) IC_3_04: ;we go to sleep until int 0 clr IntCount ;reset to int 0 set ;set T flag to say next int is sync pulse sei ;re-enable interrupts, otherwise we sleep forever! sleep ;wait sleeping the next timer interrupt pop Arg1 out sreg,Arg1 reti ;then we return from int 3 *after* int 0! INT_COUNT_2: ;we don't do anything interesting here ;it's just a timekeeper pop Arg1 out sreg,Arg1 reti ;in fact, if we're on an active line, we don't ;even get the interrupt and have to fake it INT_COUNT_1: ;now we will display some data :) ;data starts at SCREEN0, sixteen bytes define ;each line for all four screens ldi Arg1,48 cp VCell,Arg1 ;are we on an active line? brlo IC_1_02 ;nope, exit pop Arg1 out sreg,Arg1 reti IC_1_02: ;otherwise, we need to get the appropriate data ;into registers for fast access mov Arg1,VCell ;we mustn't kill VCell ldi Arg2,16 mul Arg1,Arg2 ;multiply by 16 to give offset to screen memory push r30 push r31 ldi r30,low(screen0) ldi r31,high(screen0) add r30,r0 adc r31,r1 ;now we should be pointing at the right place ;now it gets hairy ;the next 128 outs have to all take the same time ;and we have to get the four bits out each uS ; ;easiest if all the data is in the registers ;so start by emptying them push r0 push r1 push r2 push r3 push r4 push r5 push r6 push r7 push r8 push r9 push r10 push r11 push r12 push r13 push r14 push r15 ;/me wipes forehead ;now load the data from the Z pointer addressed memory ld r0,Z+ ;vid 1 data in r0,4,8,12, vid 2 in r1,5 etc ld r1,Z+ ld r2,Z+ ld r3,Z+ ld r4,Z+ ld r5,Z+ ld r6,Z+ ld r7,Z+ ld r8,Z+ ld r9,Z+ ld r10,Z+ ld r11,Z+ ld r12,Z+ ld r13,Z+ ld r14,Z+ ld r15,Z+ ;thump each bit in turn into arg1 ;we do this once for each bit in the first bytes squirt r0,r1,r2,r3 squirt r0,r1,r2,r3 squirt r0,r1,r2,r3 squirt r0,r1,r2,r3 squirt r0,r1,r2,r3 squirt r0,r1,r2,r3 squirt r0,r1,r2,r3 squirt r0,r1,r2,r3 squirt r4,r5,r6,r7 squirt r4,r5,r6,r7 squirt r4,r5,r6,r7 squirt r4,r5,r6,r7 squirt r4,r5,r6,r7 squirt r4,r5,r6,r7 squirt r4,r5,r6,r7 squirt r4,r5,r6,r7 squirt r8,r9,r10,r11 squirt r8,r9,r10,r11 squirt r8,r9,r10,r11 squirt r8,r9,r10,r11 squirt r8,r9,r10,r11 squirt r8,r9,r10,r11 squirt r8,r9,r10,r11 squirt r8,r9,r10,r11 squirt r12,r13,r14,r15 squirt r12,r13,r14,r15 squirt r12,r13,r14,r15 squirt r12,r13,r14,r15 squirt r12,r13,r14,r15 squirt r12,r13,r14,r15 squirt r12,r13,r14,r15 squirt r12,r13,r14,r15 ; a minor problem - the above typing takes 32uS ; which means that the timer has overflowed twice while we were busy ; we didn't get the interrupt as we were busy but we'll get one ; when we return... but we'll lose one, which will make the line ; 80uS long, which is not good. ; however, the next one due is interrupt two, which just returns ; if we tell the world it's already happened, we should get things ; back in sync inc IntCount ;pretend interrupt has happened ;restore the registers from the stack pop r15 pop r14 pop r13 pop r12 pop r11 pop r10 pop r9 pop r8 pop r7 pop r6 pop r5 pop r4 pop r3 pop r2 pop r1 pop r0 ;wheee, all done, now return pop r31 pop r30 ;int 2 is probably all queued up and waiting IC_1_01: pop Arg1 out sreg,Arg1 reti ; here is a place for each video screen ; this is written during background programming ; and read by the screen interrupt ; these four screens are all in the ram ; ; it looks complicated but each screen is interlaced ; so SCREEN0[0] has first byte of screen 0, ; SCREEEN[1] has first byte of screen 1, ; SCREEEN[2] has first byte of screen 2, ; SCREEEN[3] has first byte of screen 3, ; ; this is so that displaying it works quickly ; the lowest bit of the byte represents the leftmost bit ; of the displayed character ; ; admittedly, plotting points might be a bit slower... .dseg SCREEN0: .byte 192*4 ; the digit data ; ; font is MS Ariel .cseg digit: digit0: .db 0b00000000,0b00001111,0b11110000,0b00000000 .db 0b00000000,0b01111111,0b11111110,0b00000000 .db 0b00000000,0b11111111,0b11111111,0b00000000 .db 0b00000011,0b11111111,0b11111111,0b11000000 .db 0b00000011,0b11111111,0b11111111,0b11100000 .db 0b00000111,0b11111000,0b00011111,0b11100000 .db 0b00001111,0b11100000,0b00000111,0b11110000 .db 0b00001111,0b11000000,0b00000011,0b11110000 .db 0b00011111,0b10000000,0b00000011,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b00111110,0b00000000,0b00000000,0b01111110 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b11000000,0b00000011,0b11111000 .db 0b00001111,0b11000000,0b00000011,0b11110000 .db 0b00001111,0b11100000,0b00001111,0b11110000 .db 0b00000111,0b11111000,0b00011111,0b11100000 .db 0b00000111,0b11111111,0b11111111,0b11000000 .db 0b00000011,0b11111111,0b11111111,0b11000000 .db 0b00000001,0b11111111,0b11111111,0b00000000 .db 0b00000000,0b01111111,0b11111110,0b00000000 .db 0b00000000,0b00001111,0b11110000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit1: .db 0b00000000,0b00000000,0b00000000,0b00000000 .db 0b00000000,0b00000000,0b11110000,0b00000000 .db 0b00000000,0b00000001,0b11110000,0b00000000 .db 0b00000000,0b00000001,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000111,0b11110000,0b00000000 .db 0b00000000,0b00001111,0b11110000,0b00000000 .db 0b00000000,0b00011111,0b11110000,0b00000000 .db 0b00000000,0b00111111,0b11110000,0b00000000 .db 0b00000000,0b11111111,0b11110000,0b00000000 .db 0b00000001,0b11111111,0b11110000,0b00000000 .db 0b00000111,0b11111111,0b11110000,0b00000000 .db 0b00011111,0b11110011,0b11110000,0b00000000 .db 0b00011111,0b11100011,0b11110000,0b00000000 .db 0b00011111,0b11000011,0b11110000,0b00000000 .db 0b00011111,0b00000011,0b11110000,0b00000000 .db 0b00011100,0b00000011,0b11110000,0b00000000 .db 0b00010000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit2: .db 0b00000000,0b00000000,0b00000000,0b00000000 .db 0b00000000,0b00001111,0b11111000,0b00000000 .db 0b00000000,0b01111111,0b11111111,0b00000000 .db 0b00000000,0b11111111,0b11111111,0b11000000 .db 0b00000011,0b11111111,0b11111111,0b11100000 .db 0b00000111,0b11111111,0b11111111,0b11110000 .db 0b00001111,0b11111000,0b00001111,0b11111000 .db 0b00001111,0b11100000,0b00000011,0b11111000 .db 0b00011111,0b11000000,0b00000001,0b11111100 .db 0b00011111,0b10000000,0b00000000,0b11111100 .db 0b00011111,0b10000000,0b00000000,0b11111110 .db 0b00111111,0b10000000,0b00000000,0b01111110 .db 0b00111111,0b00000000,0b00000000,0b01111110 .db 0b00111111,0b00000000,0b00000000,0b01111110 .db 0b00000111,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b11111110 .db 0b00000000,0b00000000,0b00000000,0b11111100 .db 0b00000000,0b00000000,0b00000001,0b11111100 .db 0b00000000,0b00000000,0b00000001,0b11111100 .db 0b00000000,0b00000000,0b00000011,0b11111000 .db 0b00000000,0b00000000,0b00000111,0b11110000 .db 0b00000000,0b00000000,0b00001111,0b11110000 .db 0b00000000,0b00000000,0b00011111,0b11100000 .db 0b00000000,0b00000000,0b00111111,0b11000000 .db 0b00000000,0b00000000,0b01111111,0b10000000 .db 0b00000000,0b00000000,0b11111111,0b00000000 .db 0b00000000,0b00000001,0b11111110,0b00000000 .db 0b00000000,0b00000011,0b11111100,0b00000000 .db 0b00000000,0b00000111,0b11111000,0b00000000 .db 0b00000000,0b00011111,0b11110000,0b00000000 .db 0b00000000,0b00111111,0b11100000,0b00000000 .db 0b00000000,0b01111111,0b11000000,0b00000000 .db 0b00000000,0b11111111,0b00000000,0b00000000 .db 0b00000001,0b11111110,0b00000000,0b00000000 .db 0b00000011,0b11111100,0b00000000,0b00000000 .db 0b00000111,0b11111000,0b00000000,0b00000000 .db 0b00001111,0b11110000,0b00000000,0b00000000 .db 0b00001111,0b11100000,0b00000000,0b00000000 .db 0b00011111,0b11000000,0b00000000,0b00000000 .db 0b00011111,0b10000000,0b00000000,0b00000000 .db 0b00111111,0b11111111,0b11111111,0b11111110 .db 0b00111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit3: .db 0b00000000,0b00011111,0b11100000,0b00000000 .db 0b00000000,0b11111111,0b11111100,0b00000000 .db 0b00000001,0b11111111,0b11111111,0b00000000 .db 0b00000111,0b11111111,0b11111111,0b10000000 .db 0b00001111,0b11111111,0b11111111,0b11000000 .db 0b00001111,0b11110000,0b00111111,0b11100000 .db 0b00011111,0b11000000,0b00001111,0b11110000 .db 0b00111111,0b10000000,0b00000111,0b11110000 .db 0b00111111,0b10000000,0b00000011,0b11111000 .db 0b00111111,0b00000000,0b00000001,0b11111000 .db 0b01111111,0b00000000,0b00000001,0b11111000 .db 0b01111110,0b00000000,0b00000001,0b11111000 .db 0b00001110,0b00000000,0b00000001,0b11111000 .db 0b00000000,0b00000000,0b00000001,0b11111000 .db 0b00000000,0b00000000,0b00000001,0b11111000 .db 0b00000000,0b00000000,0b00000011,0b11110000 .db 0b00000000,0b00000000,0b00000111,0b11110000 .db 0b00000000,0b00000000,0b00001111,0b11100000 .db 0b00000000,0b00000000,0b00111111,0b11000000 .db 0b00000000,0b00000111,0b11111111,0b10000000 .db 0b00000000,0b00000111,0b11111110,0b00000000 .db 0b00000000,0b00000111,0b11111111,0b10000000 .db 0b00000000,0b00000111,0b11111111,0b11100000 .db 0b00000000,0b00001110,0b00111111,0b11110000 .db 0b00000000,0b00000000,0b00000111,0b11111000 .db 0b00000000,0b00000000,0b00000011,0b11111000 .db 0b00000000,0b00000000,0b00000001,0b11111100 .db 0b00000000,0b00000000,0b00000000,0b11111100 .db 0b00000000,0b00000000,0b00000000,0b11111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00001110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111111,0b00000000,0b00000000,0b01111110 .db 0b01111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b10000000,0b00000001,0b11111100 .db 0b00011111,0b11000000,0b00000011,0b11111000 .db 0b00011111,0b11100000,0b00000111,0b11111000 .db 0b00001111,0b11111000,0b00011111,0b11110000 .db 0b00000111,0b11111111,0b11111111,0b11100000 .db 0b00000011,0b11111111,0b11111111,0b11000000 .db 0b00000001,0b11111111,0b11111111,0b00000000 .db 0b00000000,0b01111111,0b11111110,0b00000000 .db 0b00000000,0b00011111,0b11110000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit4: .db 0b00000000,0b00000000,0b00000011,0b11000000 .db 0b00000000,0b00000000,0b00000111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00011111,0b11000000 .db 0b00000000,0b00000000,0b00111111,0b11000000 .db 0b00000000,0b00000000,0b00111111,0b11000000 .db 0b00000000,0b00000000,0b01111111,0b11000000 .db 0b00000000,0b00000000,0b11111111,0b11000000 .db 0b00000000,0b00000001,0b11111111,0b11000000 .db 0b00000000,0b00000001,0b11111111,0b11000000 .db 0b00000000,0b00000011,0b11111111,0b11000000 .db 0b00000000,0b00000111,0b11111111,0b11000000 .db 0b00000000,0b00001111,0b11111111,0b11000000 .db 0b00000000,0b00011111,0b11101111,0b11000000 .db 0b00000000,0b00011111,0b11001111,0b11000000 .db 0b00000000,0b00111111,0b10001111,0b11000000 .db 0b00000000,0b01111111,0b00001111,0b11000000 .db 0b00000000,0b11111111,0b00001111,0b11000000 .db 0b00000001,0b11111110,0b00001111,0b11000000 .db 0b00000001,0b11111100,0b00001111,0b11000000 .db 0b00000011,0b11111000,0b00001111,0b11000000 .db 0b00000111,0b11110000,0b00001111,0b11000000 .db 0b00001111,0b11110000,0b00001111,0b11000000 .db 0b00001111,0b11100000,0b00001111,0b11000000 .db 0b00011111,0b11000000,0b00001111,0b11000000 .db 0b00111111,0b10000000,0b00001111,0b11000000 .db 0b01111111,0b10000000,0b00001111,0b11000000 .db 0b11111111,0b00000000,0b00001111,0b11000000 .db 0b11111111,0b11111111,0b11111111,0b11111111 .db 0b11111111,0b11111111,0b11111111,0b11111111 .db 0b11111111,0b11111111,0b11111111,0b11111111 .db 0b11111111,0b11111111,0b11111111,0b11111111 .db 0b11111111,0b11111111,0b11111111,0b11111111 .db 0b11111111,0b11111111,0b11111111,0b11111111 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit5: .db 0b00000001,0b11111111,0b11111111,0b11111000 .db 0b00000001,0b11111111,0b11111111,0b11111000 .db 0b00000011,0b11111111,0b11111111,0b11111000 .db 0b00000011,0b11111111,0b11111111,0b11111000 .db 0b00000011,0b11111111,0b11111111,0b11111000 .db 0b00000011,0b11111111,0b11111111,0b11111000 .db 0b00000011,0b11110000,0b00000000,0b00000000 .db 0b00000111,0b11110000,0b00000000,0b00000000 .db 0b00000111,0b11100000,0b00000000,0b00000000 .db 0b00000111,0b11100000,0b00000000,0b00000000 .db 0b00000111,0b11100000,0b00000000,0b00000000 .db 0b00000111,0b11100000,0b00000000,0b00000000 .db 0b00001111,0b11100000,0b00000000,0b00000000 .db 0b00001111,0b11000000,0b00000000,0b00000000 .db 0b00001111,0b11000000,0b00000000,0b00000000 .db 0b00001111,0b11000011,0b11111000,0b00000000 .db 0b00001111,0b11001111,0b11111111,0b00000000 .db 0b00011111,0b11111111,0b11111111,0b10000000 .db 0b00011111,0b11111111,0b11111111,0b11100000 .db 0b00011111,0b11111111,0b11111111,0b11100000 .db 0b00011111,0b11111000,0b00001111,0b11110000 .db 0b00011111,0b11100000,0b00000011,0b11111000 .db 0b00111111,0b11000000,0b00000001,0b11111000 .db 0b00111111,0b10000000,0b00000001,0b11111100 .db 0b00000111,0b00000000,0b00000000,0b11111100 .db 0b00000000,0b00000000,0b00000000,0b11111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b00000000,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b11111100 .db 0b01111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b10000000,0b00000001,0b11111000 .db 0b00111111,0b10000000,0b00000011,0b11111000 .db 0b00011111,0b11000000,0b00000111,0b11110000 .db 0b00001111,0b11110000,0b00011111,0b11100000 .db 0b00000111,0b11111111,0b11111111,0b11100000 .db 0b00000011,0b11111111,0b11111111,0b11000000 .db 0b00000001,0b11111111,0b11111111,0b00000000 .db 0b00000000,0b11111111,0b11111110,0b00000000 .db 0b00000000,0b00011111,0b11110000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit6: .db 0b00000000,0b00000111,0b11111100,0b00000000 .db 0b00000000,0b00011111,0b11111111,0b00000000 .db 0b00000000,0b01111111,0b11111111,0b11000000 .db 0b00000000,0b11111111,0b11111111,0b11100000 .db 0b00000001,0b11111111,0b11111111,0b11110000 .db 0b00000011,0b11111100,0b00001111,0b11111000 .db 0b00000111,0b11110000,0b00000011,0b11111000 .db 0b00001111,0b11100000,0b00000001,0b11111100 .db 0b00001111,0b11000000,0b00000000,0b11111100 .db 0b00011111,0b11000000,0b00000000,0b11111110 .db 0b00011111,0b10000000,0b00000000,0b01111110 .db 0b00011111,0b10000000,0b00000000,0b01111110 .db 0b00111111,0b00000000,0b00000000,0b00000000 .db 0b00111111,0b00000000,0b00000000,0b00000000 .db 0b00111111,0b00000000,0b00000000,0b00000000 .db 0b00111111,0b00000000,0b00000000,0b00000000 .db 0b00111110,0b00000001,0b11111100,0b00000000 .db 0b01111110,0b00001111,0b11111111,0b00000000 .db 0b01111110,0b00111111,0b11111111,0b11000000 .db 0b01111110,0b01111111,0b11111111,0b11100000 .db 0b01111110,0b11111111,0b11111111,0b11110000 .db 0b01111111,0b11111000,0b00001111,0b11111000 .db 0b01111111,0b11100000,0b00000011,0b11111100 .db 0b01111111,0b11000000,0b00000001,0b11111100 .db 0b01111111,0b10000000,0b00000000,0b11111110 .db 0b01111111,0b00000000,0b00000000,0b01111110 .db 0b01111111,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b00111111 .db 0b01111110,0b00000000,0b00000000,0b00111111 .db 0b01111110,0b00000000,0b00000000,0b00111111 .db 0b01111110,0b00000000,0b00000000,0b00111111 .db 0b01111110,0b00000000,0b00000000,0b00111111 .db 0b00111110,0b00000000,0b00000000,0b00111111 .db 0b00111110,0b00000000,0b00000000,0b00111111 .db 0b00111111,0b00000000,0b00000000,0b00111111 .db 0b00111111,0b00000000,0b00000000,0b01111110 .db 0b00011111,0b00000000,0b00000000,0b01111110 .db 0b00011111,0b10000000,0b00000000,0b01111110 .db 0b00011111,0b10000000,0b00000000,0b11111100 .db 0b00001111,0b11000000,0b00000001,0b11111100 .db 0b00000111,0b11110000,0b00000011,0b11111000 .db 0b00000111,0b11111100,0b00001111,0b11111000 .db 0b00000011,0b11111111,0b11111111,0b11110000 .db 0b00000001,0b11111111,0b11111111,0b11100000 .db 0b00000000,0b01111111,0b11111111,0b11000000 .db 0b00000000,0b00111111,0b11111111,0b00000000 .db 0b00000000,0b00000111,0b11111000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit7: .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111110 .db 0b01111111,0b11111111,0b11111111,0b11111100 .db 0b00000000,0b00000000,0b00000000,0b01111100 .db 0b00000000,0b00000000,0b00000000,0b11111000 .db 0b00000000,0b00000000,0b00000001,0b11110000 .db 0b00000000,0b00000000,0b00000011,0b11100000 .db 0b00000000,0b00000000,0b00000111,0b11100000 .db 0b00000000,0b00000000,0b00001111,0b11000000 .db 0b00000000,0b00000000,0b00001111,0b10000000 .db 0b00000000,0b00000000,0b00011111,0b10000000 .db 0b00000000,0b00000000,0b00111111,0b00000000 .db 0b00000000,0b00000000,0b00111110,0b00000000 .db 0b00000000,0b00000000,0b01111110,0b00000000 .db 0b00000000,0b00000000,0b01111100,0b00000000 .db 0b00000000,0b00000000,0b11111100,0b00000000 .db 0b00000000,0b00000001,0b11111000,0b00000000 .db 0b00000000,0b00000001,0b11111000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000011,0b11110000,0b00000000 .db 0b00000000,0b00000111,0b11100000,0b00000000 .db 0b00000000,0b00000111,0b11100000,0b00000000 .db 0b00000000,0b00000111,0b11100000,0b00000000 .db 0b00000000,0b00001111,0b11000000,0b00000000 .db 0b00000000,0b00001111,0b11000000,0b00000000 .db 0b00000000,0b00011111,0b10000000,0b00000000 .db 0b00000000,0b00011111,0b10000000,0b00000000 .db 0b00000000,0b00011111,0b10000000,0b00000000 .db 0b00000000,0b00111111,0b00000000,0b00000000 .db 0b00000000,0b00111111,0b00000000,0b00000000 .db 0b00000000,0b00111111,0b00000000,0b00000000 .db 0b00000000,0b00111111,0b00000000,0b00000000 .db 0b00000000,0b01111110,0b00000000,0b00000000 .db 0b00000000,0b01111110,0b00000000,0b00000000 .db 0b00000000,0b01111110,0b00000000,0b00000000 .db 0b00000000,0b01111110,0b00000000,0b00000000 .db 0b00000000,0b01111110,0b00000000,0b00000000 .db 0b00000000,0b11111100,0b00000000,0b00000000 .db 0b00000000,0b11111100,0b00000000,0b00000000 .db 0b00000000,0b11111100,0b00000000,0b00000000 .db 0b00000000,0b11111100,0b00000000,0b00000000 .db 0b00000000,0b11111100,0b00000000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit8: .db 0b00000000,0b00001111,0b11110000,0b00000000 .db 0b00000000,0b01111111,0b11111110,0b00000000 .db 0b00000000,0b11111111,0b11111111,0b00000000 .db 0b00000011,0b11111111,0b11111111,0b10000000 .db 0b00000011,0b11111111,0b11111111,0b11000000 .db 0b00000111,0b11111000,0b00011111,0b11100000 .db 0b00001111,0b11100000,0b00000111,0b11110000 .db 0b00001111,0b11000000,0b00000011,0b11110000 .db 0b00011111,0b11000000,0b00000011,0b11110000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00001111,0b11000000,0b00000011,0b11110000 .db 0b00001111,0b11000000,0b00000011,0b11110000 .db 0b00000111,0b11100000,0b00000111,0b11100000 .db 0b00000111,0b11111000,0b00011111,0b11100000 .db 0b00000001,0b11111111,0b11111111,0b11000000 .db 0b00000000,0b11111111,0b11111111,0b00000000 .db 0b00000000,0b01111111,0b11111110,0b00000000 .db 0b00000001,0b11111111,0b11111111,0b10000000 .db 0b00000111,0b11111111,0b11111111,0b11000000 .db 0b00001111,0b11110000,0b00011111,0b11110000 .db 0b00011111,0b11000000,0b00000111,0b11111000 .db 0b00011111,0b10000000,0b00000001,0b11111000 .db 0b00111111,0b10000000,0b00000001,0b11111100 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b01111111,0b00000000,0b00000000,0b11111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111111,0b00000000,0b00000000,0b11111110 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000001,0b11111100 .db 0b00011111,0b10000000,0b00000001,0b11111100 .db 0b00011111,0b11100000,0b00000011,0b11111000 .db 0b00001111,0b11111000,0b00001111,0b11110000 .db 0b00000111,0b11111111,0b11111111,0b11100000 .db 0b00000011,0b11111111,0b11111111,0b11000000 .db 0b00000001,0b11111111,0b11111111,0b10000000 .db 0b00000000,0b01111111,0b11111110,0b00000000 .db 0b00000000,0b00001111,0b11110000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000 digit9: .db 0b00000000,0b00011111,0b11100000,0b00000000 .db 0b00000000,0b01111111,0b11111100,0b00000000 .db 0b00000001,0b11111111,0b11111111,0b00000000 .db 0b00000011,0b11111111,0b11111111,0b10000000 .db 0b00000111,0b11111111,0b11111111,0b11000000 .db 0b00001111,0b11111000,0b00011111,0b11100000 .db 0b00011111,0b11100000,0b00000111,0b11110000 .db 0b00011111,0b11000000,0b00000011,0b11110000 .db 0b00111111,0b10000000,0b00000001,0b11111000 .db 0b00111111,0b10000000,0b00000000,0b11111000 .db 0b00111111,0b00000000,0b00000000,0b11111100 .db 0b01111111,0b00000000,0b00000000,0b11111100 .db 0b01111110,0b00000000,0b00000000,0b01111100 .db 0b01111110,0b00000000,0b00000000,0b01111100 .db 0b01111110,0b00000000,0b00000000,0b01111100 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b01111110,0b00000000,0b00000000,0b01111110 .db 0b00111111,0b00000000,0b00000000,0b11111110 .db 0b00111111,0b00000000,0b00000000,0b11111110 .db 0b00111111,0b10000000,0b00000001,0b11111110 .db 0b00011111,0b11000000,0b00000011,0b11111110 .db 0b00011111,0b11100000,0b00000111,0b11111110 .db 0b00001111,0b11111000,0b00011111,0b11111110 .db 0b00000111,0b11111111,0b11111111,0b01111110 .db 0b00000011,0b11111111,0b11111110,0b01111110 .db 0b00000001,0b11111111,0b11111100,0b01111110 .db 0b00000000,0b11111111,0b11110000,0b01111110 .db 0b00000000,0b00011111,0b11000000,0b01111100 .db 0b00000000,0b00000000,0b00000000,0b01111100 .db 0b00000000,0b00000000,0b00000000,0b11111100 .db 0b00000000,0b00000000,0b00000000,0b11111100 .db 0b00000000,0b00000000,0b00000000,0b11111100 .db 0b00111111,0b00000000,0b00000001,0b11111000 .db 0b00111111,0b00000000,0b00000001,0b11111000 .db 0b00111111,0b10000000,0b00000001,0b11111000 .db 0b00011111,0b10000000,0b00000011,0b11110000 .db 0b00011111,0b11000000,0b00000111,0b11110000 .db 0b00001111,0b11100000,0b00001111,0b11100000 .db 0b00001111,0b11110000,0b00111111,0b11000000 .db 0b00000111,0b11111111,0b11111111,0b10000000 .db 0b00000011,0b11111111,0b11111111,0b00000000 .db 0b00000001,0b11111111,0b11111110,0b00000000 .db 0b00000000,0b11111111,0b11111000,0b00000000 .db 0b00000000,0b00011111,0b11100000,0b00000000 .db 0b00000000,0b00000000,0b00000000,0b00000000