0% found this document useful (0 votes)
19 views

Doc

Uploaded by

SB
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
19 views

Doc

Uploaded by

SB
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 29
09 Compule languagé a 1 I tt ane’ High-level |, Assembly Language 7 , Machine language ‘dle level ) —> PPK, (Low level) (ete age ~collethion of Mneumonicg ose 5, > On hos, > Binary digits MOV cy, Ax ut 7 1900100, ADD AX, By d = path (ass NOolloo s fi bias SCang Cele assembler Bor, FORTRAN FAscaL CRchy NET Tava Compiler, F Unf ying rm tekine level peogaams + A prEgsam consists of Sequene of brie codes j-e. ‘0 and "1 °S Catted Machine evel Peogeam. ; B raithite (05) cormputen understands only Cand V sit is difficult to Memosize Sequence ef 0’ andj: > TE iS 0 dow level language. mailioe codfrg the pag sams ac!) Mov. BLycL Finding out Macine de fog above | instruction. rece fo Pw] mot | eg [Ri | 6-bit MOV —s0Ptade —9 100010 = Dg Dg Dy D3 Da D, D-sDyvettion > | — Direttin jg to the Regicten. W> WT > O + EE iS @_brE OPeaLion. ™Mob->» Reg ~ Reg Poanshen —> 1 Rim > * Boll ~» sowvre Registen. Req Oo] ~> Ddesbnatisn Register. 1t loo. 8 —~-os = Gee Displacement low ordex Displace ment 80th ee high ordey Oisplacomarts *8 is eeated 05° Rog Fl ae “Steps _lovelving ci) PaDgaroming aan as A ') Specifying the Paotlem, s- Find Out —cohich ba2xK is bo be penfosmedt. %) Besigning and problem, souitiod =)!” =o rien ie The step by step Process that 13 bo be folldwap 19 (bi! 1 we has and coéten Adcom vad ¢ geaio yShuye 3) coding :- eyounet Ov py mide Temple mentation’ Fegins ustth this coding papas coding meons to tell the, pancossoy that exact Shep by Step by Poocess in its language, W) Debugging +. oobuging is the process og testing the cade | IP poogoam is nob wowing Papert, F Debbugng a helps in Fincling and Cowsecting Sor, hy Ovel — Stare and Stop operation —_— C2200 > Flow with clitecion , ao A Poratlelogoam > input fourput Operation ; [| Rectangle — > process operation Diamond — Pecision Making ¢ ion Te Pouble sideded) Rectangle > 21eCULHon ‘,. @ ! of SUubwutine 74) | —7 Gocle ith alphabet, Continuation | ) gnatsuctrons whith ig and convents thern indo covitten 10 assembly language. = iy tg quiet -undenstandable by a marbing ie which iS hy system. i Assembly language (erh¥emonics) Assembler > Manchine eg ~ Cy (Counce Gde) a ‘Dbjew os . -PThis objet Code ‘modules ay foun toi fil 7 vex ee using the Linker and Ioaden PoDgoams , This type of Pangabennitg #5 od) mac, Paoqpamming # OMY tev [Bounce Coie }—> [center Compi by io PRADarm Hovelopeners and edecutisn ties OOVOUIS SOUR Ete Into acermbly ole. | i : Inneuroonics \ psseoble! — Conyorts Assembly Cone ino objed Code, Gme Requised bo conven Assernty code Lo obeu. Cole 13 Cather assemble & & fe syntax exons Mg objet Cole modulo. PEE ee rncdul objet Coxe moduso contains the Infos mation obous Ghene the Padgoorn os srodul We 40 be loaded in Meron yen Links alt the funchions and fi the objou codo and cocuoxts the o} edecutable Cede, “The comextal code 18 stoned in "Qe extension. Sihe Voren giver eons if the fle os Funition that hos bo be linked doves noe exisg, "Times Link Hime les sequised by Wet cle io padon z- “Zk 18 -seaponsible for loading Papgears . S16 places poogeoms into memory and Poepares tery fos execurion i "San-time evoxl Pearoas in this Stage iS catted "Van-tig Rs “Time" —» Load Time 7 loading poo grams Saeeaon The exeue He Progimag cade pooqtam into systern memory , exectate Paogoam and debug it the jecerably orquage example pagypems /+ Es addition of tuo Ie-biE, S-bIE Number J SubmOtON — OF two Ip-biE, e-bit MUMbaS = ascending and descending axon 3nd 04E Maximum, Minimum and awerage inure : i 2 Find our Stoing length, ' Palindaorne os nok severse a string, Stack steuckune of: , 6e8b “Shack Ogonization :- Stack ; shack iS a Stosnge Sheuutuste that stoses, tnsmarirr, Such ausay that LIFO (Lasb-in - Fist out), Stack in digital Compulers is a qpeuep of mano locations with a vegies thea: helds, the addxeés of top of dlemen Stack poled + the wexsben thar holds the aibaes of tp, element of the stack, aed ee ee a ee +. Stack operations | NS PusH Pop Inset an zbem Deletes an hem The, Else Stack irnplementar 4 ™, Registen stock Memon Store, = Finite number of Registers ~? accessing o Powbicn of mem ,2 8086 . y 55 9 stalk Semen Reqister is used to Save Strep data | tnich Polds 64 LB. size SP? SOLE Pointer Gohich -bit Tegislen used a8 OFfse, | address Regigtey ay Stau Segment SS Register, = oss, Can Caleutare Stack Top silat gigs = 5000 , SP= 2050.4. ' (Bose Volue) CofE set Value) i 1 fi Physical addness = (aan value > aa p [Reel ates = Bar aig + Offset value 000% Io + 050 AX aq25 Aw AH CAL i mai Jy 8086, FO push operation

Oecvemented by 2. i Fos pop operation §=sp > incsemented by a3 ‘ i Rowu'nes CH mvice ‘Tntcseupbs and antewuph S20 pases ee hs Inte: Stead uph iS a method, oF eccking pad Sts - Bernporary halt dusdng program edecurt'on and AANeyy, iCop processor peruphenat devias bo access the miton p Sp sesponds 60 Ehatt ingewoupl with an TSR (iotoourp_ Service _Rowbine) , whieh % a Shot progam, Go tnetru the «wp ba ‘on how bo hancite the lotensupb - ‘Interaupbs ve a SOP Hardwane ware ; (256) inernupys MasKable Non-Maskable Co- 255) (wma) Hardware intensuphs :- these ane causal by ang peaphena) dear Signal Uraough a spect fed Pin bo the | up Two Hasdivose inleoupe ping) , a NMI > pon Maskable INTR > Interop NML >> Ire Interupy) Prioity . Sendirig a 3086 gofbware (Olewsupis s- sorne instautions ane sea ke g By tte dosed position into the poogpor bo coeote yore soup . these WIODLUPE —instoudions axe used bo teab the woscirg of | Vorutous ioe pe handlers. ure 4) 2,3, q, oe opt vettos table G66 Supposts 256 inteooupts 00 - FF, each Inteteups “four bylea too byles fos 3p and cs. stota} 102u Pate wequised 2.56 iokrsupls | [sR EP—— 0000 begpacif divide brio si bal tt ASR_CS (0000 + 0002 TSR LP lo000 : owy "We! Ub sens lose ie Ste ne ‘Tere 21} see pbc : : ogon mz aS = ee a es OF TOF 4 — $e ee oon. into {——____ i : \ + Dep | obo0 r004n) Tyre TI loodo : 00 Ciwoi2) Two bye ts THY Type Tyre een —T Od; O8 FF 3 Ml | Anteaups yute of 3086 > y she ' then cpp identifies an ‘ntewoupb, Cys /z ‘ ‘ NTR based on the Polarity it checks the ‘bit ° Enable (ZF) " tog 4 Mey 0 Hog Register, Se AN wp veuo# Tab, _ lost instruction TRer \ and contac! Go to the cpu afles caer ch fal and ageto CPU exetutes the instruction hod we ke i and Eakes stack data.to execute, x tS wrth in inte antewup TUES catted ax necked. sn Interop Be pan ning in) | B66 eto sead a sboing Foor Ube key Bowne, aust CoPren “Ue daraters (Mb “PPE case letters and display go the scseen Cort eNGugh messages displayed mm ypekwierd assume cSscede, ds: data data Segment msl db " entbex the Staing » OnH, col , '4" , 1'$, meq? db oah "the SoiiMg in Caps is'\4 4! es db 80 dup) dota ends code Segment Stavt MOV ar data mov ds .ax lea da, msg mov ah oh { paint a String) ink ath lea aba, sto mov stofbad, oah inc bz up: mov ah, ol int 21h cmp ab, oph Je Stop cmp aj, 6oH Je dwn Sub al, 20h fwotit unit] ey i5 poesced 7 dion: code end mov {bz}, al 4 inc bx 4 ' Jmp up. “ vir mov stoLbxJ, $1, mo Ax, offset sq 2 ™mMOU ah. 09h L paint a shang int ath mov Ax, offsek Ste i mov ah. oth Spatne a Sth int ath | iy" 44 vid fi mov ah. Gch fend the tool Seqment int 20h 1 ends Stast exarple _F Lotevsupts foding fepqzam yo end the Cale Seqrrent ) pov eacH > Sub Functions INT DH ® t881 BOB "Hello wnsid", "4" Lea Dr, MSG IP Content 1 looded Som 0x Regisien MOV AH, oH pain’ a Sing d INT atH 5) Mov AH, OAH I inpuk a Stang INT aH 4 I] Sotewsupt to cleas the seseen MOV AH, 00 MOV AL, 02 INT OH 3) I) inkeosupb G0 place the cunsoy Mov DH, lo Rov) MoV DL, 24 Nol Mov AH 02 Mov BH,0 PARE O IT 104 §)y Tntessupt bo wait Lnbil @ key 15 poeased , Mov AH,o} Int \6H -¢ paocedunes ;- {sub-soutines } , N { janes ke a PuNLBIog in High Level languas | hen you: Wank’ §0 Use Q particular ‘Sequence of \ utons i i A » pstaut M You PrDgram rmurtiple times Yeu, use parcedures . paocedunes iS called muuhiple bimes ia main Pore, ” psocedune iS implemented by using CALL and fer - instouthtons' 4 > pedue uses PRoc and Emp Assembler Disectyyes to define 9 Paoceduxe . - & procedure TyPes s~ a Types. D Neas prcdure. :~ i Tt 15 Situated within Lhe Sond degen. DFO Paocedune 5. af the Paoedwre is situated outside the Caaenh cide Segment. {itdetesea ap —7 Neos poomdure > fos parcedure memo x sp poinis bene befowe cai £Rer SP CALLE Rer 4p points hene ables CALL ‘SPARKS CALL fret (S Mo med to ingerk 65 3 5M et to Prwcedanes ¢- Posi pothmetess kp Pagaeton Yin Registas oF cpo § limited nit Parametes. D In dedicated memory locations actessed {Name Rese 3) with — pointers Passed jn Registers t mow 90-0F paren, 4) with the stack {PUSH + Pop} 5) Using dlobal declaned Vastiables . &) USing = PUBLIc 2 ExrRn). Assermbley Disectiveg)_ Advan tages = A } > Pavcedune % instantiated only once "ernogy ever PO OFAMn| though you call routtple Times in youx 2 Debugging 6 also done os one Time, ex! Paogvan) fox fas paowduie ‘— Pleat Leyrent assume css code | , pszdata) Data] Segment vata ends. ° Cod el Seqment ’ cost + Mov ax, dabal 101g mov ds, ax call fas -Ppte Roubne } cal) . fan-pts Routne 2 code | ends . Procedune soutine | fat Routine | endp procedune — wushne 2 fais goumne 2 ena End stavt Ar PDMgoam ox pagal pap assume = C53 code code Segment Stast + moy cedune , § In ase ment} AX, SSE5 H i Mov ba, HLH Calk pyocedune | procedure” Paocedune | nean ADD Ax BY s , RET ' Psocedune | enpp : code ends end Stagk . Mave ye Maso isa Qeoup OF insbuchans., , J The macso assembler genenales the coo in the Ping fur fach time chee the mace iS Catled'” o MaC20 can be det ned by Macro, aid eno ASSershy Diveuti voy. Example Meate a Maceo, , pe met TPIT macen MOV Ax @datg city MOV Ds Body oF macso definitiesy, mov €s,Ax EWPm —s end Macap Macao sequences executes fostey Ehene ane no “caue" Macz0 uithin a Mateo is called ‘nested Macon " the mocoo name or Macao deFniton used th the maton Pargsam bo wefex ty that Shing OF ing panomeers passed as pont of ler st CRE hich calls Macap , _— pikenetxe proceduxes pccessed by CALL and, Ret inSteucHon duoxing Paogzam execution Hene taxes lange Time 9 Machine code for instsuctigns is put only Once in the H ernoay Hence leas Menoy veguised between Pro~@dures and Macopg 1 Maceos Aceessed dustry Assernbly wrth name given to Macsp when defined Hence tares bss Time. = Machire Gde Fos instsuch'ong ohen Macao is is generated each hme Called. Hence moze Memagy Wouused Paamebkers Passed 3, pot Parameters can be passed) ta Registers, nemo gato oS Stack. OF Statement cohich ally Maceo | Timings at and peloys ¢~ 1 eoenales) Delay :- @v) Time peloy * _ thar separates! the tery oF tuo events especially in mechanical os electoonic co) Deloy toop9 :- Delay loops can be eseated. by Set ernpy Faget stakernent . a > every instsucton’ sogleives definite ee | OF ele Gycles fos its edecuhon . > the duration sequrred fos the execution oF insti) fan be used bo dexive the Yequised: deloys. > sf BP executing Sequene OF inSteuttlang, jE equives aq. time dination | tak is sum op atl th i e individual time ‘ ; i durations for ciecution of each ik. executing Time duration “Tock” instsuction -| TP) ‘gue <= inSteu hon - TH T- Time Period SS Insréuchan-3 03 t instouchon - 4 tp FAP “time wequivd = TDit TOrt TO3rT Fos delay, MP ages instey on exeushan Trot, ol Some Msteuntiany in loop, the deloy és generate | netrods bo gnencve lela ays Nop & instouthian 2 g-bit [ib Reg isker ag Counben 5 LO feneate delays: ‘ ppetornine the eta “cequised delay . ect the nsieuctians {oy delay loop. Ckeep eau data iN. Staur Vester) Find Out number of cloce stater sequised fry, etecuhon of the selected delay loop insteuchans, i Find out he period of loc Taenle pg ot whith bp is punning Cr). t Count N= Requined delay (14), Nin. = n+E fas ov] whee Ts clok State = numben of clock stater, Tquised, + 3p P f>-SuHz, the find T= 7 \ = 7T-Stale = arora = e — 200 Nec. ON 1 x Pmogitin for Aeloy \ Moy Bx. count —, load the deloy fount. Delay spec BX j Decwement count Jnz Delay : Repeat the loop» By mop Time delay of ayams, clock 6 S MHz Seat oy BX, ppuedtr DEZIh) a4 T-Stalg Nexk + Bec BX) hi Nop J JM2 Were ii Ret. | é. [avon = Ta | | 4 sf & SmHz | , le Bad = OsSLHE r= =O a ) Js) oot Be [D4 Ta Ac d= 240x163 “ T 09% 1656 SAYS p = ie 3h wt A Assanblyy leguage, prgsocnig ith 8 6 Machine bevel Prego ey machine “cading the Praga ss Peper, sith an Asim bi ASSemb ety Uriroge aarp. ® ack Stuutuxe Of gy) oe 86 -\ A Injeaupes and iolewrapt Semi fone Gite oft FOS VE or Tht | ~ ntemupt PORK am mi an . LFS 0. poe ate Macs Y* Tim; "Qs ond a2 \ j , \ gee oa

You might also like