
Untitled
By: a guest on
May 11th, 2012 | syntax:
ASM (NASM) | size: 1.35 KB | hits: 21 | expires: Never
$nomod51
;KA 4 2BKI 2/2
sjmp start
cseg at 0x03
ljmp int_0
cseg at 0x0B
ljmp timer_0
cseg at 0x13
ljmp int_1
start:
setb EA
setb EX0
setb EX1
setb IT0
setb IT1
setb ET0
setb TR0
call init
call display
call dis_on1
call clear
mov tmod,#0x02
mov TL0,#6
mov TH0,#6
; DIE MÜSSEN INITIALISIERT WERDEN!!!
sekunde equ 0x60
hundert equ 0x61
z1 equ 0x62
z2 equ 0x63
; heißt:
mov sekunde,#0
mov hundert,#0
mov z1,#100
mov z2,#40
; michi, michi.... ^^
;Name:
mov r0,#0x40
call pos
mov DPTR,#Name_1
call lcdsend
;Start mit Gelb
call home
mov DPTR,#start_gelb
call lcdsend
mov p1,#85
sjmp $
int_0:
setb TR0
call home
mov DPTR,#stopp_gruen
call lcdsend
mov p1,#34
reti
int_1:
clr TR0
mov p1,#136
call clear
mov DPTR,#Zeit
call lcdsend
mov A,sekunde
call ausgabe1
call ausgabe2
mov r6,A
call zeichen
reti
timer_0:
DJNZ z1,M_Reti
mov z1,#100
DJNZ z2,M_Reti
mov z2,#40
INC sekunde
M_Reti:
Reti
ausgabe1:
ADD A,#0x30
mov R6,A
call zeichen
ret
ausgabe2:
mov B,#10
div AB
call ausgabe1
mov A,B
call ausgabe1
ret
ausgabe3:
mov b,#100
div ab
call ausgabe1
mov a,b
call ausgabe2
ret
Name_1: db "Michael Gold",0
start_gelb: db "Start mit Gelb",0
stopp_gruen: db "Stopp mit Gruen",0
Zeit: db "Zeit:",0
$include(LCD_ups.inc)
$include(t89c51cc01.inc)
END