;**************************************************************************** ;* Das Scroller-Programm * ;* -------------------------------------------------------------------- * ;* copyright (c) 2000 by Hubersoft Corp. All rights reserved. * ;**************************************************************************** $MOD51 ;CLK=2000kHz; P1=8LEDs; INT0=Hg switch ;**************************************************************************** BSEG AT 20h abortflag: DBIT 1 DSEG AT 30h ;**************************************************************************** retracedelay equ 36d linedivisor equ 3d chars equ 5d startvalue equ 11000011b clearscreen equ 255d maxfail equ 2d timecount: DS 1 startposh: DS 1 startposl: DS 1 temp: DS 1 oldtime: DS 1 failcount: DS 1 lcount: DS 1 ;**************************************************************************** CSEG ;**************************************************************************** boot: mov P1, #startvalue mov timecount, #64 mov oldtime, #64 setb abortflag mov failcount, #0 mov TMOD, #01h setb TR0 restart: mov DPTR, #scrolltext mov startposh, dph mov startposl, dpl mov lcount, #textsize refresh: jnb INT0, $ jb INT0, $ jb abortflag, useoldtime mov oldtime, timecount mov timecount, TH0 mov failcount, #0 jmp normalcycle useoldtime: mov timecount, oldtime inc failcount normalcycle: clr abortflag mov a, failcount cjne a, #maxfail, nofail mov timecount, #64 mov oldtime, #64 nofail: mov TL0,#0 mov TH0,#0 mov R4, timecount nextdelay: mov R3, #retracedelay djnz R3, $ jb INT0, abortcycle djnz R4, nextdelay mov A, timecount mov B, #linedivisor div AB mov temp, A mov R2, #(chars*16) nextline: mov A, #0 movc A,@A+DPTR cpl A mov P1, A inc DPTR mov R3, temp djnz R3, $ djnz R2, nextline mov P1, #clearscreen djnz lcount, continue jmp restart continue: mov dph, startposh mov dpl, startposl inc dptr inc dptr inc dptr inc dptr inc dptr inc dptr inc dptr inc dptr mov startposh, dph mov startposl, dpl jmp refresh abortcycle: setb abortflag mov P1, #clearscreen jmp refresh ;**************************************************************************** scrolltext: $INCLUDE(scroller.inc) scrolltextend equ $ textsize set (((scrolltextend-scrolltext)/8)-(chars*2)) ;**************************************************************************** END