Doc
Doc
Oecvemented by 2. i Fos pop operation §=sp > incsemented by a3 ‘ iRowu'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 3086gofbware (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. snInterop 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 7dion: 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 Stastexarple _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 etto 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 stavtAr 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 TO3rTFos 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 3hwt 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