Thông báo

Collapse
No announcement yet.

Hướng dẫn lập trình ASSEMBLY!

Collapse
X
 
  • Lọc
  • Giờ
  • Show
Clear All
new posts

  • #46
    ai đã làm led đơn chạy chữ rồi thì giúp mình với.minh đang muốn làm 1 biển chạy chữ dùng vđk 89c51 hoặc 89c52.nguyên liệu,cách mắc,va code dung xsembly hoặc kal C.mình xin cảm on.mjh đang can gap

    Comment


    • #47
      mấy bác chỉ phần lập trình dùng vòng lặp với.....tại vì ma trận viết ra có dòng chữ ngắn nên hk đủ chữ theo ý mình mún......mà dùng vòng lặp thì bị lỗi mất rùi mấy bác ơi! nó chạy ra còn ngắn hơn khi k dùng vòng lặp

      Comment


      • #48
        Nguyên văn bởi thanhdanhtp Xem bài viết
        em định tự học assembly mà không bik bắt đầu từ đâu, C và ASM thì cái nào dễ học và hiệu quả hơn nhỉ
        mình đang tự học đây bạn

        Comment


        • #49
          Nguyên văn bởi thienpro93 Xem bài viết
          ai đã làm led đơn chạy chữ rồi thì giúp mình với.minh đang muốn làm 1 biển chạy chữ dùng vđk 89c51 hoặc 89c52.nguyên liệu,cách mắc,va code dung xsembly hoặc kal C.mình xin cảm on.mjh đang can gap
          nguyên liệu và cách mắc thì zô gôgle search mà coi nhé bạn....
          mình có cái code trái tim này bạn dựa vào đó mà viết lại nhé??...đưa code này tham khảo.....
          cái này là đơn giản nhất nhé...
          code:
          org 0000h
          start:
          call xoa
          call kieu_1d
          call xoa
          mov r3, #2
          tt_1:
          call kieu_5
          call xoa
          djnz r3, tt_1
          mov r3, #1
          tt_2:
          call xoa
          call kieu_1d
          call xoa
          djnz r3, tt_2
          mov r3, #5
          tt_3:
          call kieu_6a
          call xoa
          djnz r3, tt_3
          mov r3, #1
          tt_4:
          call kieu_1d
          call xoa
          djnz r3, tt_4
          mov r3, #5
          tt_5:
          call kieu_6b
          call xoa
          djnz r3, tt_5
          mov r3, #1
          tt_6:
          call kieu_1d
          call xoa
          djnz r3, tt_6
          mov r3, #2
          tt_7:
          call kieu_8
          call xoa
          djnz r3, tt_7
          mov r3, #1
          tt_8:
          call kieu_1d
          call xoa
          djnz r3, tt_8
          mov r3, #2
          tt_9:
          call kieu_9
          call xoa
          djnz r3, tt_9
          mov r3, #1
          tt_10:
          call kieu_1d
          call xoa
          djnz r3, tt_10
          mov r3, #5
          tt_11:
          call kieu_10
          call xoa
          djnz r3, tt_11
          jmp start
          ;
          kieu_1d: ;cho 32 led cung sang-cung tat.
          mov p0, #00000000b
          mov p1, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          mov p0, #11111111b
          mov p1, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          call delay
          ret
          kieu_6a: ; cho 1 led sang lan dan cho den het cang.
          mov p0, #01111111b
          mov p1, #11111110b
          mov p2, #11111110b
          mov p3, #11111110b
          call delay
          mov p0, #00111111b
          mov p1, #11111100b
          mov p2, #11111100b
          mov p3, #11111100b
          call delay
          mov p0, #00011111b
          mov p1, #11111000b
          mov p2, #11111000b
          mov p3, #11111000b
          call delay
          mov p0, #00001111b
          mov p1, #11110000b
          mov p2, #11110000b
          mov p3, #11110000b
          call delay
          mov p0, #00000111b
          mov p1, #11100000b
          mov p2, #11100000b
          mov p3, #11100000b
          call delay
          mov p0, #00000011b
          mov p1, #11000000b
          mov p2, #11000000b
          mov p3, #11000000b
          call delay
          mov p0, #00000001b
          mov p1, #10000000b
          mov p2, #10000000b
          mov p3, #10000000b
          call delay
          mov p0, #00000000b
          mov p1, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          mov p0, #11111111b
          mov p1, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          call delay
          mov p0, #11111110b
          mov p1, #01111111b
          mov p2, #01111111b
          mov p3, #01111111b
          call delay
          mov p0, #11111100b
          mov p1, #00111111b
          mov p2, #00111111b
          mov p3, #00111111b
          call delay
          mov p0, #11111000b
          mov p1, #00011111b
          mov p2, #00011111b
          mov p3, #00011111b
          call delay
          mov p0, #11110000b
          mov p1, #00001111b
          mov p2, #00001111b
          mov p3, #00001111b
          call delay
          mov p0, #11100000b
          mov p1, #00000111b
          mov p2, #00000111b
          mov p3, #00000111b
          call delay
          mov p0, #11000000b
          mov p1, #00000011b
          mov p2, #00000011b
          mov p3, #00000011b
          call delay
          mov p0, #10000000b
          mov p1, #00000001b
          mov p2, #00000001b
          mov p3, #00000001b
          call delay
          mov p0, #00000000b
          mov p1, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          mov p0, #11111111b
          mov p1, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          call delay
          ret
          kieu_6b: ; chay tung led 1 vong den het cang.
          mov p0, #01111111b
          mov p1, #11111110b
          mov p2, #11111110b
          mov p3, #11111110b
          call delay
          mov p0, #10111111b
          mov p1, #11111101b
          mov p2, #11111101b
          mov p3, #11111101b
          call delay
          mov p0, #11011111b
          mov p1, #11111011b
          mov p2, #11111011b
          mov p3, #11111011b
          call delay
          mov p0, #11101111b
          mov p1, #11110111b
          mov p2, #11110111b
          mov p3, #11110111b
          call delay
          mov p0, #11110111b
          mov p1, #11101111b
          mov p2, #11101111b
          mov p3, #11101111b
          call delay
          mov p0, #11111011b
          mov p1, #11011111b
          mov p2, #11011111b
          mov p3, #11011111b
          call delay
          mov p0, #11111101b
          mov p1, #10111111b
          mov p2, #10111111b
          mov p3, #10111111b
          call delay
          mov p0, #11111110b
          mov p1, #01111111b
          mov p2, #01111111b
          mov p3, #01111111b
          call delay
          mov p0, #11111111b
          mov p1, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          call delay
          mov p0, #11111110b
          mov p1, #01111111b
          mov p2, #01111111b
          mov p3, #01111111b
          call delay
          mov p0, #11111101b
          mov p1, #10111111b
          mov p2, #10111111b
          mov p3, #10111111b
          call delay
          mov p0, #11111011b
          mov p1, #11011111b
          mov p2, #11011111b
          mov p3, #11011111b
          call delay
          mov p0, #11110111b
          mov p1, #11101111b
          mov p2, #11101111b
          mov p3, #11101111b
          call delay
          mov p0, #11101111b
          mov p1, #11110111b
          mov p2, #11110111b
          mov p3, #11110111b
          call delay
          mov p0, #11011111b
          mov p1, #11111011b
          mov p2, #11111011b
          mov p3, #11111011b
          call delay
          mov p0, #10111111b
          mov p1, #11111101b
          mov p2, #11111101b
          mov p3, #11111101b
          call delay
          mov p0, #01111111b
          mov p1, #11111110b
          mov p2, #11111110b
          mov p3, #11111110b
          call delay
          mov p0, #11111111b
          mov p1, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          call delay
          ret
          kieu_8: ; cho 1 led sang dan cho den het trai tim va tat dan.
          clr p1.0
          call delay
          clr p1.0
          mov p0, #11111110b
          call delay
          clr p1.0
          mov p0, #11111100b
          call delay
          clr p1.0
          mov p0, #11111000b
          call delay
          clr p1.0
          mov p0, #11110000b
          call delay
          clr p1.0
          mov p0, #11100000b
          call delay
          clr p1.0
          mov p0, #11000000b
          call delay
          clr p1.0
          mov p0, #10000000b
          call delay
          clr p1.0
          mov p0, #00000000b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #01111111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00111111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00011111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00001111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000011b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000001b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #01111111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00111111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00011111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00001111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000111b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000011b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000001b
          call delay
          clr p1.0
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #01111110b
          call delay
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00111110b
          call delay
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00011110b
          call delay
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00001110b
          call delay
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000110b
          call delay
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000010b
          call delay
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000000b
          call delay
          mov p0, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #00000001b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #00000011b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #00000111b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #00001111b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #00011111b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #00111111b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #01111111b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #10000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11000000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11100000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11110000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111000b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111100b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111110b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #00000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #10000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11000000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11100000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11110000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111000b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111100b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111110b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          mov p1, #00000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          mov p1, #10000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          mov p1, #11000001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          mov p1, #11100001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          mov p1, #11110001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          mov p1, #11111001b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          mov p1, #11111101b
          call delay
          mov p0, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          mov p1, #11111111b
          call delay
          ret
          kieu_9: ; cho led sang
          clr p1.0
          clr p2.0
          call delay
          clr p0.0
          clr p3.7
          setb p1.0
          setb p2.0
          call delay
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p0.7
          clr p3.0
          setb p0.6
          setb p3.1
          call delay
          clr p2.7
          clr p1.7
          setb p0.7
          setb p3.0
          call delay
          clr p2.6
          clr p1.6
          setb p2.7
          setb p1.7
          call delay
          clr p2.5
          clr p1.5
          setb p2.6
          setb p1.6
          call delay
          clr p2.4
          clr p1.4
          setb p2.5
          setb p1.5
          call delay
          clr p2.3
          clr p1.3
          setb p2.4
          setb p1.4
          call delay
          clr p2.2
          clr p1.2
          setb p2.3
          setb p1.3
          call delay
          clr p2.1
          clr p1.1
          setb p2.2
          setb p1.2
          call delay
          clr p1.0
          clr p2.0
          call delay
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p2.1
          clr p1.1
          clr p0.7
          clr p3.0
          setb p0.6
          setb p3.1
          call delay
          clr p2.1
          clr p1.1
          clr p2.7
          clr p1.7
          setb p0.7
          setb p3.0
          call delay
          clr p2.1
          clr p1.1
          clr p2.6
          clr p1.6
          setb p2.7
          setb p1.7
          call delay
          clr p2.1
          clr p1.1
          clr p2.5
          clr p1.5
          setb p2.6
          setb p1.6
          call delay
          clr p2.1
          clr p1.1
          clr p2.4
          clr p1.4
          setb p2.5
          setb p1.5
          call delay
          clr p2.1
          clr p1.1
          clr p2.3
          clr p1.3
          setb p2.4
          setb p1.4
          call delay
          setb p1.3
          setb p2.3
          clr p1.2
          clr p2.2
          clr p1.0
          clr p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.7
          clr p3.0
          setb p0.6
          setb p3.1
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.7
          clr p1.7
          setb p0.7
          setb p3.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.6
          clr p1.6
          setb p2.7
          setb p1.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.5
          clr p1.5
          setb p2.6
          setb p1.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.4
          clr p1.4
          setb p2.5
          setb p1.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.3
          clr p1.3
          setb p2.4
          setb p1.4
          call delay
          clr p1.3
          clr p2.3
          clr p1.2
          clr p2.2
          clr p1.0
          clr p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.7
          clr p3.0
          setb p0.6
          setb p3.1
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.7
          clr p1.7
          setb p0.7
          setb p3.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.6
          clr p1.6
          setb p2.7
          setb p1.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.5
          clr p1.5
          setb p2.6
          setb p1.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.4
          clr p1.4
          setb p2.5
          setb p1.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.3
          clr p1.3
          call delay
          clr p1.4
          clr p2.4
          clr p1.3
          clr p2.3
          clr p1.2
          clr p2.2
          clr p1.0
          clr p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.7
          clr p3.0
          setb p0.6
          setb p3.1
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.7
          clr p1.7
          setb p0.7
          setb p3.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.6
          clr p1.6
          setb p2.7
          setb p1.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.5
          clr p1.5
          setb p2.6
          setb p1.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.4
          clr p1.4
          call delay
          clr p1.5
          clr p2.5
          clr p1.4
          clr p2.4
          clr p1.3
          clr p2.3
          clr p1.2
          clr p2.2
          clr p1.0
          clr p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.7
          clr p3.0
          setb p0.6
          setb p3.1
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.7
          clr p1.7
          setb p0.7
          setb p3.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.6
          clr p1.6
          setb p2.7
          setb p1.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.5
          clr p1.5
          call delay
          clr p1.6
          clr p2.6
          clr p1.5
          clr p2.5
          clr p1.4
          clr p2.4
          clr p1.3
          clr p2.3
          clr p1.2
          clr p2.2
          clr p1.0
          clr p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.7
          clr p3.0
          setb p0.6
          setb p3.1
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.7
          clr p1.7
          setb p0.7
          setb p3.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.6
          clr p1.6
          call delay
          mov p1, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.7
          clr p3.0
          setb p0.6
          setb p3.1
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p2.7
          clr p1.7
          call delay
          clr p3.0
          clr p0.7
          mov p1, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          setb p0.5
          setb p3.2
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.7
          clr p3.0
          call delay
          clr p3.1
          clr p0.6
          clr p3.0
          clr p0.7
          mov p1, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          setb p0.4
          setb p3.3
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.6
          clr p3.1
          call delay
          clr p0.5
          clr p3.2
          clr p3.1
          clr p0.6
          clr p3.0
          clr p0.7
          mov p1, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          setb p0.3
          setb p3.4
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.5
          clr p3.2
          call delay
          clr p0.4
          clr p3.3
          clr p0.5
          clr p3.2
          clr p3.1
          clr p0.6
          clr p3.0
          clr p0.7
          mov p1, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          setb p0.2
          setb p3.5
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.4
          clr p3.3
          call delay
          clr p0.3
          clr p3.4
          clr p0.4
          clr p3.3
          clr p0.5
          clr p3.2
          clr p3.1
          clr p0.6
          clr p3.0
          clr p0.7
          mov p1, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          setb p0.1
          setb p3.6
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.3
          clr p3.4
          call delay
          clr p0.2
          clr p3.5
          clr p0.3
          clr p3.4
          clr p0.4
          clr p3.3
          clr p0.5
          clr p3.2
          clr p3.1
          clr p0.6
          clr p3.0
          clr p0.7
          mov p1, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          setb p0.0
          setb p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.2
          clr p3.5
          call delay
          clr p0.1
          clr p3.6
          clr p0.2
          clr p3.5
          clr p0.3
          clr p3.4
          clr p0.4
          clr p3.3
          clr p0.5
          clr p3.2
          clr p3.1
          clr p0.6
          clr p3.0
          clr p0.7
          mov p1, #00000000b
          mov p2, #00000000b
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          setb p1.0
          setb p2.0
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.0
          clr p3.7
          call delay
          clr p1.2
          clr p2.2
          clr p2.1
          clr p1.1
          clr p0.1
          clr p3.6
          call delay
          mov p0, #00000000b
          mov p1, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          ret
          kieu_10: ;cho led sang tu duoi len giua va dong thoi tu tren xuong giua.
          clr p1.0
          clr p2.0
          call delay
          clr p1.0
          clr p2.0
          clr p0.0
          clr p1.1
          clr p2.1
          clr p3.7
          call delay
          mov p0, #11111100b
          mov p1, #11111000b
          mov p2, #11111000b
          mov p3, #00111111b
          call delay
          mov p0, #11111000b
          mov p1, #11110000b
          mov p2, #11110000b
          mov p3, #00011111b
          call delay
          mov p0, #11110000b
          mov p1, #11100000b
          mov p2, #11100000b
          mov p3, #00001111b
          call delay
          mov p0, #11100000b
          mov p1, #11000000b
          mov p2, #11000000b
          mov p3, #00000111b
          call delay
          mov p0, #11000000b
          mov p1, #10000000b
          mov p2, #10000000b
          mov p3, #00000011b
          call delay
          mov p0, #10000000b
          mov p1, #00000000b
          mov p2, #00000000b
          mov p3, #00000001b
          call delay
          clr p0.7
          clr p3.0
          call delay
          setb p0.7
          setb p3.0
          call delay
          mov p0, #11000000b
          mov p1, #10000000b
          mov p2, #10000000b
          mov p3, #00000011b
          call delay
          mov p0, #11100000b
          mov p1, #11000000b
          mov p2, #11000000b
          mov p3, #00000111b
          call delay
          mov p0, #11110000b
          mov p1, #11100000b
          mov p2, #11100000b
          mov p3, #00001111b
          call delay
          mov p0, #11111000b
          mov p1, #11110000b
          mov p2, #11110000b
          mov p3, #00011111b
          call delay
          mov p0, #11111100b
          mov p1, #11111000b
          mov p2, #11111000b
          mov p3, #00111111b
          call delay
          mov p0, #11111110b
          mov p1, #11111100b
          mov p2, #11111100b
          mov p3, #01111111b
          call delay
          mov p0, #11111111b
          mov p1, #11111110b
          mov p2, #11111110b
          mov p3, #11111111b
          call delay
          mov p0, #11111111b
          mov p1, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          call delay
          ret
          kieu_5: ;cho 1 led sang don xuong.
          clr p1.0
          call delay
          clr p0.0
          clr p1.1
          setb p1.0
          call delay
          clr p0.1
          clr p1.2
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p0.2
          clr p1.3
          setb p0.1
          setb p1.2
          call delay
          clr p0.3
          clr p1.4
          setb p0.2
          setb p1.3
          call delay
          clr p0.4
          clr p1.5
          setb p0.3
          setb p1.4
          call delay
          clr p0.5
          clr p1.6
          setb p0.4
          setb p1.5
          call delay
          clr p0.6
          clr p1.7
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          clr p0.7
          clr p3.0
          setb p0.6
          setb p1.7
          call delay
          clr p2.7
          clr p3.1
          setb p0.7
          setb p3.0
          call delay
          clr p2.6
          clr p3.2
          setb p2.7
          setb p3.1
          call delay
          clr p2.5
          clr p3.3
          setb p2.6
          setb p3.2
          call delay
          clr p2.4
          clr p3.4
          setb p2.5
          setb p3.3
          call delay
          clr p2.3
          clr p3.5
          setb p2.4
          setb p3.4
          call delay
          clr p2.2
          clr p3.6
          setb p2.3
          setb p3.5
          setb p2.1
          call delay
          clr p2.1
          clr p3.7
          setb p2.2
          setb p3.6
          call delay
          clr p2.0
          setb p2.1
          setb p3.7
          call delay
          clr p1.0
          clr p2.0
          call delay
          clr p0.0
          clr p1.1
          clr p2.0
          setb p1.0
          call delay
          clr p2.0
          clr p0.1
          clr p1.2
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p2.0
          clr p0.2
          clr p1.3
          setb p0.1
          setb p1.2
          call delay
          clr p2.0
          clr p0.3
          clr p1.4
          setb p0.2
          setb p1.3
          call delay
          clr p2.0
          clr p0.4
          clr p1.5
          setb p0.3
          setb p1.4
          call delay
          clr p2.0
          clr p0.5
          clr p1.6
          setb p0.4
          setb p1.5
          call delay
          clr p2.0
          clr p0.6
          clr p1.7
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          clr p2.0
          clr p0.7
          clr p3.0
          setb p0.6
          setb p1.7
          call delay
          clr p2.0
          clr p2.7
          clr p3.1
          setb p0.7
          setb p3.0
          call delay
          clr p2.0
          clr p2.6
          clr p3.2
          setb p2.7
          setb p3.1
          call delay
          clr p2.0
          clr p2.5
          clr p3.3
          setb p2.6
          setb p3.2
          call delay
          clr p2.0
          clr p2.4
          clr p3.4
          setb p2.5
          setb p3.3
          call delay
          clr p2.0
          clr p2.3
          clr p3.5
          setb p2.4
          setb p3.4
          call delay
          clr p2.0
          clr p2.2
          clr p3.6
          setb p2.3
          setb p3.5
          setb p2.1
          call delay
          clr p2.0
          clr p2.1
          clr p3.7
          setb p2.2
          setb p3.6
          call delay
          clr p2.1
          clr p3.7
          clr p1.0
          clr p2.0
          call delay
          clr p2.1
          clr p3.7
          clr p0.0
          clr p1.1
          clr p2.0
          setb p1.0
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.1
          clr p1.2
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.2
          clr p1.3
          setb p0.1
          setb p1.2
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.3
          clr p1.4
          setb p0.2
          setb p1.3
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.4
          clr p1.5
          setb p0.3
          setb p1.4
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.5
          clr p1.6
          setb p0.4
          setb p1.5
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.6
          clr p1.7
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.7
          clr p3.0
          setb p0.6
          setb p1.7
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.7
          clr p3.1
          setb p0.7
          setb p3.0
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.6
          clr p3.2
          setb p2.7
          setb p3.1
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.5
          clr p3.3
          setb p2.6
          setb p3.2
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.4
          clr p3.4
          setb p2.5
          setb p3.3
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.3
          clr p3.5
          setb p2.4
          setb p3.4
          call delay
          clr p2.1
          clr p3.7
          clr p2.0
          clr p3.6
          clr p2.2
          setb p2.3
          setb p3.5
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p1.0
          clr p2.0
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p0.0
          clr p1.1
          clr p2.0
          setb p1.0
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.1
          clr p1.2
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.2
          clr p1.3
          setb p0.1
          setb p1.2
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.3
          clr p1.4
          setb p0.2
          setb p1.3
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.4
          clr p1.5
          setb p0.3
          setb p1.4
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.5
          clr p1.6
          setb p0.4
          setb p1.5
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.6
          clr p1.7
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.7
          clr p3.0
          setb p0.6
          setb p1.7
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.7
          clr p3.1
          setb p0.7
          setb p3.0
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.6
          clr p3.2
          setb p2.7
          setb p3.1
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.5
          clr p3.3
          setb p2.6
          setb p3.2
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.4
          clr p3.4
          setb p2.5
          setb p3.3
          call delay
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.3
          clr p3.5
          setb p2.4
          setb p3.4
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p1.0
          clr p2.0
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p0.0
          clr p1.1
          clr p2.0
          setb p1.0
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.1
          clr p1.2
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.2
          clr p1.3
          setb p0.1
          setb p1.2
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.3
          clr p1.4
          setb p0.2
          setb p1.3
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.4
          clr p1.5
          setb p0.3
          setb p1.4
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.5
          clr p1.6
          setb p0.4
          setb p1.5
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.6
          clr p1.7
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.7
          clr p3.0
          setb p0.6
          setb p1.7
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.7
          clr p3.1
          setb p0.7
          setb p3.0
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.6
          clr p3.2
          setb p2.7
          setb p3.1
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.5
          clr p3.3
          setb p2.6
          setb p3.2
          call delay
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.4
          clr p3.4
          setb p2.5
          setb p3.3
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p1.0
          clr p2.0
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p0.0
          clr p1.1
          clr p2.0
          setb p1.0
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.1
          clr p1.2
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.2
          clr p1.3
          setb p0.1
          setb p1.2
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.3
          clr p1.4
          setb p0.2
          setb p1.3
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.4
          clr p1.5
          setb p0.3
          setb p1.4
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.5
          clr p1.6
          setb p0.4
          setb p1.5
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.6
          clr p1.7
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.7
          clr p3.0
          setb p0.6
          setb p1.7
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.7
          clr p3.1
          setb p0.7
          setb p3.0
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.6
          clr p3.2
          setb p2.7
          setb p3.1
          call delay
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.5
          clr p3.3
          setb p2.6
          setb p3.2
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p1.0
          clr p2.0
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p0.0
          clr p1.1
          clr p2.0
          setb p1.0
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.1
          clr p1.2
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.2
          clr p1.3
          setb p0.1
          setb p1.2
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.3
          clr p1.4
          setb p0.2
          setb p1.3
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.4
          clr p1.5
          setb p0.3
          setb p1.4
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.5
          clr p1.6
          setb p0.4
          setb p1.5
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.6
          clr p1.7
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.7
          clr p3.0
          setb p0.6
          setb p1.7
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.7
          clr p3.1
          setb p0.7
          setb p3.0
          call delay
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p2.6
          clr p3.2
          setb p2.7
          setb p3.1
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p1.0
          clr p2.0
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p0.0
          clr p1.1
          clr p2.0
          setb p1.0
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.1
          clr p1.2
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.2
          clr p1.3
          setb p0.1
          setb p1.2
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.3
          clr p1.4
          setb p0.2
          setb p1.3
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.4
          clr p1.5
          setb p0.3
          setb p1.4
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.5
          clr p1.6
          setb p0.4
          setb p1.5
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.6
          clr p1.7
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          clr p3.2
          clr p2.6
          clr p3.3
          clr p2.5
          clr p3.4
          clr p2.4
          clr p3.5
          clr p2.3
          clr p3.6
          clr p2.1
          clr p3.7
          clr p2.0
          clr p0.7
          clr p3.0
          setb p0.6
          setb p1.7
          call delay
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p3.1
          mov p2, #00000000b
          setb p0.7
          setb p3.0
          call delay
          clr p3.1
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p1.0
          mov p2, #00000000b
          call delay
          clr p3.1
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p0.0
          clr p1.1
          mov p2, #00000000b
          setb p1.0
          call delay
          clr p3.1
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p3.1
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p0.2
          clr p1.3
          mov p2, #00000000b
          setb p0.1
          setb p1.2
          call delay
          clr p3.1
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p0.3
          clr p1.4
          mov p2, #00000000b
          setb p0.2
          setb p1.3
          call delay
          clr p3.1
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p0.4
          clr p1.5
          mov p2, #00000000b
          setb p0.3
          setb p1.4
          call delay
          clr p3.1
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p0.5
          clr p1.6
          mov p2, #00000000b
          setb p0.4
          setb p1.5
          call delay
          clr p3.1
          clr p3.2
          clr p3.3
          clr p3.4
          clr p3.5
          clr p3.6
          clr p3.7
          clr p0.6
          clr p1.7
          mov p2, #00000000b
          setb p0.5
          setb p1.6
          setb p0.7
          call delay
          mov p2, #00000000b
          mov p3, #00000000b
          clr p0.7
          setb p0.6
          setb p1.7
          call delay
          clr p0.7
          clr p1.0
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          clr p0.7
          clr p0.0
          clr p1.1
          mov p2, #00000000b
          mov p3, #00000000b
          setb p1.0
          call delay
          clr p0.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p0.7
          clr p0.2
          clr p1.3
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.1
          setb p1.2
          call delay
          clr p0.7
          clr p0.3
          clr p1.4
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.2
          setb p1.3
          call delay
          clr p0.7
          clr p0.4
          clr p1.5
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.3
          setb p1.4
          call delay
          clr p0.7
          clr p0.5
          clr p1.6
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.4
          setb p1.5
          call delay
          clr p0.7
          clr p0.6
          clr p1.7
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.5
          setb p1.6
          call delay
          clr p1.7
          clr p0.6
          clr p0.7
          clr p1.0
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.0
          clr p1.1
          mov p2, #00000000b
          mov p3, #00000000b
          setb p1.0
          call delay
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.2
          clr p1.3
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.1
          setb p1.2
          call delay
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.3
          clr p1.4
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.2
          setb p1.3
          call delay
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.4
          clr p1.5
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.3
          setb p1.4
          call delay
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.5
          clr p1.6
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.4
          setb p1.5
          call delay
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p1.0
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.0
          clr p1.1
          mov p2, #00000000b
          mov p3, #00000000b
          setb p1.0
          call delay
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.2
          clr p1.3
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.1
          setb p1.2
          call delay
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.3
          clr p1.4
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.2
          setb p1.3
          call delay
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.4
          clr p1.5
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.3
          setb p1.4
          call delay
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p1.0
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.0
          clr p1.1
          mov p2, #00000000b
          mov p3, #00000000b
          setb p1.0
          call delay
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.2
          clr p1.3
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.1
          setb p1.2
          call delay
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.3
          clr p1.4
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.2
          setb p1.3
          call delay
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p1.0
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.0
          clr p1.1
          mov p2, #00000000b
          mov p3, #00000000b
          setb p1.0
          call delay
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.2
          clr p1.3
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.1
          setb p1.2
          call delay
          clr p1.3
          clr p0.2
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p1.0
          clr p2.0
          mov p2, #00000000b
          mov p3, #00000000b
          call delay
          clr p1.3
          clr p0.2
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.0
          clr p1.1
          mov p2, #00000000b
          mov p3, #00000000b
          setb p1.0
          call delay
          clr p1.3
          clr p0.2
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p1.2
          clr p0.1
          clr p1.3
          clr p0.2
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          mov p3, #00000000b
          setb p0.0
          setb p1.0
          setb p1.1
          call delay
          clr p1.1
          clr p0.0
          clr p1.2
          clr p0.1
          clr p1.3
          clr p0.2
          clr p1.4
          clr p0.3
          clr p1.5
          clr p0.4
          clr p1.6
          clr p0.5
          clr p1.7
          clr p0.6
          clr p0.7
          clr p0.1
          clr p1.2
          mov p2, #00000000b
          mov p3, #00000000b
          setb p1.0
          call delay
          mov p1, #00000000b
          mov p2, #00000000b
          mov p3, #00000000b
          mov p0, #00000000b
          call delay
          mov p0, #11111111b
          mov p1, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          call delay
          ret
          ;
          xoa:
          mov p0, #11111111b
          mov p1, #11111111b
          mov p2, #11111111b
          mov p3, #11111111b
          ret
          delay:
          mov r7, #2
          v_6: mov r6, #100
          v_5: mov r5, #200
          djnz r5, $
          djnz r6, v_5
          djnz r7, v_6
          ret
          end
          cho e này vô MIDE dịch ra và nạp vô thui....

          Comment


          • #50
            Mình không học và làm với ASM tuy là nếu muốn thì OK ngay. Không có gì chứng minh là học ASM thì sau này học C sẽ tốt hơn.

            Comment


            • #51
              tình hình giờ em đang học vdk ho 89 .hợp ngữ assembly.giờ e nhớ hết lệnh nhưng không thể viết 1 chương trình hoàn chỉnh .có bác nào chỉ em cụ thể để e viết những chương trình đơn giản được ko.e sắp thi rồi

              Comment


              • #52
                Mọi người làm giúp mình với, thank all mình đang gấp !!!
                Hãy viết đoạn chương trình thực hiện nội dung sau: liên tục đọc số xung đưa đến chân To của vi điều khiển 89c51 và đưa số xung ra cổng P1, giả sử số xung N<256 trong khoảng thời gian nhấn START, STOP đưa đến INTo

                Comment

                Về tác giả

                Collapse

                dtsMoNo2 Tìm hiểu thêm về dtsMoNo2

                Bài viết mới nhất

                Collapse

                Đang tải...
                X