Qhov Tseem Ceeb Qhov Sib Txawv - Tshuab Lus vs Cov Lus Sib Tham
Cov lus programming tso cai rau tib neeg los tsim cov lus qhia rau lub computer ua haujlwm. Muaj peb hom lus programming xws li High-level programming languages, Assembly language, thiab Machine languages. Cov lus programming qib siab yooj yim rau tib neeg nkag siab. Lus lees paub los ntawm lub khoos phis tawj yog lub npe hu ua tshuab lus. Cov lus sib dhos yog cov lus ntawm cov lus siab thiab lus tshuab. Qhov sib txawv tseem ceeb ntawm cov lus tshuab thiab cov lus sib dhos yog tias, cov lus tshuab ua haujlwm ncaj qha los ntawm lub khoos phis tawj thiab cov lus sib dhos yuav tsum muaj lub tshuab sib dhos los hloov mus rau lub tshuab code lossis cov khoom siv los ua haujlwm los ntawm CPU.
tshuab lus yog dab tsi?
Tib neeg tuaj yeem nkag siab cov lus hais lus siab. Nws tsis yog qhov tsim nyog kom muaj kev nkag siab tob txog CPU sab hauv, mus rau qhov program siv cov lus siab. Lawv ua raws li syntax zoo ib yam li lus Askiv. Java, C, C ++, Python yog qee cov lus programming siab. Lub khoos phis tawj paub cov lus siv tshuab tab sis tsis nkag siab cov lus siab. Yog li ntawd, cov kev pab cuam yuav tsum tau hloov mus rau lub computer to taub hais lus tshuab. Qhov kev txhais lus no yog ua tiav siv tus sau los yog tus neeg txhais lus.
Daim duab 01: Tshuab Lus ntawm Zeros thiab Ones.
Ib hom lus muaj cov lej binary uas yog xoom thiab ib zaug. Lub computer yog cov khoom siv hluav taws xob digital, yog li nws siv binary rau kev ua haujlwm. Ib qho qhia txog lub xeev tseeb / ntawm lub xeev thaum xoom qhia lub xeev tsis tseeb / tawm xeev. Txoj kev ntawm kev hloov ib qho kev pab cuam los ntawm cov lus qib siab mus rau cov lus tshuab yog nyob ntawm CPU.
Kev Sib Tham Lus yog dab tsi?
Cov lus sib dhos yog cov lus nruab nrab ntawm cov lus hais lus siab thiab lus tshuab. Nws yog ib theem siab tshaj tshuab lus. Cov lus sib dhos yooj yim nkag siab dua li cov lus siv tshuab tab sis nyuaj dua li cov lus programming qib siab. Cov lus no tseem hu ua hom lus qis vim tias nws nyob ze rau qib kho vajtse. Txhawm rau sau cov kev pabcuam zoo siv los ua ke, tus programmer yuav tsum muaj kev nkag siab zoo ntawm lub computer architecture thiab cov qauv sau npe. Ib tug tshwj xeeb compiler hu ua ib tug assembler yog siv los hloov cov lus qhia los ua ke rau tshuab code los yog khoom code.
Cov lus hais lus sib dhos muaj plaub ntu. Lawv yog ib daim ntawv lo, mnemonic, operand, tawm tswv yim. Daim ntawv lo thiab cov lus pom yog xaiv tau. Mnemonic yog cov lus qhia rau kev ua thiab operands yog cov tsis rau cov lus txib. Cov lus sib dhos kuj txhawb macro. Lub macro tuaj yeem txhais tau tias yog cov lus qhia nrog lub npe. Nws tuaj yeem siv rau lwm qhov hauv qhov program.
Qee yam piv txwv ntawm Cov lus hais los ua ke yog raws li hauv qab no.
MOV SUM, 50 - Cov lus qhia no, theej tus nqi 50 rau qhov sib txawv SUM.
ADD VALUE1, 20 - Qhov no yog ntxiv 20 rau qhov sib txawv VALUE1
ADD AH, BH - Cov lus qhia no yog luam cov ntsiab lus hauv AH rau npe rau BH sau npe.
INC COUNT - Qhov no yog txhawm rau nce qhov sib txawv COUNT los ntawm ib qho.
AND VALUE1, 100 - Qhov no yog ua haujlwm THIAB ua haujlwm ntawm qhov sib txawv VALUE1 thiab 100.
MOV AL, 20 - Qhov no yog luam tus nqi 20 rau AL register
Daim duab 02: Ib qho Kev Pabcuam sau siv Cov Lus Sib Tham
Txoj Kev Sib Tham Cov Lus Qhia yog ib qho kev sib koom ua ke. Nws tuaj yeem pom tias cov lus sib dhos yooj yim dua li cov lus siv tshuab. Nws muaj syntax zoo ib yam li lus Askiv. Cov lus sib dhos muaj nyob ib ncig ntawm peb caug cov lus qhia. Lub cim xeeb xav tau thiab lub sijhawm ua tiav yog qhov tsawg kawg yog piv rau cov lus qib siab.
Hauv lub sijhawm tiag tiag, tuaj yeem muaj cov xwm txheej uas xav tau CPU ua tam sim. Cov xwm txheej no yog cov txheej txheem tshwj xeeb hu ua Interrupt service routine (ISR). Cov lus sib dhos yog pab tau rau kev ua haujlwm ISR.
Dab tsi yog qhov zoo sib xws ntawm Tshuab Lus thiab Lus Sib Tham?
Ob hom lus tshuab thiab lus sib dhos muaj feem cuam tshuam rau qib kho vajtse
Dab tsi ntawm Tshuab Lus thiab Lus Sib Tham?
Machine Language vs Assembly Language |
|
Machine language yog hom lus qis tshaj plaws uas cov lus qhia ua ncaj qha los ntawm CPU. | Cov lus sib dhos yog hom lus qis qis uas yuav tsum muaj lub tshuab sib dhos los hloov mus rau lub tshuab code / khoom code. |
Kev nkag siab | |
Machine language is comprehensible to the computers xwb. | Cov lus sib dhos yog nkag siab rau tib neeg. |
Syntax | |
Ib hom lus muaj cov lej binary. | Cov lus sib dhos ua raws cov lus sib dhos zoo ib yam li lus Askiv. |
Kev vam meej | |
Tshuab hom lus txawv nyob ntawm lub platform. | Cov lus sib dhos muaj cov txheej txheem cov lus qhia. |
Applications | |
tshuab lus yog tshuab code. | Cov lus sib dhos yog siv rau microprocessor-based, lub sijhawm tiag tiag. |
Summary – Machine Language vs Assembly Language
Qhov txawv ntawm cov lus tshuab thiab cov lus sib dhos yog cov lus tshuab tau ncaj qha los ntawm lub khoos phis tawj thiab cov lus sib dhos yog hom lus qis qis uas yuav tsum muaj cov khoom sib dhos los hloov mus rau cov lej lossis tshuab code. Lus sib dhos yog ib kauj ruam ua ntej ntawm tshuab lus. Cov lus sib dhos yog ib hom lus zoo tshaj plaws rau cov kev pab cuam microcontroller raws li systems. Cov lus no kuj muab kev nkag siab zoo txog qhov CPU ua haujlwm li cas thiab hais txog cov khoom siv sab hauv ntawm lub computer.
Download the PDF Version of Machine Language vs Assembly Language
Koj tuaj yeem rub tawm PDF version ntawm kab lus no thiab siv nws rau offline hom phiaj raws li daim ntawv ceeb toom. Thov download PDF version ntawm no Qhov txawv Ntawm Tshuab Lus thiab Cov Lus Sib Tham
Image Courtesy:
1.'Machine language'By Turkei89 - Tus kheej ua haujlwm, (CC BY-SA 3.0) ntawm Commons Wikimedia
2.'Zstr suav x86 sib dhos' Los ntawm OldCodger2, (Public Domain) ntawm Commons Wikimedia