|
My First 8051 Project wrote in Assembler Language for Winbond W78E58B in 2003: ORG 0000H LJMP START ORG 0040H START: ;MOV SP,#60H MOV A,#0FEH mov r3,#8H mov r4,#8h ROTATE: MOV P1,A ;to p1 RL A ;move left LCALL DELAY ;delay NOP djnz r3,ROTATE rotate2: rr a MOV P1,A lcall delay nop djnz r4,rotate2 lcall start DELAY: ;Delay Function about 1 second MOV R0,#0AH DELAY1: MOV R1,#00H DELAY2: MOV R2,#0B2H DJNZ R2,$ DJNZ R1,DELAY2 DJNZ R0,DELAY1 RET END | The microcontroller would control LEDs to light on one by one. My first AVR project wrote in Assembler Language for ATmel ATmega32L AVR in 2004: .include "m32def.inc" .def mpr=r16 ldi mpr,0xff out ddrb,mpr read: ldi zh,high(mytable<<1) ldi zl,low(mytable<<1) ;adiw zl,4 ;lpm ;MOV R24,R0 ; Copy LSB to 16-bit register ADIW ZL,4 ; Point to MSB in program memory LPM ; Read MSB of table value MOV R25,R0 ; Copy MSB to 16-bit register out portb,r25 rjmp read mytable: .dw 0XCF;0 .dw 0X03;1 .dw 0X5D;2 .dw 0X5B;3 .dw 0X93;4 .dw 0XDA;5 .dw 0XDE;6 .dw 0X43;7 .dw 0XDF;8 .dw 0XDB;9 | This program's function was very similar to the 8051 one's. Unfortunately, because of the several crashes and changes of my computer, the original code of my first VB6 program is lost. These programs or codes seem extremely simple, when I read them again after several years. However, they are priceless,and I can call them "The One where it all Began" :)
|