Qhov txawv ntawm Assembler thiab Compiler

Qhov txawv ntawm Assembler thiab Compiler
Qhov txawv ntawm Assembler thiab Compiler

Video: Qhov txawv ntawm Assembler thiab Compiler

Video: Qhov txawv ntawm Assembler thiab Compiler
Video: tuav wb lub neej kom ruaj khov - Mang Vang ft. Christina Xyooj [Official Audio] 2021-22 2024, Kaum ib hlis
Anonim

Assembler vs Compiler

Feem ntau, compiler yog ib qho khoos phis tawj uas nyeem cov program sau ua ib hom lus, uas yog hu ua hom lus, thiab txhais ua lwm hom lus, uas yog hu ua hom lus. Kev lig kev cai, hom lus yog hom lus siab xws li C ++ thiab hom lus yog hom lus qis xws li Lus Sib Tham. Txawm li cas los xij, muaj cov compilers uas tuaj yeem hloov qhov kev pab cuam sau ua lus los ua ke thiab hloov nws mus rau lub tshuab code lossis cov khoom code. Assemblers yog cov cuab yeej zoo li no. Yog li, ob qho tib si assemblers thiab compilers thaum kawg tsim cov cai uas tuaj yeem ua ncaj qha rau ntawm lub tshuab.

Compiler yog dab tsi?

Compiler yog lub khoos phis tawj uas nyeem cov program sau ua ib hom lus, uas yog hu ua hom lus, thiab txhais ua lwm hom lus, uas yog hu ua hom lus. Feem ntau, cov lus hauv paus ntsiab lus yog hom lus siab thiab hom hom lus yog hom lus qis. Yog li, feem ntau compilers tuaj yeem pom tau tias yog cov neeg txhais lus uas txhais los ntawm ib hom lus mus rau lwm tus. Tsis tas li ntawd, compilers ua ib co optimization rau cov cai. Ib tug raug compiler yog tsim los ntawm ob peb yam tseem ceeb. Thawj feem yog lub scanner (tseem hu ua lexical analyzer). Scanner nyeem qhov program thiab hloov nws mus rau ib txoj hlua ntawm tokens. Qhov thib ob feem yog parser. Nws hloov cov hlua ntawm tokens rau hauv ib tsob ntoo parse (lossis ib tsob ntoo paub daws teeb), uas ntes cov qauv syntactic ntawm qhov program. Cov txheej txheem tom ntej yog cov txheej txheem semantic uas txhais cov semantics ntawm cov qauv syntactic. Txoj cai optimizations thiab kawg code tiam ua raws li qhov no.

Dab tsi yog Pawg Sib Tham?

Assembler yog software lossis lub cuab yeej uas txhais lus los ua ke rau lub tshuab code. Yog li ntawd, ib tug assembler yog ib hom ntawm ib tug compiler thiab lub hauv paus code yog sau nyob rau hauv Assembly lus. Kev sib dhos yog ib hom lus uas tib neeg nyeem tau tab sis nws feem ntau muaj ib qho kev sib raug zoo nrog cov lej sib txuas ntawm lub tshuab. Yog li ntawd ib tug assembler tau hais tias ua isomorphic (ib rau ib daim ntawv qhia) txhais lus. Advanced assemblers muab cov yam ntxwv ntxiv uas txhawb kev txhim kho thiab kev debugging txheej txheem. Piv txwv li, hom assemblers hu ua macro assemblers muab lub chaw macro.

Qhov txawv ntawm Assembler thiab Compiler yog dab tsi?

Compiler yog ib qho khoos phis tawj uas nyeem cov program sau ua ib hom lus thiab txhais ua lwm hom lus, thaum lub assembler tuaj yeem suav tias yog hom tshwj xeeb ntawm compiler uas txhais tsuas yog lus Assembly rau tshuab code. Compilers feem ntau tsim lub tshuab executable code ncaj qha los ntawm cov lus theem siab, tab sis cov neeg sib sau ua ke tsim cov khoom code uas yuav tsum tau txuas nrog cov kev pab cuam linker thiaj li khiav ntawm lub tshuab. Vim hais tias cov lus sib dhos muaj ib qho rau ib daim ntawv qhia nrog lub tshuab code, cov khoom sib dhos yuav raug siv los tsim cov lej uas ua haujlwm tau zoo rau lub sijhawm uas qhov kev ua tau zoo tseem ceeb heev (xws li cov duab kos duab, cov tshuab kos nrog cov khoom siv tsawg dua piv rau tus kheej lub computer. xws li microwaves, tshuab ntxhua khaub ncaws, thiab lwm yam).

Pom zoo: