sharpapple:
;给你个汇编渐变程序,(汇编的就是麻烦,现在都用C啦);PORTMACRORPORTbitP1.0GPORTbitP1.1BPORTbitP1.2;colorMACROREDequ1GRNequ2R_Gequ3G_Requ3BLUequ4R_Bequ5B_RequR_BG_Bequ6B_GequG_BWHTequ7DRKequ0;parametermacroJBSPDequ10H;speed;varavaileinprocessP_JianbianvJB_color1data31H;color1vJB_color2data32H;color2vJB_speeddata33H;speed,255forslowest,1forfastestvJB_c1data34H;counter1vJB_c2data35H;counter2vJB_idata36H;tempvar;varavaileinprocessP_DelayvDL_delaydata37H;resetORG0000HJMPSTART;SPACE FORINTERRUPT;main();ORG0030HSTART:MOVSP,#60HL_ST0:MOVvJB_speed,#JBSPDL_ST1:MOVvJB_color1,#REDMOVvJB_color2,#R_GacallP_Jianbian MOVvJB_color1,#R_GMOVvJB_color2,#GRNacallP_JianbianMOVvJB_color1,#GRNMOVvJB_color2,#G_BacallP_JianbianMOVvJB_color1,#G_BMOVvJB_color2,#BLUacallP_JianbianMOVvJB_color1,#BLUMOVvJB_color2,#R_BacallP_JianbianMOVvJB_color1,#R_BMOVvJB_color2,#REDacallP_JianbianDJNZvJB_speed,L_ST1;fasterspeedAJMPL_ST0P_Jianbian:MOVvJB_c1,#0xFEMOVvJB_c2,#0x01L_JB1:MOVvJB_i,vJB_speedL_JB2:MOVA,vJB_color1RRCAMOVRPORT,CRRCAMOVGPORT,CRRCAMOVBPORT,CMOVvDL_delay,vJB_c1acallP_DelayMOVA,vJB_color2RRCAMOVRPORT,CRRCAMOVGPORT,CRRCAMOVBPORT,CMOVvDL_delay,vJB_c2acallP_DelayDJNZvJB_i,L_JB2INCvJB_c2DJNZvJB_c1,L_JB1RETP_Delay:DJNZvDL_delay,$RETEND