0% found this document useful (0 votes)
100 views7 pages

This Is The Light - Asm File (Source File)

This program flashes LEDs on and off in a repeating cycle by turning port 1 on and off. It uses delays of about 1.5 seconds between cycles. The delays are implemented using a triple loop countdown in a DELAY subroutine, which disables interrupts during the delay to prevent interference. It then re-enables interrupts before returning.

Uploaded by

anusanji
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views7 pages

This Is The Light - Asm File (Source File)

This program flashes LEDs on and off in a repeating cycle by turning port 1 on and off. It uses delays of about 1.5 seconds between cycles. The delays are implemented using a triple loop countdown in a DELAY subroutine, which disables interrupts during the delay to prevent interference. It then re-enables interrupts before returning.

Uploaded by

anusanji
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

THIS IS THE LIGHT.

ASM FILE (SOURCE FILE)

;File name LIGHT.ASM

;This program will flash output LEDs

P1 DATA 90H ;Port#1 address

EX0 BIT 0A8H ;interrupt 0 bit address

ORG 7000H ;Start address @7000H

LTX: MOV P1,#00FH ;Turn on LEDs (bits 4 to 7 low)

ACALL DELAY ;Delay 1.5 sec

MOV P1,#0FFH ;Turn off LEDs (bits 4 to 7 high)

ACALL DELAY ;Delay 1.5 sec

SJMP LTX ;Repeat LED on/off cycle

;delay about 1.5 sec using a tripple loop count down

DELAY: MOV R0,#0

MOV R1,#0

MOV R2,#11

CLR EX0 ;Disable int0 so that will not step

;Delay count loop

DJNZ R0,$

DJNZ R1,$-2

DJNZ R2,$-4

SETB EX0 ;Enable step mode again before

;Exiting the delay count loop

RET

END
THIS IS THE LIGHT.LST FILE (LIST FILE)

LIGHT PAGE 1

1 ;File name LIGHT.ASM

2 ;This program will flash output LEDs

0090 3 P1 DATA 90H ;Port#1 address

00A8 4 EX0 BIT 0A8H ;interrupt 0 bit address

7000 5 ORG 7000H ;Start address @7000H

7000 75900F 6 LTX: MOV P1,#00FH ;Turn on LEDs (bits 4 to 7 low)

7003 110C 7 ACALL DELAY ;Delay 1.5 sec

7005 7590FF 8 MOV P1,#0FFH ;Turn off LEDs (bits 4 to 7 high)

7008 110C 9 ACALL DELAY ;Delay 1.5 sec

700A 80F4 10 SJMP LTX ;Repeat LED on/off cycle

11 ;

12 ;delay about 1.5 sec using a tripple loop count down

13 ;

700C 7800 14 DELAY: MOV R0,#0

700E 7900 15 MOV R1,#0

7010 7A0B 16 MOV R2,#11

7012 C2A8 17 CLR EX0 ;Disable int0 so that will not step

18 ;Delay count loop

7014 D8FE 19 DJNZ R0,$

7016 D9FC 20 DJNZ R1,$-2

7018 DAFA 21 DJNZ R2,$-4

701A D2A8 22 SETB EX0 ;Enable step mode again before

23 ;Exiting the delay count loop

701C 22 24 RET
25 END

VERSION 1.2h ASSEMBLY COMPLETE, 0 ERRORS FOUND

LIGHT PAGE 2

DELAY. . . . . . . . . . . . . . C ADDR 700CH

EX0. . . . . . . . . . . . . . . B ADDR 00A8H

LTX. . . . . . . . . . . . . . . C ADDR 7000H

P1 . . . . . . . . . . . . . . . D ADDR 0090H

THIS PROGRAM REPRESENT THE BINARY VALUE OF REGISTRATION NUMBER USING


LEDs (SOURCE FILLE)
;File name REG.ASM

;This program will represent the binary value of my registration number using LEDs

P1 DATA 90H

EX0 BIT 0A8H

ORG 7000H

LTX: MOV P1,#11001111B

ACALL DELAY

MOV P1,#11111111B

ACALL DELAY

MOV P1,#11111111B

ACALL DELAY

MOV P1,#11111111B

ACALL DELAY

MOV P1,#11001111B

ACALL DELAY
MOV P1,#11111111B

ACALL DELAY

MOV P1,#10011111B

ACALL DELAY

MOV P1,#11111111B

ACALL DELAY

MOV P1,#10001111B

ACALL DELAY

MOV P1,#11111111B

ACALL DELAY

MOV P1,#10111111B

ACALL DELAY

MOV P1,#11111111B

ACALL DELAY

MOV P1,#10111111B

ACALL DELAY

MOV P1,#11111111B

ACALL DELAY

MOV P1,#11001111B

SJMP LTX

;delay about 1.5 sec using a tripple loop count down

DELAY: MOV R0,#0

MOV R1,#0

MOV R2,#11

CLR EX0
DJNZ R0,$

DJNZ R1,$-2

DJNZ R2,$-4

SETB EX0

RET

END

THIS PROGRAM REPRESENT THE BINARY VALUE OF REGISTRATION NUMBER USING


LEDs (LIST FILE)

REG PAGE 1

1 ;File name REG.ASM

2 ;This program will represent the binary value using LEDs

0090 3 P1 DATA 90H

00A8 4 EX0 BIT 0A8H

7000 5 ORG 7000H

7000 7590CF 6 LTX: MOV P1,#11001111B

7003 114B 7 ACALL DELAY

7005 7590FF 8 MOV P1,#11111111B

7008 114B 9 ACALL DELAY

700A 7590FF 10 MOV P1,#11111111B

700D 114B 11 ACALL DELAY

700F 7590FF 12 MOV P1,#11111111B

7012 114B 13 ACALL DELAY


7014 7590CF 14 MOV P1,#11001111B

7017 114B 15 ACALL DELAY

7019 7590FF 16 MOV P1,#11111111B

701C 114B 17 ACALL DELAY

701E 75909F 18 MOV P1,#10011111B

7021 114B 19 ACALL DELAY

7023 7590FF 20 MOV P1,#11111111B

7026 114B 21 ACALL DELAY

7028 75908F 22 MOV P1,#10001111B

702B 114B 23 ACALL DELAY

702D 7590FF 24 MOV P1,#11111111B

7030 114B 25 ACALL DELAY

7032 7590BF 26 MOV P1,#10111111B

7035 114B 27 ACALL DELAY

7037 7590FF 28 MOV P1,#11111111B

703A 114B 29 ACALL DELAY

703C 7590BF 30 MOV P1,#10111111B

703F 114B 31 ACALL DELAY

7041 7590FF 32 MOV P1,#11111111B

7044 114B 33 ACALL DELAY

7046 7590CF 34 MOV P1,#11001111B

7049 80B5 35 SJMP LTX

36 ;

37 ;delay about 1.5 sec using a tripple loop count down

38 ;

704B 7800 39 DELAY: MOV R0,#0

704D 7900 40 MOV R1,#0


704F 7A0B 41 MOV R2,#11

7051 C2A8 42 CLR EX0

43

7053 D8FE 44 DJNZ R0,$

7055 D9FC 45 DJNZ R1,$-2

7057 DAFA 46 DJNZ R2,$-4

7059 D2A8 47 SETB EX0

48

705B 22 49 RET

50 END

VERSION 1.2h ASSEMBLY COMPLETE, 0 ERRORS FOUND

LIGHT1 PAGE 2

DELAY. . . . . . . . . . . . . . C ADDR 704BH

EX0. . . . . . . . . . . . . . . B ADDR 00A8H

LTX. . . . . . . . . . . . . . . C ADDR 7000H

P1 . . . . . . . . . . . . . . . D ADDR 0090H

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy