We'vegotthe 15 addresslines, we'vegottheeightdatalines, andwe'vegotthereadwriteor a right, enablesignalhookeduphere.
ButthentheRamchipsgot a coupleofcontrolsignalshereiswelltoenableit.
Andforthatwesaid, Well, wecanhookthoseuptoaddress 14 and 15 sothatwhenbothofthoseairlow, theramisenabled, andthat'llensurethattheramisenabledanytimetheaddressesbetween 0000 andthree f f f, whichistherangewewanttousefortheram.
Butthen, inthelastvideo, wetook a closerlookatthetimingdiagramfortheRamtotake a closerlookatthetimingrequirementsforinterfacingwithit.
Instead, wehavetoadd a littlebitoflogichere, andthisistoensurethatthechipselectsignaldoesn't golowuntilalloftheaddresslinesaresetandstabilized, andthenthechipslikesignalwouldgohighbeforeanyoftheaddresslineschangeanytimewe'redoing a readorwrite, particularly a righttotheram.
Andsothat's whatthisadditionallogicheredoes.
Andinmylastvideo, I wentoverexactlywhyweneededthis.
Becausethenit's gonnafollowupwithLoad A F F, whichisactuallythenextinstruction.
Thenwehave a D, whichisstory, andit's a storysixyearsortwo, whichistheaddressforDDR.
Besothisisalljustpartoftheinitialization.
So I'm gonnagothisprettyquicklyjusttogettothepointwherewe'reactuallycallingandreturningfromthesubroutine, since I'vealreadyshown a lotofthisinpreviousvideos.
Butanyway, we'renext.
We'llhaveAh, well, thisisactuallytheright.
Soit's actuallywritingtheFFtoaddresssixyearsortwo, you'regonnareadLowDay E zeroandthenstore, eh?
Thenwehave a lowday 38 Sothat's thefirstinstructionthatwe'reactuallygonnasendtotheLCD.
Sothenextinstructionnowisgoingtobethejumps.
A subroutineupcodetozeroisjumped a subroutine, andthentheaddressofthatisgoingtobe 8060 orno, it's not a 060 thatthisactuallykindoffooledmebecausethe 60 it's readingfrom, youknow, address 8010 Thatisgonnabepartoftheaddressthatwe'rejumpingto.
Butyoucouldseethis 80 isactuallybeingreadfrom 101 f f andthatisgonnabethebottomofourstackbecausetheFFremember, thatisourstackpointer.
It's justthatbypurecoincidence, theheaddress 01 f f happenedtohave 80 initonsothatthatkindofwillbetherefor a minute.
There's a littlebitconfusingbecauseoftwothingsgoingonhere.
I talkedaboutthisinthelastvideo, butyouknow, we'rejumpingtosubroutines, sothistozeroistheinstructiontojumptosubroutine.
Andthenitneedstoreadtheaddresstherejumpingtoo.
Soitreadsfromthenextaddress 010 sothattheinstructionwas a needs a reserve f sothatitreadsfrom 80108011 Itreadstheaddressthatwerejumpingto, andsothat's 8060 I wasthrownoffherebecauseit's alsohastowritetheaddressthatwerejumpingfrom, whichis 8011 Andit's writingthat 201 F F 01 F fees.
And 80 isthefirstupcodeforforstory, so I'lljustgothroughthisprettyquickly.
Sowehaveah, store a 6000 whichispork.
Besothereitis.
Storingthe 38 intoPort B.
Wehave, ah, load a 00 Andsothisistocleartheregister, select, read, writeandenablebitsandthenstore a sixyearsor a one, whichispoured a andtheregoesstoringzerointoport A.
Wehave, ahload a 80 That's theenablebitandstore a 6001 again.
Andthereitis, writingthatoutto 6 to 01 Soit's settingtheenablebit.
Andthenweload a 002 clearlyenablebitandstore a sixyearsorone.
Soifwekeepgoing, hereweare 8012 So, again, I thinkyouknowthisis a littlebitconfusingthewaythatthatthismonitorshowswhat's goingonbecauseitprintsoutwhat's onthebusforeachclockcycle, evenifthatclockcycleisnotactuallytransferringdataonthebus.
Butnonetheless, I thinkwecanconcludethatthisisworkingcorrectlybecausenowhereweareat 8012 whichisinfact, thenextload A.
Andsoweshouldseethatload A zero E, whichisthenextLCDinstructionthatwewanttoexecute.
AndthenweshouldagainseeanotherjumptosubroutinetotheLCD, whichisgonnabethe 8060 andsothatitisreadingthe 060 andalsopushingthereturnaddress, whichthistimeis 8016 Thebottomlineis, ifweletthisrunaswesawbefore, it's justgonnaworkbecausenowwe'vegottheramthere, andbecausewehavetheram, wehave a stack, andbecausewehave a stack, ourjumpeduseverthineinstructionisgonnaworkforus.
I thinkthereare a fewimprovementsthatwecanmaketoourhelloWorldProgrambeforewe'recompletelydonewiththisoneofthem, youcanprobablyseerightoffthebathereisthatwe'renotclearingthescreenatthebeginning.
Sowhat I'm gonnadoisdisconnectallofthisbecause I don't think I'm gonnabeusingthismonitoragaininthisvideo.
Getthatoutoftheway.
Andthen I cancarefullyremovethepromcarefullyandputitinthepramprogrammer, beingagaincarefultoputitintherightplaceinthepramburger, and I'llgoaheadandwritethistotheprom.
Andsoit's writingthattothepromandtherewego.
It's done.
Let's pullthepramoutcarefully.
Putitbackinourcircuit.
Herewego.
Andnowlet's powerthisupandweshouldgetAh, hello.
WorldMessagereset.
Mm.
something's notworkingquiterighthere.
What's goingon?
Anditlookslikemyclockfelloutaboutthat.
Lookthatbackinandthereitgoes.
Andwecouldspeedthisupif I resetshouldclearandreprintit.
Beautiful.
Andsotherewego.
We'vegotworking.
Ah, workingraminourcomputer, whichmeanswe'vegot a workingstack, whichmeansthatourprogramthatusessubroutines, eyesworkingandasyoucansee, itwaseasier.