Wince5 Code Collation

Source: Internet
Author: User

BAT file Syntax:

@REM  This is the difference between the annotation identity and REM, which is that the REM comment will also be displayed at Echo on . @rem  Set Variable bsp_smdk2416 to 2  set bsp_smdk2416=2@REM  sets another variable to be assigned a value of bsp-smdk2416set bsp_type=%bsp_ smdk2416%@REM  judgment statement,/I is a case insensitive if /i "%bsp_smdk2416_cfg%" = = "1" (set bsp_nohsmmc_ch0=Set bsp_nohsmmc_ch1=set bsp_hsmmc_ch1_8bit=)

assembly file Syntax:

;This is the comment IDINCLUDE kxarm.h;include configuration FilesINCLUDE s3c2416.Inc        ;include configuration FilesPTs EQU 0x30010000;define PTS as 0x30010000
TEXTAREA;Defining code Areas
END; corresponds to the textarea above
IMPORT Main;introducing an external function interface
Leaf_entry StartUp;function entry indicated by source file, scrutiny, empty
Entry_end; corresponds to the above leaf_entry XXX

1b Resethandler B%b1;without a return jump,%b1 means jump to the previous label 1 ;Unlike BL,BL, which has a return address. ;Unlike%f1,%f1, which indicates a jump to the back of the label 1movR0, #0 ;Pass the immediate number 0 to the register r0

 [bsp_type = bsp_smdk2416 ldr r0, =vintbase1 mvn R2, #  0   R2, [R0, #oINTMSK1]  str   R2, [R0, #oSRCPND1]  str  
    
      R2, [R0, #oINTPND1] Ldr r0, =vintbase2 mvn R2, #  
     0 
     str  
      R2, [R0, #oINTMSK2]  
     str  
      R2, [R0, #oSRCPND2]  
     str  
     
       R2, [R0, #oINTPND2]]  
        
     
    

Several code:

//1#defineINPORT32 (x) read_port_ulong (x)//#defineOUTPORT32 (x, y) Write_port_ulong (x, (ULONG) (y))////2#defineINREG32 (x) read_register_ulong (x)//#defineOUTREG32 (x, y) Write_register_ulong (x, (ULONG) (y))

//Access fixed memory address in C language#defineRead_register_ulong (REG) (* (Volatile unsigned long * const) (REG))//Convert reg to unsigned long static variable pointer type data, access this address through *#defineWrite_register_ulong (Reg, Val) (* (Volatile unsigned long * const) (reg)) = (val)//

Four-byte aligned compilation:

#pragmaPack (4)//set to 4-byte alignmenttypedefstruct_batterystatus_tag {system_power_status_ex2 sps;        WORD Wmainlevels;        WORD Wbackuplevels;        BOOL Fsupportschange; BOOL fchanged;} Battery_status,*Pbattery_status;#pragmaPack ()//Restore default Alignment/*=========================================================================================================== ============ #pragma pack (n): Each compiler on a particular platform has its own default "alignment factor" (also known as Zimo number). Programmers can change this factor by precompiling the command #pragma pack (n), where n is the "alignment factor" you want to specify. If n in #pramga pack (n) is greater than the number of bytes occupied by any member of the struct member, the n value is invalid. The compiler chooses the number of bytes of the largest data member in the struct as the basis for its memory byte alignment mechanism, in order to minimize the number of memory reads. The CPU reads faster than the memory read speed at least one order of magnitude, to save the operation takes time, will sacrifice the space to exchange the time. When storing, see if the next member can be stored in the same aligned byte as the current member, and if not, open another byte of alignment space. =============================================================================================================== ===========*/

Ce find DLL inside function output address:

//get pointers to file-mapping functions loads the specified dynamic-link library and maps it to the address space used by the current process. Once loaded, you can access the resources saved in the libraryHicoredll = LoadLibrary (_t ("Coredll.dll"));if(Hicoredll! =NULL) {   The//getprocaddress function retrieves the address of the output library function in the specified dynamic-link library (DLL)    
Gpfncreatefilemappingw = (PFN_CREATEFILEMAPPINGW) GetProcAddress ((hmodule) Hicoredll, _t ("Createfilemappingw"));
Gpfnmapviewoffile = (pfn_mapviewoffile) GetProcAddress ((hmodule) Hicoredll, _t ("MapViewOfFile"));
Gpfnunmapviewoffile = (pfn_unmapviewoffile) GetProcAddress ((hmodule) Hicoredll, _t ("UnmapViewOfFile"));} FreeLibrary (Hicoredll); //we ' re already linked to Coredll

Wince5 Code Collation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.