summaryrefslogtreecommitdiffstats
path: root/Bachelor/Mikroprozessorsysteme/Praktikum3/P3_2.S03
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Bachelor/Mikroprozessorsysteme/Praktikum3/P3_2.S03
downloadStudium-master.tar.gz
Studium-master.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Bachelor/Mikroprozessorsysteme/Praktikum3/P3_2.S03')
-rw-r--r--Bachelor/Mikroprozessorsysteme/Praktikum3/P3_2.S03101
1 files changed, 101 insertions, 0 deletions
diff --git a/Bachelor/Mikroprozessorsysteme/Praktikum3/P3_2.S03 b/Bachelor/Mikroprozessorsysteme/Praktikum3/P3_2.S03
new file mode 100644
index 0000000..47efe9d
--- /dev/null
+++ b/Bachelor/Mikroprozessorsysteme/Praktikum3/P3_2.S03
@@ -0,0 +1,101 @@
+;Sven Eisenhauer
+;MPS1 Versuch 3 Aufgabe 2
+;14.06.2005
+
+LSTOUT-
+$SFR80515.INC
+LSTOUT+
+
+ORG 0000h
+
+MOV CCL3,#0F0H
+MOV CCH3,#0D8H
+MOV CRCL,#0E0H
+MOV CRCH,#0B1H
+MOV CCEN,#80H
+MOV T2CON,#11H
+
+;SETB P1.0
+MOV DPTR,#0F803h
+MOV A,#92h
+MOVX @DPTR,A
+MOV DPTR,#0F802h
+
+MOV A,#00h
+MOVX @DPTR,A
+MOV P5,#00h
+MOV R0,#00h
+MOV R1,#00h
+MOV R2,#00h
+MOV R3,#00h
+
+;WAIT: JB P1.0,WAIT
+START: MOV A,R0
+ CLR C
+ CJNE A,#0FFh,CARRY
+
+CARRY: JC LBINK
+HBINK: INC R1
+ SJMP AUSG
+LBINK: INC R0
+ SJMP AUSG
+
+AUSG: LCALL PORTS
+
+ MOV A,R2
+ CJNE A,#099h,HUNDERT
+HUNDERT: JC BCDL
+BCDH: MOV A,R3
+ ADD A,#1h
+ DA A
+ MOV R3,A
+ MOV R2,#00h
+ SJMP BCDAUSG
+
+BCDL: MOV A,R2
+ ADD A,#1h
+ DA A
+ MOV R2,A
+ SJMP BCDAUSG
+
+BCDAUSG: LCALL BCDSEND
+
+SJMP START
+
+BCDSEND: MOV A,R3
+ SWAP A
+ ANL A,#0Fh
+ ADD A,#30h
+ LCALL SENDSE
+ MOV A,R3
+ ANL A,#0Fh
+ ADD A,#30h
+ LCALL SENDSE
+ MOV A,R2
+ SWAP A
+ ANL A,#0Fh
+ ADD A,#30h
+ LCALL SENDSE
+ MOV A,R2
+ ANL A,#0Fh
+ ADD A,#30h
+ LCALL SENDSE
+ MOV A,#20h
+ LCALL SENDSE
+ RET
+
+;WAIT2: JNB P1.0,WAIT2
+;SJMP WAIT
+
+PORTS: MOV P5,R0
+ MOV DPTR,#0F802h
+ MOV A,R1
+ MOVX @DPTR,A
+ RET
+
+SENDSE: MOV SBUF,A
+ CLR TI
+WARTE: JNB TI, WARTE
+ RET
+
+END \ No newline at end of file