0% found this document useful (0 votes)
39 views6 pages

Org 0h

The document contains assembly language code that sets port registers on a microcontroller and loops through bit patterns. It initializes variables and addresses for ports and memory, then enters a main loop to set bit patterns on a port using MOVX instructions and delay with a subroutine call. It increments counters in the delay loop before repeating the main bit setting loop.

Uploaded by

esa_nurleo
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 DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views6 pages

Org 0h

The document contains assembly language code that sets port registers on a microcontroller and loops through bit patterns. It initializes variables and addresses for ports and memory, then enters a main loop to set bit patterns on a port using MOVX instructions and delay with a subroutine call. It increments counters in the delay loop before repeating the main bit setting loop.

Uploaded by

esa_nurleo
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 DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

org 0h jmp start porta portb portc cw equ 0E000h equ 0E001h equ 0E002h equ 0E003h

start: mov a,#80h mov DPTR,#cw movx @DPTR,a mulai: mov A,#10000000b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#01000000b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00100000b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00010000b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00001000b mov DPTR,#porta movx @DPTR,A acall tunda mov mov A,#00000100b DPTR,#porta

movx @DPTR,A acall tunda

mov A,#00000010b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00000001b mov DPTR,#porta movx @DPTR,A acall tunda sjmp mulai tunda: ulang2: ulang1: ulang: cjne inc cjne inc cjne ret END mov R7,#0 mov R6,#0 mov R5,#0 inc R5 R5,#20H,ulang R6 R6,#20H,ulang1 R7 R7,#20H,ulang2

org 0h jmp start porta portb portc cw equ 0E000h equ 0E001h equ 0E002h equ 0E003h

start: mov mov movx mulai:

a,#80h DPTR,#cw @DPTR,a

mov A,#10000001b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#01000010b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00100100b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00011000b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00011000b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00100100b mov DPTR,#porta movx @DPTR,A acall tunda

mov A,#01000010b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#10000001b mov DPTR,#porta movx @DPTR,A acall tunda

sjmp mulai tunda: ulang2: ulang1: ulang: cjne inc cjne inc cjne ret END mov R7,#0 mov R6,#0 mov R5,#0 inc R5 R5,#20H,ulang R6 R6,#20H,ulang1 R7 R7,#20H,ulang2

org 0h jmp start porta portb portc cw equ 0E000h equ 0E001h equ 0E002h equ 0E003h

start: mov a,#80h mov DPTR,#cw movx @DPTR,a mulai: mov A,#00011000b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00100100b mov DPTR,#porta movx @DPTR,A acall tunda mov mov movx A,#01000010b DPTR,#porta @DPTR,A

acall tunda mov A,#10000001b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#10000001b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#01000010b mov DPTR,#porta movx @DPTR,A acall tunda

mov A,#00100100b mov DPTR,#porta movx @DPTR,A acall tunda mov A,#00011000b mov DPTR,#porta movx @DPTR,A acall tunda sjmp mulai tunda: ulang2: ulang1: ulang: cjne inc cjne inc cjne ret END mov R7,#0 mov R6,#0 mov R5,#0 inc R5 R5,#20H,ulang R6 R6,#20H,ulang1 R7 R7,#20H,ulang2

You might also like