ebook img

Programming the 65816: Including the 6502, 65C02, and 65802 PDF

469 Pages·2007·1.675 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Programming the 65816: Including the 6502, 65C02, and 65802

Programming the 65816 Including the 6502, 65C02 and 65802 Distributed and published under COPYRIGHT LICENSE AND PUBLISHING AGREEMENT with Authors David Eyes and Ron Lichty EFFECTIVE APRIL 28, 1992 Copyright © 2007 by The Western Design Center, Inc. 2166 E. Brown Rd. Mesa, AZ 85213 480-962-4545 (p) 480-835-6442 (f) www.westerndesigncenter.com ret nnegCi snerDet seehWT Table of Contents )1 Chapter One ................................ ................................ ................................ .......... 12 stpe cgnnoiCmmar geograPu gynlabLm ecsissAaB ................................ ................................ .................. 12 srebm uyNraniB ................................ ................................ ................................ ................................ .................... 12 set yoBt nsit igBnipuorG ................................ ................................ ................................ ................................ ....... 13 yran i fBnooitatneserp elRamicedaxeH ................................ ................................ ................................ ................ 14 treeStcar aIhI CSeChAT ................................ ................................ ................................ ................................ ..... 15 ci gnoaLelooB ................................ ................................ ................................ ................................ ........................ 16 ldancAigoL ................................ ................................ ................................ ................................ ........................ 16 lacigorLO ................................ ................................ ................................ ................................ .......................... 17 ervOisul clxaEcigoL ................................ ................................ ................................ ................................ ........... 17 tnemel plmaocCigoL ................................ ................................ ................................ ................................ ........... 17 sreb mdueNngiS ................................ ................................ ................................ ................................ .................... 18 mr olFamic ensDirebm ugNnirotS ................................ ................................ ................................ ....................... 19 citem hrteitruApmoC ................................ ................................ ................................ ................................ ............ 20 gnimmarg orroPssecorporciM ................................ ................................ ................................ .............................. 20 egaug neanLihcaM ................................ ................................ ................................ ................................ .............. 20 e gyalubgmneasLsA ................................ ................................ ................................ ................................ ............ 22 egaugna Lylbmess An ignitirW ................................ ................................ ................................ ............................ 22 stpec ngonCimmarg ocriPsaB ................................ ................................ ................................ ............................... 23 s hnteaeP wntoeiBtceleS ................................ ................................ ................................ ................................ ...... 24 gnipooL ................................ ................................ ................................ ................................ .............................. 24 senituorbuS ................................ ................................ ................................ ................................ ......................... 24 )2 Chapter Two ................................ ................................ ................................ .......... 26 e r f2ueo0th5ct6etihcrA ................................ ................................ ................................ ............................ 26 erutceti hrcorsAsecorporciM ................................ ................................ ................................ ................................ 26 srets i 2ge0eh5RT6 ................................ ................................ ................................ ................................ ................ 26 rotalu meuhcTcA ................................ ................................ ................................ ................................ ................ 27 sretsig exRed nd Y IneXahT ................................ ................................ ................................ ............................... 29 retsi gseuRt aethST ................................ ................................ ................................ ................................ ............. 29 verbbA ................................ ................................ ................................ ................................ ................................ 30 emaN ................................ ................................ ................................ ................................ ................................ .. 31 retn ikoc PaethST ................................ ................................ ................................ ................................ ................ 31 retn umoaCrg oerhPT ................................ ................................ ................................ ................................ .......... 33 sedoM gnisserddA ................................ ................................ ................................ ................................ ................. 33 snoitcurtsnI ................................ ................................ ................................ ................................ ........................... 35 ngi smeeDt s2y 0Se5h6T ................................ ................................ ................................ ................................ ........ 38 gninilepiP ................................ ................................ ................................ ................................ ........................... 38 seu leatVyB-elpit lrfueoM dyrrOomeM ................................ ................................ ................................ .............. 39 tuptuO/t udpenpIpaM-yromeM ................................ ................................ ................................ ............................ 39 stpurretnI ................................ ................................ ................................ ................................ ............................ 39 ssec oSrOPMN ................................ ................................ ................................ ................................ ...................... 40 skriu Qdn asguB ................................ ................................ ................................ ................................ ................... 40 )3 Chapter Three ................................ ................................ ................................ ....... 41 e2 r0feuCoht5tc6etihcrA ................................ ................................ ................................ ......................... 41 erutcetih c2r0 ACe5h6T ................................ ................................ ................................ ................................ ........ 41 sedoM gnisserddA ................................ ................................ ................................ ................................ ................. 41 snoitcurtsnI ................................ ................................ ................................ ................................ ........................... 42 ssec oSrOPMC ................................ ................................ ................................ ................................ ...................... 42 skriu Qdn asguB ................................ ................................ ................................ ................................ ................... 42 )4 Chapter Four ................................ ................................ ................................ ......... 44 2 06de8 1nh5ee8at6rh5uT6tceti htcirBA-neetxiS ................................ ................................ ................... 44 2 ret nnegCi snerDet seehWT endooiMta l 2u:0ms5Eu6 tnaOt-SrewoP ................................ ................................ ................................ .. 45 e de ov :Mi 6rtn1 oai8esN5hs6Tec oxdr5eP6rutaeF-l leuhFT ................................ ................................ 45 retsige Rkna Bmargor PehT ................................ ................................ ................................ ................................ . 47 retsige Rkna Bata DehT ................................ ................................ ................................ ................................ ........ 48 retsi gee gRtacPe reihDT ................................ ................................ ................................ ................................ ...... 48 ret nki coeaPhtTS ................................ ................................ ................................ ................................ .................. 48 sretsi gxeeR d dnrnIoatalumuccA ................................ ................................ ................................ ........................ 48 sti Bneetxi Sdn athgi Eneewte Bsretsige RgnihctiwS ................................ ................................ ............................ 50 retsi gseuRt aethST ................................ ................................ ................................ ................................ ............... 50 618 5e6 h ntsoed ogMnisserd d2A0C56/2056 ................................ ................................ ................................ ........ 51 se dgonMisser d6d1A 8w5e6N ................................ ................................ ................................ .............................. 52 snoitcurtsnI ................................ ................................ ................................ ................................ ........................... 54 stpurretnI ................................ ................................ ................................ ................................ .............................. 55 e deovMi t2a0N 8e5h6T ................................ ................................ ................................ ............................. 55 e dnooMitalumE ................................ ................................ ................................ ................................ .................... 58 sretsi ge ednRooMitalumE ................................ ................................ ................................ ................................ .... 60 s eedv o inMdtonaiaNta l 2un0me5Ee6 wgtneiBhctiwS ................................ ................................ ............ 61 e deovMi tnoaotNital umm oEgrnfihctiwS ................................ ................................ ................................ .......... 61 e dnooMital ueomvtEi tma oNgrnfihctiwS ................................ ................................ ................................ .......... 61 skr i dusn Qga6u1B856/20856 ................................ ................................ ................................ ................... 62 )5 Chapter Five ................................ ................................ ................................ .......... 64 slia treeD h dt,nO Pa,EPRES ................................ ................................ ................................ .................... 64 ko osBi h nTdie srUelbmes seAhT ................................ ................................ ................................ ........................ 66 noita tsosNerddA ................................ ................................ ................................ ................................ ................... 68 )6 Chapter Six ................................ ................................ ................................ ............ 69 a tganDi v:osMelpm atxsEriF ................................ ................................ ................................ .................... 69 sretsi ggenRir odgtnnSaidaoL ................................ ................................ ................................ ............................. 71 sg asluFt asntnoSoitar eeprO o dtdnS aatfocoLeffE ................................ ................................ ............................ 73 kc a etghSnt ias tUganDivoM ................................ ................................ ................................ .............................. 73 Push ................................ ................................ ................................ ................................ ................................ .... 74 sretsig ex R5c6is ae BhgtnihsuP ................................ ................................ ................................ .......................... 76 Pull ................................ ................................ ................................ ................................ ................................ ..... 76 sretsig ex R5c6is ae BhgtnilluP ................................ ................................ ................................ ........................... 76 sretsig elRanoitid dsA’618 5e 6hgtnill ud PnganihsuP ................................ ................................ .......................... 78 sesserdd Aevitceff EgnihsuP ................................ ................................ ................................ ................................ 79 ll ud Pnhas ufsPoetubirt trAehtO ................................ ................................ ................................ ........................ 79 sretsig enReewt eaBt agDnivoM ................................ ................................ ................................ ........................... 79 srefsnarT ................................ ................................ ................................ ................................ ............................. 79 segnahcxE ................................ ................................ ................................ ................................ ........................... 86 yrom eooMtr egZnirotS ................................ ................................ ................................ ................................ ....... 86 se vkocMolB ................................ ................................ ................................ ................................ .......................... 87 )7 Chapter Seven ................................ ................................ ................................ ....... 89 s egdnoiMsserddAelpmiS ................................ ................................ ................................ .......................... 89 gnisse redtdaAidemmI ................................ ................................ ................................ ................................ .......... 90 gnisse redtduAlosbA ................................ ................................ ................................ ................................ ............. 92 gnisse r edtgdcaAePriD ................................ ................................ ................................ ................................ ......... 94 gnixednI ................................ ................................ ................................ ................................ ................................ . 95 gnisser d hdYt Aidwexed neItulos bd hAnXt aidwexed neItulosbA ................................ ................................ ... 98 gnisser d hdYt Aidwexed neIg atPcer id hDnXt aidwexed neIg atPceriD ................................ ........................ 101 gnisser drdoAtalumuccA ................................ ................................ ................................ ................................ .... 103 gniss edredidlApmI ................................ ................................ ................................ ................................ ............. 103 Stack ................................ ................................ ................................ ................................ ................................ .... 104 gnisser dtdcAeri de ngtIacPeriD ................................ ................................ ................................ ......................... 104 gnisser dg dneAotLulosbA ................................ ................................ ................................ ................................ .. 105 3 ret nnegCi snerDet seehWT gnisse rh d tXddiAewxe dgn nIeotLulosbA ................................ ................................ ................................ ........ 108 g ntocLeri den gItacPeriD ................................ ................................ ................................ ................................ ... 109 e vkocMolB ................................ ................................ ................................ ................................ .......................... 110 )8 Chapter Eight ................................ ................................ ................................ ...... 111 lort nwf oooeClhFT ................................ ................................ ................................ ................................ . 111 snoitcurt spnmIuJ ................................ ................................ ................................ ................................ ............... 112 gnih clnaanroBitidnoC ................................ ................................ ................................ ................................ ........ 114 g aol r F eednhZeot sganBihcnarB ................................ ................................ ................................ ..................... 115 ga lyFrr ae C hndtoes agBnihcnarB ................................ ................................ ................................ ................... 117 g aelvFita g eednhNeot sganBihcnarB ................................ ................................ ................................ .............. 118 g awloFlfr e evdnhOeot sganBihcnarB ................................ ................................ ................................ .............. 119 sehcn alraBnoiti d snfnoooCitatimiL ................................ ................................ ................................ .................. 119 gnihc nlaarnBoitidnocnU ................................ ................................ ................................ ................................ .... 119 )9 Chapter Nine ................................ ................................ ................................ ....... 122 snoit ccniutFemh tniIr-AtliuB ................................ ................................ ................................ ................. 122 noitpircseD ................................ ................................ ................................ ................................ ............... 122 tnemerce Ddn atnemercnI ................................ ................................ ................................ ................................ .. 123 citemht idreAn g:in soniUtcart b dunnSoaitiddA ................................ ................................ .............................. 127 nosirapmoC ................................ ................................ ................................ ................................ ......................... 130 citemh tdiernAgiS ................................ ................................ ................................ ................................ ............... 134 snosirapm odCengiS ................................ ................................ ................................ ................................ ............ 136 edoM lamiceD ................................ ................................ ................................ ................................ ..................... 137 )01 Chapter Ten ................................ ................................ ................................ ...... 139 snoitar enpoOitalupi ntdcainiMBagoL ................................ ................................ ................................ . 139 snoitcn ucFigoL ................................ ................................ ................................ ................................ ................... 139 DlNaAcigoL ................................ ................................ ................................ ................................ .................... 140 RlOacigoL ................................ ................................ ................................ ................................ ....................... 142 rO-evis ullaccxiEgoL ................................ ................................ ................................ ................................ ........ 143 noitalupinaM tiB ................................ ................................ ................................ ................................ ................. 145 seta tdsontRafihS ................................ ................................ ................................ ................................ ............... 146 )11 Chapter Eleven ................................ ................................ ................................ . 154 se dgonMisser dxdeAlp meohCT ................................ ................................ ................................ ............. 154 e gtacPe regihnDtitacoleR ................................ ................................ ................................ ................................ .. 155 snoitpmuss Aedo Mgnisserdd ArelbmessA ................................ ................................ ................................ ......... 156 gnisser d hdYt AidWexed ntIcerid neIg atPceriD ................................ ................................ .............................. 158 gnisser dtdcAeri dgnnIixe de ngtIacPeriD ................................ ................................ ................................ ......... 161 gnisser dtdcAeri ddneIxe dentIulosbA ................................ ................................ ................................ ............... 163 gnisse rh d tYddiAewxe dgn nItocLeri den gItacPeriD ................................ ................................ ...................... 165 gnisse redvdiAt aklceaRtS ................................ ................................ ................................ ................................ .. 166 gnisser dddeAxe dtncIeri denvIita lkecRatS ................................ ................................ ................................ ...... 168 snoitcurt senvIitce fhfsEuP ................................ ................................ ................................ ................................ . 169 )21 Chapter Twelve ................................ ................................ ................................ . 174 :kc oglnBidl icui BseahBT ................................ ................................ ................................ ....................... 174 enituor beuhST ................................ ................................ ................................ ................................ .................... 174 noitcurt sennIituorbuS-oT-p meuhJT ................................ ................................ ................................ ................ 175 noitcurt sennIituorbuS-morf-nru teehRT ................................ ................................ ................................ .......... 175 gnisser dtdcAeri ddneIxe dentIulo sgbnA iSsRUJ ................................ ................................ ............................. 177 enituorb uopStm ugJn oeLhT ................................ ................................ ................................ ............................ 178 gn oeLnituorb umSo rnfruteR ................................ ................................ ................................ ............................ 178 enituorb uohStcnarB ................................ ................................ ................................ ................................ .......... 179 ne hd Wnw ao:Henituor b guanSidoC ................................ ................................ ................................ ................ 180 elpma xyErar bn –ioALitag etNiB-thg i2E056 ................................ ................................ ................................ .. 180 noitage NtiB-thgi E6185 6dn a,2085 6,20C56 ................................ ................................ ................................ .... 181 4 ret nnegCi snerDet seehWT noit atgieBN-nee t2x0i5S6 ................................ ................................ ................................ ................................ 181 noitag etNiB-neetx i6S18 5d 6n2a0856 ................................ ................................ ................................ .............. 181 gni srseatPemaraP ................................ ................................ ................................ ................................ .............. 182 )31 Chapter Thirteen ................................ ................................ .............................. 192 snoitcur tlsonrI tmneo tCsdstnypaSurretnI ................................ ................................ ........................... 192 stpurretnI ................................ ................................ ................................ ................................ ............................ 192 stpur rgentinsIsecorP ................................ ................................ ................................ ................................ ......... 197 e meisTnop stepRurretnI ................................ ................................ ................................ ................................ ... 200 noitcurt slnoIrt nroeCtsi gseuRtatS ................................ ................................ ................................ .................... 201 snoitcurt snnoIitar eopNO ................................ ................................ ................................ ................................ .. 202 )41 Chapter Fourteen ................................ ................................ ............................. 204 selp me addSoeCtceleS ................................ ................................ ................................ ............................. 204 noitacilpitluM ................................ ................................ ................................ ................................ ...................... 204 noitacilpi t2l0u5M6 ................................ ................................ ................................ ................................ ........... 205 noitacilpi t2l0uCM56 ................................ ................................ ................................ ................................ ........ 205 noitacilpitl u6M18 5d6 n2a0856 ................................ ................................ ................................ ........................ 205 noisiviD ................................ ................................ ................................ ................................ ................................ 208 nois i2v0i5D6 ................................ ................................ ................................ ................................ ................... 209 nois i2v0iCD56 ................................ ................................ ................................ ................................ ................. 211 noi s6i1v8i5D6/20856 ................................ ................................ ................................ ................................ ....... 211 enit u2o 0Ry5r6arti bgnrnaAillaC ................................ ................................ ................................ ..................... 213 erpoysTse cgonriPtseT ................................ ................................ ................................ ................................ ....... 219 margorPevisruc era Roefd o6C18 5d6etareneG-relipmoC ................................ ................................ ............... 220 egaug nyalLbme sdnseiAdoC-d nealHpm aex mEeahST ................................ ................................ ................... 224 kramhcn esBenehtsota r fEeove ieShT ................................ ................................ ................................ ............... 226 )51 Chapter Fifteen ................................ ................................ ................................ 230 l ogonTimmarg o66r 11P– 8GA5U6GED ................................ ................................ ............................... 230 snoitaralceD ................................ ................................ ................................ ................................ ......................... 232 TSIL ................................ ................................ ................................ ................................ ................................ .... 234 TSILF ................................ ................................ ................................ ................................ ................................ .. 236 DNRPOMRF ................................ ................................ ................................ ................................ ....................... 238 POB ................................ ................................ ................................ ................................ ................................ ..... 243 PETS ................................ ................................ ................................ ................................ ................................ ... 244 XEHTUP ................................ ................................ ................................ ................................ ............................. 246 NLRLC ................................ ................................ ................................ ................................ ................................ 248 ETADPU ................................ ................................ ................................ ................................ ............................. 249 NLTNIRP ................................ ................................ ................................ ................................ ............................ 251 ECART ................................ ................................ ................................ ................................ ................................ 252 NIKRBE ................................ ................................ ................................ ................................ .............................. 254 LCPSKHC ................................ ................................ ................................ ................................ ........................... 259 SGERPMUD ................................ ................................ ................................ ................................ ....................... 263 8GETRTUP ................................ ................................ ................................ ................................ ......................... 265 SELBAT ................................ ................................ ................................ ................................ .............................. 266 )61 Chapter Sixteen ................................ ................................ ................................ 276 gni gn ggduinbsaeeDD ................................ ................................ ................................ ............................. 276 tsilk cgenhiCggubeD ................................ ................................ ................................ ................................ ........... 276 lagmailcFeD ................................ ................................ ................................ ................................ .................... 276 tcartbu S/dd Ao troir Pyrra CgnitsujdA ................................ ................................ ................................ ............. 276 xa ttnhygSiR-ot- txf5e6L ................................ ................................ ................................ ................................ ... 276 sehcn axr5B6 ................................ ................................ ................................ ................................ .................... 277 g upBm u2J056 ................................ ................................ ................................ ................................ ................. 277 e dgonCildnaH-tpurretnI ................................ ................................ ................................ ................................ .... 277 ed oeMvit asNusr enVoitalu m:E61856/20856 ................................ ................................ ................................ ... 277 sretsig etRiB-neetx isSusr etViB-thg i:E61856/20856 ................................ ................................ ........................ 278 ega Ptceri Deh T:61856/20856 ................................ ................................ ................................ .......................... 278 5 ret nnegCi snerDet seehWT a tmraaoDrg osrnPurr ekvcO a:t6S1856/20856 ................................ ................................ ................................ . 278 LTR/ S dTLnRSaJ/ R:S6J1856/20856 ................................ ................................ ................................ ................ 278 PVM /:N6V1M856/20856 ................................ ................................ ................................ ................................ . 278 sse rndrduAteR ................................ ................................ ................................ ................................ ................. 279 xa trneylSbm etsnseAtsisnocnI ................................ ................................ ................................ .......................... 279 erehwyn Aneppa Hna Cyeh T:sgu BcireneG ................................ ................................ ................................ ...... 279 selbai rdaeVzilaitininU ................................ ................................ ................................ ................................ ...... 279 edoC gnissiM ................................ ................................ ................................ ................................ .................... 279 poo Lan ixedn Ieh ttnemercn Io teruliaF ................................ ................................ ................................ ............ 279 kca tpnSUae loeCtruliaF ................................ ................................ ................................ ................................ .. 280 noita cyorLo mseuMs rae tVeatDaidemmI ................................ ................................ ................................ ......... 280 enituor b muao Srrfetni okPca te ShgtnizilaitinI ................................ ................................ ................................ . 280 gnimmarg odrePrutcu r dtnnSgai snewDoD-poT ................................ ................................ .............................. 280 noitatnemucoD ................................ ................................ ................................ ................................ .................... 281 )71 Chapter Seventeen ................................ ................................ ............................ 283 se dgonMisser dedhAT ................................ ................................ ................................ ............................ 283 gniss eertdudlAosbA ................................ ................................ ................................ ................................ ......... 288 gniss e,r ddXedxAe dentIulosbA ................................ ................................ ................................ ....................... 289 gniss e,r ddYedxAe dentIulosbA ................................ ................................ ................................ ....................... 290 gnisser dtdcAeri ddneIxe dentIulosbA ................................ ................................ ................................ ............... 291 gnisse rtdcdeAr iedtnuIlosbA ................................ ................................ ................................ ............................ 292 gnisser dg dntAocLeri dentIulosbA ................................ ................................ ................................ ................... 293 PM]Jrdda[ ................................ ................................ ................................ ................................ ........................ 293 gnisse r gdendtoAuLlosbA ................................ ................................ ................................ ................................ 294 gnisse r, ddXdeAxe dgn nIeotLulosbA ................................ ................................ ................................ .............. 295 gniss errodtdaAlumuccA ................................ ................................ ................................ ................................ ... 296 gnisser de dvkAocMolB ................................ ................................ ................................ ................................ .... 297 gnisse r edtgdcaAePriD ................................ ................................ ................................ ................................ ..... 298 gnisse r, ddXdeAxe den gItacPeriD ................................ ................................ ................................ ................... 299 gnisse r, ddYdeAxe den gItacPeriD ................................ ................................ ................................ ................... 300 gnisse r, dtXdcAeri ddneIxe den gItacPeriD ................................ ................................ ................................ ....... 301 gnisse rtdcdeAr i edtgncaIePriD ................................ ................................ ................................ ........................ 302 gnisser dg dntAocLeri de ngtIacPeriD ................................ ................................ ................................ ............... 303 gnisse r, ddYdeAxe dtncIeri den gItacPeriD ................................ ................................ ................................ ....... 304 gnisse r, ddYdeAxe dgn nItocLeri den gItacPeriD ................................ ................................ .............................. 305 gnisse redtdaAidemmI ................................ ................................ ................................ ................................ ....... 306 gniss edredidlApmI ................................ ................................ ................................ ................................ ........... 307 gnisse redvdiAt arleetR nmuaorCgorP ................................ ................................ ................................ ............... 308 sser dgd nAeovLita lreeRtn umoaCrgorP ................................ ................................ ................................ ........... 309 gnisser d)deAtulos bkAc(atS ................................ ................................ ................................ ............................. 310 gnisser d)dtAceri de ngtIacPer ikDc(atS ................................ ................................ ................................ ............ 312 gnisse r)dtdpAurre tkncIa(tS ................................ ................................ ................................ .............................. 314 gnisser d)deAvita lreeRtn umoaCrgo rkPc(atS ................................ ................................ ................................ ... 316 gnisse r)dld lAkucPa(tS ................................ ................................ ................................ ................................ ..... 317 gnisse r)dhd sAkucPa(tS ................................ ................................ ................................ ................................ .... 319 gnisse r)d IdkTAcRa(tS ................................ ................................ ................................ ................................ ..... 321 gnisse r)d LdkTAcRa(tS ................................ ................................ ................................ ................................ .... 322 gnisser d)dS ATkRc(atS ................................ ................................ ................................ ................................ .... 323 gnisse redvdiAt aklceaRtS ................................ ................................ ................................ ................................ . 324 gnisse r, ddYdeAxe dtncIeri denvIita lkecRatS ................................ ................................ ................................ .. 325 )81 Chapter Eighteen ................................ ................................ .............................. 326 s tneoSitcurt senhIT ................................ ................................ ................................ ................................ . 326 yr rha tCdidWA ................................ ................................ ................................ ................................ .................. 327 edocpO ................................ ................................ ................................ ................................ ............................. 327 setyB ................................ ................................ ................................ ................................ ................................ . 327 selcyC ................................ ................................ ................................ ................................ ............................... 327 yrome Mhti wrotalumucc AdnA ................................ ................................ ................................ ......................... 328 dnoceS ................................ ................................ ................................ ................................ .............................. 328 6 ret nnegCi snerDet seehWT dnarepO ................................ ................................ ................................ ................................ ............................ 328 tf erLotalumuc c rAyorom etMfihS ................................ ................................ ................................ .................... 329 ra eyl r ChrfcainCarB ................................ ................................ ................................ ................................ ......... 330 tyer S rhfaciCnarB ................................ ................................ ................................ ................................ ............. 331 la uhfqciEnarB ................................ ................................ ................................ ................................ ................... 332 rotalumucc Atsniag asti Byrome MtseT ................................ ................................ ................................ ............. 333 sun ifhMicnarB ................................ ................................ ................................ ................................ .................. 334 lau qt EofhNicnarB ................................ ................................ ................................ ................................ ............ 335 su lfhPicnarB ................................ ................................ ................................ ................................ ...................... 336 sy ahwclnAarB ................................ ................................ ................................ ................................ .................... 337 kaerB erawtfoS ................................ ................................ ................................ ................................ ................... 338 gn osLyaw lhAcnarB ................................ ................................ ................................ ................................ ........... 340 ra ewloClf r hefcvinOarB ................................ ................................ ................................ ................................ ... 341 tweoSlf r hefcvinOarB ................................ ................................ ................................ ................................ ....... 342 gya rlrrFaaeClC ................................ ................................ ................................ ................................ ................. 343 ga leFd olMamic erDaelC ................................ ................................ ................................ ................................ ... 344 g aellFba stipDurre trnaIelC ................................ ................................ ................................ .............................. 345 gal Fwolfrev OraelC ................................ ................................ ................................ ................................ ............ 346 yro mhe tMriowtalumu cecrAapmoC ................................ ................................ ................................ ................. 347 el braonsEsecorP-oC ................................ ................................ ................................ ................................ ........... 349 yrom eh Mt riXewtsig exRed neIrapmoC ................................ ................................ ................................ ........... 350 Y PyCrom ehMt irYwetsig exRed neIrapmoC ................................ ................................ ................................ .. 351 tnemerceD ................................ ................................ ................................ ................................ ........................... 352 reXtsi gxeeR dtnnIemerceD ................................ ................................ ................................ ............................... 353 reYtsi gxee RdtnnIemerceD ................................ ................................ ................................ ............................... 354 yrome Mhti wrotalumucc ARO-evisulcxE ................................ ................................ ................................ ......... 355 tnemercnI ................................ ................................ ................................ ................................ ............................ 357 reXtsi gxeeR dtnnIemercnI ................................ ................................ ................................ ................................ 358 Yretsige Rxedn ItnemercnI ................................ ................................ ................................ ................................ 359 pmuJ ................................ ................................ ................................ ................................ ................................ .... 360 )knaB-ret ngI n(eonLituor bpoumtSuJ ................................ ................................ ................................ ............. 361 enituorb uopStmuJ ................................ ................................ ................................ ................................ ............. 362 yrom emMo rrfotalumuc cdAaoL ................................ ................................ ................................ ....................... 363 yrom em Mo rrXeftsig exRed ndIaoL ................................ ................................ ................................ ................ 364 yrom emMo rrYfetsig exRed ndIaoL ................................ ................................ ................................ ................ 365 th grioRtalumu cyrcroAo mtefM ilhaScigoL ................................ ................................ ................................ ..... 366 t xee vNkocMolB ................................ ................................ ................................ ................................ ................. 367 suoive rePv okMcolB ................................ ................................ ................................ ................................ ........... 368 PVM ................................ ................................ ................................ ................................ ......................... 368 noitar eopNO ................................ ................................ ................................ ................................ ....................... 369 yrome Mhti wrotalumucc ARO ................................ ................................ ................................ .......................... 370 sser dedtAulo sebvAitce fhfsEuP ................................ ................................ ................................ ........................ 372 sser dtdcAeri denvIitce fhfsEuP ................................ ................................ ................................ ......................... 373 sser dtdcAeri denvIita leCevPRitce fhfsEuP ................................ ................................ ................................ ..... 374 REP ................................ ................................ ................................ ................................ ................................ ..... 374 rotalumu chcsAuP ................................ ................................ ................................ ................................ ............... 375 retsig ekRn aaBt ahDsuP ................................ ................................ ................................ ................................ .... 376 retsi ge egtRacPe rhisDuP ................................ ................................ ................................ ................................ ... 377 retsi gke nRmaaBrg ohrsPuP ................................ ................................ ................................ ............................. 378 retsi gseuRt artoSssec ohrsPuP ................................ ................................ ................................ ........................... 379 rets ixg eehdRsnuIP ................................ ................................ ................................ ................................ ............ 380 rets ixg eehdRsnuIP ................................ ................................ ................................ ................................ ............ 381 rotalumuc clAluP ................................ ................................ ................................ ................................ ................ 382 retsig ekRn aaBt alDluP ................................ ................................ ................................ ................................ ...... 383 retsi ge egtRacPe rlilDuP ................................ ................................ ................................ ................................ .... 384 sg asluFt altlSuP ................................ ................................ ................................ ................................ .................. 385 kc a mtr oSeXrtfsi gxeeR dlnlIuP ................................ ................................ ................................ ....................... 386 kca tmSo rrYfetsig exRed nlIluP ................................ ................................ ................................ ....................... 387 s tsiuBt atteSseR ................................ ................................ ................................ ................................ .................. 388 t freoLtalumu cyrcroAo meetMatoR ................................ ................................ ................................ ................. 389 7 ret nnegCi snerDet seehWT th grioRtalumu cyrcroAo meetMatoR ................................ ................................ ................................ ............... 390 tpurre tmn oInrrfuteR ................................ ................................ ................................ ................................ ........ 391 gn oeLnituorb umSo rnfruteR ................................ ................................ ................................ ............................ 393 enituor bmu oSnrrfuteR ................................ ................................ ................................ ................................ ..... 394 rotalumuc cmAo rwforr ohBt itwcartbuS ................................ ................................ ................................ .......... 395 gya rltrFeaSC ................................ ................................ ................................ ................................ ..................... 397 ga leFd olMamic etDeS ................................ ................................ ................................ ................................ ....... 398 g aellFba stipDurre ttneIS ................................ ................................ ................................ ................................ .. 399 sti Bsutat SteS ................................ ................................ ................................ ................................ ..................... 400 yrom eorMtotalumuc ceArotS ................................ ................................ ................................ ........................... 401 rossec o erphPottS ................................ ................................ ................................ ................................ ............... 402 yrom e oMrXtetsig exRed neIrotS ................................ ................................ ................................ ..................... 403 yrome Mo t Yretsige Rxedn IerotS ................................ ................................ ................................ ..................... 404 yrom eooMtr eeZrotS ................................ ................................ ................................ ................................ ......... 405 reXtsi gxeeR dronotItalumu crceAfsnarT ................................ ................................ ................................ ........ 406 rYetsig exRed norItotalumuc crAefsnarT ................................ ................................ ................................ ........ 407 retsi gee gRtacPe rroiotDtalumu ctciAB -r6e1fsnarT ................................ ................................ ....................... 408 retn iko c PraootttSalumu crceAfsnarT ................................ ................................ ................................ ............. 409 rotalumuc ctAiB- 6or1tetsig eeRg atPcer irDefsnarT ................................ ................................ ....................... 410 rotalumucc Atsniag Asti Byrome Mtese Rdn atseT ................................ ................................ ............................ 411 rotalumuc ctAsnia gsAt iyBrom etM edS ntaseT ................................ ................................ ............................... 412 rotalumu ctciAB -ro6et1tn ikocP arteSfsnarT ................................ ................................ ................................ ... 413 reXtsi gxeeR dronetItn ikocP arteSfsnarT ................................ ................................ ................................ ....... 414 rotalumu c rcoXeAttsig exRed nrIefsnarT ................................ ................................ ................................ ........ 415 retn iko cPr aeXotttSsi gxeeR drneIfsnarT ................................ ................................ ................................ ....... 416 orYXtetsig exRed nrIefsnarT ................................ ................................ ................................ .......................... 417 rotalumuc c oArYtetsig exRed nrIefsnarT ................................ ................................ ................................ ........ 418 orXYtetsig exred nrIefsnarT ................................ ................................ ................................ ............................ 419 tpurre t rntoIifaW ................................ ................................ ................................ ................................ ............... 420 noisnap xeErut ur FodfevreseR ................................ ................................ ................................ .......................... 421 srotalumuc cdAA neBa hetgnahcxE ................................ ................................ ................................ ................. 422 st inBoitalu mdE nyarr aeCgnahcxE ................................ ................................ ................................ .................. 423 )91 Chapter Nineteen ................................ ................................ .............................. 424 s tnsoiiLtcurtsnI ................................ ................................ ................................ ................................ ....... 424 rossecorP ................................ ................................ ................................ ................................ ............................. 434 : xeo dbgonmisserddA ................................ ................................ ................................ ................................ ....... 434 :n mnuoliotcarepO ................................ ................................ ................................ ................................ ............ 434 :se dsouct a dt,nssael c,yscetyB ................................ ................................ ................................ .......................... 435 dnege Lxirta Medo CpO ................................ ................................ ................................ ................................ ..... 437 Table of Figures F IGURE 1 1B- INARY R EPRESENTATION ................................ ................................ ................................ ............................. 13 F IGURE 1 -2 B IT N UMBERS ................................ ................................ ................................ ................................ ............... 14 F IGURE 1 D3N-A ING B ITS ................................ ................................ ................................ ................................ ............... 16 F IGURE 1 R4O- ING B ITS ................................ ................................ ................................ ................................ .................. 17 F IGURE 1 REOVISULC X5E- ING B ITS ................................ ................................ ................................ ............................ 17 F IGURE 1 TNEME L6P-MOC ING B ITS ................................ ................................ ................................ ............................. 18 F IGURE 1 TNEME L7P-MOC ING B ITS U SING E XCLUSIVE RO ................................ ................................ .......................... 18 F IGURE 1 -8 M ULTIPLE P- RECISION A RITHMETIC ................................ ................................ ................................ ............... 21 F IGURE 1 -9 T YPICAL A SSEMBLER S OURCE C ODE ................................ ................................ ................................ ............. 23 F IGURE 2 1- 2056P ROGRAMMING M ODEL ................................ ................................ ................................ ........................ 28 F IGURE 2 -2 I NITIALIZING THE S TACK P OINTERT O FF$ ................................ ................................ ................................ ..... 32 F IGURE 2 3-A FTER P USHINTGH E A CCUMULATOR ................................ ................................ ................................ ............. 33 F IGURE 2 -4 I NDEXING : B ESA P LUS I NDEX ................................ ................................ ................................ ........................ 35 F IGURE 2 -5 I NDIRECTION : O PERAND L OCATES I NDIRECT A DDRESS ................................ ................................ .................. 36 F IGURE 4 1 -6 18N56 ATIVE M ODE P ROGRAMMING M ODEL ................................ ................................ .............................. 46 F IGURE 4 2 -R ESULTOSF S WITCHING R EGISTER S IZE ................................ ................................ ................................ ........ 51 8 ret nnegCi snerDet seehWT F IGURE 4 3 -2 08N56 ATIVE M ODE P ROGRAMMING M ODEL ................................ ................................ .............................. 57 F IGURE 4 4- 61856E MULATION M ODE P ROGRAMMING M ODEL ................................ ................................ ........................ 60 F IGURE 6 1- S TACK M EMORY ................................ ................................ ................................ ................................ .......... 75 F IGURE 6 -2. P HSU ................................ ................................ ................................ ................................ .......................... 77 F IGURE 6 3 -R EGISTER T RANSFERS B ETWEEN D IFFERENT S- DEZI R EGISTERS ................................ ................................ ..... 83 F IGURE 7 -1 I MMEDIATE A DDRESSING : 8 SV . 61 BITS ................................ ................................ ................................ ...... 91 F IGURE 7 2- A BSOLUTE A DDRESSING ................................ ................................ ................................ ............................... 93 F IGURE 7 3- Z ERO P AGE A DDRESSING ................................. ................................ ................................ ............................. 94 F IGURE 7 -4 I GNIXEDN ................................ ................................ ................................ ................................ .................... 97 F IGURE 7 -5 I NDEXING B EYONDT HE E NDO FT HE B ANK ................................ ................................ ................................ ... 98 F IGURE 7 -6 A BSOLUTE I NDEXING WITH A G ENERIC I NDEX R EGISTER ................................ ................................ ............. 100 F IGURE 7 7- D IRECT P AGE I NDEXING WITH A G ENERIC I NDEX R EGISTER ................................ ................................ ......... 102 F IGURE 7 8- D IRECT P AGE I NDIRECT A DDRESSING ................................ ................................ ................................ ......... 105 F IGURE 7 9- A BSOLUTE L ONG A DDRESSING ................................ ................................ ................................ ................... 108 F IGURE 7 01- D IRECT P EGA I NDIRECT L ONG A DDRESSING ................................ ................................ .............................. 110 F IGURE 8 1- J PMU ’ S A BSOLUTE I NDIRECT A DDRESSING M ODE ................................ ................................ ....................... 113 F IGURE 8 .2- R ELATIVE B RANCH C ALCULATION ................................ ................................ ................................ ............ 115 F IGURE 8 .3- L INKED L IST ................................ ................................ ................................ ................................ ............. 117 F IGURE 10 -1 T HE DONA PERATION ................................ ................................ ................................ .............................. 140 F IGURE 10 2- S HIFT AND R OTATE L EFT ................................ ................................ ................................ .......................... 148 F IGURE 10 3- S HIFT AND R OTATE R IGHT ................................ ................................ ................................ ........................ 149 F IGURE 11 1- P OSTINDEXING ................................ ................................ ................................ ................................ ......... 159 F IGURE 11 2- P REINDEXING ................................ ................................ ................................ ................................ ........... 162 F IGURE 11 3- A BSOLUTE I NDEXED I NDIRECT ................................ ................................ ................................ .................. 165 F IGURE 11 4- P OSTINDEXED L ONG ................................ ................................ ................................ ................................ . 167 F IGURE 11 5- S TACK R ELATIVE ................................ ................................ ................................ ................................ ..... 168 F IGURE 11 6- S TACK R ELATIVE I NDIRECT I NDEXED ................................ ................................ ................................ ........ 169 F IGURE 11 7- AEPA GNISSERDD ................................ ................................ ................................ ................................ .... 170 F IGURE 11 8- IEPA GNISSERDD ................................ ................................ ................................ ................................ ..... 171 F IGURE 11 .9- REPA GNISSERDD ................................ ................................ ................................ ................................ ... 172 F IGURE 12 R1 S-J ................................ ................................ ................................ ................................ ......................... 176 F IGURE 12 2- STR ................................ ................................ ................................ ................................ ......................... 177 F IGURE 12 3- J LS ................................ ................................ ................................ ................................ .......................... 178 F IGURE 12 4L -TR ................................ ................................ ................................ ................................ ........................ 179 F IGURE 13 1- O/IM ANAGEMENT : I NTERRUPTS VS . P OLLING ................................ ................................ .......................... 193 F IGURE 13 -2 I NTERRUPT P ROCESSING ................................ ................................ ................................ ........................... 194 F IGURE 13 -3B REAK S IGNATURE B YTE I LLUSTRATION ................................ ................................ ................................ .... 197 F IGURE 13 4- 2A2I5VI6 NTERRUPT F LAG R EGISTER ................................ ................................ ................................ ...... 198 F IGURE 14 1- S TACK S NAPSHOT AFTER PEI (12) I NSTRUCTION ................................ ................................ ....................... 218 F IGURE 15 1- D ISASSEMBLY O UTPUT ................................ ................................ ................................ ............................. 231 F IGURE 15 -2 T RECAR O UTPUT ................................ ................................ ................................ ................................ ...... 231 F IGURE 17 20CP 516-/ 2056 ROGRAMMING M ODEL ................................ ................................ ................................ ........ 284 F IGURE 17 .2- 20856N EVITA M ODE P ROGRAMMING M ODEL ................................ ................................ .......................... 285 F IGURE 17 3 -6 18N56 ATIVE M ODE P ROGRAMMING M ODEL ................................ ................................ ........................... 286 F IGURE 17 4- 61856E MULATION M ODE P ROGRAMMING M ODEL ................................ ................................ .................... 287 F IGURE 18 1- DNAT RUTH T ELBA ................................ ................................ ................................ ................................ . 328 F IGURE 18 2- A LS ................................ ................................ ................................ ................................ ........................ 329 F IGURE 18 61S856/ 230- 856 TACK A FTER KRB ................................ ................................ ................................ ............. 339 F IGURE 18 4- S TACK AFTER POC ................................ ................................ ................................ ................................ ... 349 F IGURE 18 -5E XCLUSIVE OR T RUTH T ELBA ................................ ................................ ................................ .................... 355 F IGURE 18 -6 RSL ................................ ................................ ................................ ................................ ......................... 366 F IGURE 18 7- L OGICAL OR T RUTH T ELBA ................................ ................................ ................................ ..................... 370 F IGURE 18 L8 O-R ................................ ................................ ................................ ................................ ........................ 389 F IGURE 18 R9 O-R ................................ ................................ ................................ ................................ ........................ 390 F IGURE 18 -10N ATIVE M ODE S TACK BEFORE .ITR ................................ ................................ ................................ .......... 391 F IGURE 18 11- S TACK BEFORE LTR ................................ ................................ ................................ ............................... 393 F IGURE 18 21- S TACK BEFORE STR ................................ ................................ ................................ ............................... 394 9 ret nnegCi snerDet seehWT Table of Tables T ELBA 1 1-D ECIMAL AND H EX N UMBERS ................................ ................................ ................................ ........................ 15 T ELBA 1 -2 T RUTH T ABFLOER DNA ................................ ................................ ................................ ............................... 17 T ELBA 1 -3 T RUTH T EL BRAOF RO ................................ ................................ ................................ ................................ ... 17 T ELBA 1 -4 T RUTH T EL BRAOF ERVOISULCXE ................................ ................................ ................................ ............. 17 T ELBA 1 -5 T RUTH T EL BRAOF TNEMELPMOC ................................ ................................ ................................ .............. 18 T ELBA 1 -6 T HE E IGHT B- IT R ANGOEF T WO ’ S -C OMPLEMENT N UMBERS ................................ ................................ ............ 19 T ELBA 1 -7 T HE F IRST D NC6B1 UMBERS ................................ ................................ ................................ ........................ 20 T ELBA 2 1-S TATUS R EGISTER C ONDITION C ODE F LAGS ................................ ................................ ................................ .... 30 T ELBA 2 2-S TATUS R EGISTER M ODE S ELECT F LAGS ................................ ................................ ................................ ......... 31 T ELBA 2 3 -2 0A56 GNISSERDD M ODES ................................ ................................ ................................ ............................ 34 T ELBA 2 4- 205I6 NSTRUCTIONS ................................ ................................ ................................ ................................ ...... 37 T ELBA 3 -1 T HE 65C02’ S N WE A DDRESSING M ODES ................................. ................................ ................................ ........ 41 T ELBA 3 -2. N WE 20CI56 NSTRUCTIONS ................................ ................................ ................................ .......................... 42 T ELBA 4 -1 T HE F RUO P OSSIBLE N ATIVE M ODE R EGISTER C OMBINATIONS ................................ ................................ ....... 49 T ELBA 4 2- A DDRESSING M ODES :Z ERO P AGE VS . D IRECT P EGA ................................ ................................ ..................... 52 T ELBA 4 -3 T HE ’20856/61856 S N WE A DDRESSING M ODES ................................ ................................ .............................. 53 T ELBA 4 4- N WE 20856/618I56 NSTRUCTIONS ................................ ................................ ................................ ................. 54 T ELBA 4 -5 I NTERRUPT V ECTOR L OCATIONS ................................ ................................ ................................ .................... 55 T ELBA 6 1-D ATA M OVEMENT I NSTRUCTION ................................ ................................ ................................ .................... 70 T ELBA 7 1- L OIFS T S IMPLE A DDRESSING M ODES ................................ ................................ ................................ ............. 89 T ELBA 8 .1- B RANCH AND J UMP I NSTRUCTIONS ................................ ................................ ................................ .............. 111 T ELBA 9 1- A RITHMETIC I NSTRUCTIONS ................................ ................................ ................................ ........................ 122 T ELBA 9 -2. E SEITILAUQ ................................ ................................ ................................ ................................ ................ 131 T ELBA 10 1- L OGIC I NSTRUCTIONS ................................ ................................ ................................ ................................ 139 T ELBA 11 -1 C XELPMO A DDRESSING M ODES ................................ ................................ ................................ ................. 154 T ELBA 11 -2 C XELPMO P USH I NSTRUCTIONS ................................ ................................ ................................ .................. 154 T ELBA 11 3- A SSEMBLER S YNTAXF OR C OMPLETE M EMORY A CCESS ................................ ................................ ............. 157 T ELBA 12 1- S UBROUTINE I NSTRUCTIONS ................................ ................................ ................................ ...................... 174 T ELBA 13 -1. I NTERRUPT AND S YSTEM C ONTROL I NSTRUCTIONS . ................................ ................................ ................... 192 T ELBA 13 -2 I NTERRUPT V ECTORS ................................ ................................ ................................ ................................ . 195 T ELBA 13 3 -R ESET I NITIALIZATION ................................ ................................ ................................ ............................... 201 T ELBA 17 1- O PERAND S YMBOLS ................................ ................................ ................................ ................................ .. 284 T ELBA 18 1- O PERAND S YMBOLS ................................ ................................ ................................ ................................ .. 326 T ELBA 18 -2 65 X F SGAL ................................ ................................ ................................ ................................ ................ 326 10

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.