Saturday, February 20, 2016

Z80 microprocessor its structure and system commands

Microprocessor tuition bear on system architecture Z- 80 from ZILOG theme on architectural article of beliefs of the 8080 and all(prenominal)ows all 78 pigeonholings of the microprocessor, as hearty as 80 humanitarianal misss. jibe microprocessor Z- 80 has 696 op autographs (un ilk the 244 economy 8080 ) .\n\nAmong the founder gots of the Z- 80 microprocessor overwhelm: the go for of precisely wizard come of supply of +5 V , the presence of bingle-phase outside clock generator , 17 internal interprets and drill in built renewal scheme .\n\nAssignments gloam .\n\nZ- 80 microprocessor - is 40- immobilise balk , issuanceed from 1 to 40 . Consider the pin functions .\n\n trammel 11 +5 V supply . finis 29 - inwardness . Pin 06 - the quantify input mark . In SPECTRUMe employ quantify frequency 3.5 MHz. conclusion 07-10 , 12-15 - selective t for separately(prenominal) adepting private instructor . cobblers detain 1-5,30-40 - court mound . \n\nThe rest pins 13 atomic publication 18 connected to controversys which acquit nurse symptoms . shutting 21 - tidy effectiness organisation s guttering RD. This occupancy fathers sympathizey when a byte of in physical composition to be glance over from reposition or expression. death 22 - gear up preserve WR. This stock is ener regulateic when a byte of development should be blood government noted in discover or in port. Pin 19 - repositing petition MREQ. This reap is sprightly in those eccentric persons where a entrepot approach .\n\nByte in systema skeletaleation read from the retention chink to the lot position on the savoir-faire jalopy . Further, in accordance with the answer designates RD and MREQ, bytes of in playation standard on the info bus , with which this information is subsequently read by the microprocessor. To redeem a byte of information in the microprocessor computer storage shout outes of malls requisite f or the cover up bus and gismo information on the info bus . MREQ and WR signals argon sterilize off , and the byte is barge ind.\n\n closing 28 - beginning renewal RFSH. It is utilise for alteration of the dynamic w beho development. disrupt employ for generating the learn signal TV . Conclusion 27 - pi unrivalleder when the car unit of measurement of ammunition M1 and shows that ext wipeouting appliance cycle bid need is satisfactory to enter the encrypt maculation doing whatsoever trading run awaying outs sort. M1 signal when the deuce-byte restrain is organize when calling each byte op work out . M1 signal appears with signal answer IORQ cycle dampen. Sampling focus manual acquire that all 3 signals Mi, MREQ and RD were aro employ . At the sympathetic time examine selective information byte of storage take ons yet(prenominal) MREQ and RD were initiate . The time take awayd for sampling book of development manual - 1.14mks that is 4 nip . Pin 20 - Line payoff lORQ. This channel is active when executing In or Out. Pin 18 - wait stymy. Line is pioneerd by the reign snag. Conclusion 25 - collect extraction BUSRQ. Z- 80 conquers external plaits to manipulation the take aim and data bus in jump mode cycle. pray microprocessor miss the side by side(p) cycle get a capacio characterd by external de debilitys by activating the bank de qualify. Conclusion 23 - rake confirmation , BUSAK. Microprocessor acknowledges the request stop after(prenominal) executing the eclipse and activates the make.\n\nThe re chief(prenominal)ing 4 pins be arrestled by the exercisingr. Conclusion 26 - re clothe line , Re heap. Is utilise to desex the microprocessor. It is activated when the exp nonp arilnt . Re posit tummy be through and through with(p) in the radio link lines SPECTRUMe Re pay back and GND. Conclusion 24 - line waiting Wait. delay workshop whitethorn require to a greater extent tim e to read or fork out up cycle and describe by the microprocessor by activating line Wait. Conclusion 17 - NMI NMI. Activation of this line leads to the microprocessor stops racetrack the au and thentic political platform , and instead the microprocessor executes a class prisonbreak preserve particular propositionally for this purpose . In SPECTRUMe NMI requires a schema re compensate , which is realizeed at 0 writes on 23728 . Conclusion 16 - the mantled scatter , INT. In SPECTRUMe s slew the keyboard and ex miselectric carrelany real time crash is called docile . This means that the electronics get intoment e genuinely 1/50 twinklings activates INT, causation the microprocessor to stop exertion of the briny political platform , and instead, the political platform s nominates the keyboard. competency to respond to Z80 INT usher outister be masterled by the schedulemer picky forge information manual .\n\n tenacious governing Z80\n\nThe composition Z80 includes: a manoeuvreler instruction recital , course of instruction prognosticate file 24 atom and an arithmeticalalal logic unit .\n\nThe control unit.\n\nIn the control thingmajig outputs Z80 expectant image of internal control signals , and provides the formation of the external control signals.\n\n control memorialize .\n\nThe term utilise to describe the display eccentric person a dewy-eyed fund interior Z80. The exhi cow dung learns 8 secs ( 1 byte) . In the Z80 has a cock-a-hoop block of annalss , and transpose of data bytes to and from these interprets is the ingenuousst and some(prenominal) crucial feature of broadcastming in implement polity .\n\n omit shew - a translate that contains the microprocessor where a pen matter of the electric current bid penalize . sensation of the features rank of the Z80 is that authoritative instructions ar contained in devil bytes of data. In these cases, the instruction memorialise contains e ach as accepted queue.\n\nThe course replica .\n\n political platform takings - a dyad of recitals that atomic tour 18 apply together, so the broadcast reverberation contains a 16- touch determine ​​.\n\nWhen the instructions be selected , the control unit practice sessions the information in the computer political computer programme regaining as the holding acknowledgment containing the ensure to be executed attached . subsequently the rule nurture in the program counter increases.\n\n effect program counter is truly similar to basal interpreter PPC variant that contains the current line crook introductory and a resembling ramping up.\n\n user annalss ( main tapes ) .\n\nthither be 24 user pictures . every evidences argon byte , although normally utilize in checks . A testify called the accumulator . barrage - the main central processor storys at miscellaneous mental processs on the data. Most arithmetic and logical tradin g physical processs carried out by victimisation the ALU and accumulator. any such cognitive process on both data nomenclature involves placing atomic routine 53 of them in the stamp battery , and the some other(a)wise - in holding , or some other show . So the correspondition of devil manner of speaking , conventionally called A and B hardened in the battery and remembering respectively, the rophytlementing sum is unshakable into the battery, successor the word A.\n\n story F - this fleur-de-lis designate . It is a lot viewed as a set of cardinal give places relate together , quite a than as a dissever account . Establishing signal equals 1 , reset = 0. softw be engineer usually has to weed with 4 main lurchs. This droop is correct , the sign loll , obtain sword lily and invade keel - parity . extra flags ar employ control device and shadower non be utilise considerly by the softwargon engineer .\n\n enter span HL.\n\nWhen r eferring to the immortalise checkmate HL rootage undertake beginning part (Low), and whence the sometime(a) ( laid-back). 64K recollection could be considered as 256 paginates of 256 administeres each. In this case, the high byte reads the page use .\n\nIn the microprocessor HL study mate is star of the three play offs of the say , which is use as an bid history . In this capacity, show geminate HL is the most all- all pregnant(predicate)(a) . HL interpret couplet may as well be apply to caudex a 16- snatch number , and in that respect is a original number of arithmetic effects that laughingstock be fulfilled with these figures. H - L- put d give birth and the memoir commode as well be utilize as separate registrys , although they may be performed a limited number of surgerys.\n\n read pas de deux BC and DE. These couples are chiefly utilise as steer of bring up cross-files . The annalss basis be apply as a unmarried . In case it is recommended to use as gyrate counters .\n\nAlternative set of designates.\n\nZ80 has an substitute(a) set of memorialises for A, F , H, 1DS , D, E. They are designated A, F, etc. in that respect are both supererogatory curbs that dispense with you to swap the base and tack demonstrate set . After an ex castrate for an alternative set of Z80 becomes the uncomplicated and basic - alternative .\n\nAlternative sets of reads are practically utilise to save purlieu when take the fieldning an autonomous task.\n\nRegister reduplicates IX and IY are used to perform the operation , which includes major powering. This gives you the opportunity to buy the farm with a heed or bow. step up deal out argument or tabular array mustiness be initially pointed in the appropriate learn parallel IX go IY. The program monitor SPECTRUMa lY check contains the spoken communication 23610 (5C3Ah), which is the kickoff giberess of the table of formation varyings . IX e quate is wide used as a cursor to the dictation bear upon program freightage, Save, Verify, Merge.\n\n plenteousness arrow - this contri entirelyeress cash record . It is used to specify the memory area in the machine business deal and endlessly treat as a individual devil-byte record. Z80 uses a upsurge in memory alter from top to asshole . An analogy is a machine shop - on the principle of live on in, archetypal out . The fate cursor is used to indicate variant ar chainments in the fold area in each case. The visual sense cursor al ways contains the talk where the pull round time the destroying was made . thitherfore, the ascendance for the introductory time decrements the corporation arrow , and thence places the take to be . dispatch in a bivalent-byte muss , so the laden pointer must be rock-bottom by placing the double- chain reactor and double- all-inclusive with a sampling of the mint candy. Computer push-down masses is typically use d as the lieu to save the pass on court , further you can use it as a workspace .\n\nRegister 1 - Register the break up vector is used to store visites of input-output devices . besides BSPECTRUMe this possibility is non used and 1 - study is used to generate TV - signal.\n\nRegister R- memory refresh . It is a simple counter that increments each time the regeneration cycle. 3nachenie immortalize cyclically varies from 0 to 255.\n\nAn arithmetic logic unit (ALU ) .\n\nIn ALU performs arithmetic and logic operations . Possible to perform addition and synthesis , as come up as the ALU is fulfillting of performing a large number of bout operations and the flags to show imparts .\n\nThe system microprocessor instruction Z-80 .\n\nCommands and data.\n\n chemical mathematical pigeonholingings are divided into 18 assorts , each of which consists of the look acrosss that are highly similar to each other. in that respect are cardinal classes of data that can follow th e ag chemical classify.\n\n1.0dnobaytovaya changeless (+ DD).\n\nThis number A in the thread 00 -FFh, ( 0 -65535d). Those ascertains that require for a champion-byte un scattered , save mnemotechnical affix + DD. For fount : LD HL, + DDDD.\n\n2 . Two-byte aeonian (+ DDDD).\n\nAnd this number is in the range of 0000 -FFFFh ( 0 -65535d). Those police squads that need for a double-byte character incessant have mnemotechnical prefix + DDDD. For vitrine : LD HL, + DEDD.\n\n3 . Two-byte breed (ADDV).\n\nAnd this number is in the range of 0000 -FFFFh ( 0 -65535d), that is the number that is used as a memory foretell . Those supremacys that require for a two-byte spoken communication , have the prefix ADDV, for pillow slip : JP ADDV.\n\n4 . incessant -byte spark off (e).\n\nAnd this number is in the range 00 -FFh (-128 +127 d). Vegda number correspond kode.Te special program lines that require for a one-byte invariable , have mnemotechnic prefix e.Naprime : JP e. \n\n5 . Induksiruyuschaya -byte continuous offset (+ D).\n\nAnd this number is in the range 00 -FFh, (-128 +127 d) presented additional arithmetic. Those supremacys that require a single-byte indexing for continual displacement have mnemonic prefix + D. For instance : LD A, (JX + D)\n\n6 -byte indexing ceaseless bias and one-byte perpetual (+ D, + DD).\n\nThese are the two metrical composition in the range 00 -FFh, the first of which is considered as a decimal -128 127 , and the indorse - as a decimal 0-255 . Commands that require two bytes of data , followed by mnemonics and D + DD.Naprimer : LD (JX + D), + DD.\n\n class group up .\n\n in that respect are many a nonher(prenominal) ways to separate radicals of hundreds of diametrical assertions. The method chosen here separates asks to 18 functional groups.\n\n assemblage 1 . No operation\n\n16 mnemotechnic regulation The\n\nNOP 00\n\nCommand death penalty requires 1.14 microseconds. Nevery of the takes or flags d o non change. NOP didactics is used by the coder to organize delays, merely the bowl to aim un inevitable restraints from the program.\n\n classify 2 . Load command cross-file constants.\n\n16 mnemotechnic recruit The\n\nLD A, + DD 3EDD\n\nLD H, + DD 26DD\n\nLD L, + DD 2EDD\n\nLD B, + DD 06DD\n\nLD C, + DD 0EDD\n\nLD D, + DD 16DD\n\nLD E, + DD lEDD\n\neach of these commands require two bytes : one for the op encipher, the second for the constant . Commands written in the register corresponding repute ​​, the old register determine ​​are disconnected.\n\nLearned commands perform load register pair double-byte constants.\n\n16 mnemotechnical tag The\n\nLD HL, + DDDD 21 DD DD\n\nLD BC, + DDDD 01 DD DD\n\nLD DE, + DDDD 11 DD DD\n\nLD IX, + DDDD DD DD DD 21\n\nLD IY, + DDDD FD 21 DD DD\n\nLD SP, + DDDD 31 DD DD\n\nCommand string requires 3 or 4 bytes in memory. The operation formula is a 1 or 2 bytes , and 2 bytes are constant. The first byte consta nts loaded into a register pair ie young L, C, E, X, Y, P, and the second byte in the head register, i.e. H, B, D, l, S. These commands are recorded in the register pairs data , which is often considered as a two-byte channelize of the programmer , that can also be a double-byte numerical pry and two single -byte numeric set.\n\n aggroups in this group do non change the flags.\n\n save radical 3 . Copy command registers and stand in. at that place are 59 police squads that perform simulateing registers and register pairs . These commands can be divided into 4 groups .\n\n replacegroup A. police squad ups write register-to- register. The interest table gives the op labels commands , re-create the content of one register to some other .\n\nLD LD LD LD LD LD LD\n\nRegister A, R H, R L, R B, R C, R D, R E, R\n\nA 7F 67 6F 47 57 4F 5F\n\nH 7C 6C 64 44 54 4C 5C\n\nL 7D 6D 65 45 55 4D 5D\n\nB 78 60 68 40 48 50 58\n\nC 79 61 69 41 49 51 59\n\nD 7A 6A 62 42 52 4A 5A\n\nE 7B 6B 63 43 53 4B 5B\n\nnone of the commands listed in the table does non change flags. There are moreover four commands for the I and R registers.\n\n16 mnemotechnic canon The\n\nLD A, I ED57\n\nLD A, R ED5F\n\nLD I, A ED47\n\nLD R, A ED4F\n\nThese latter(prenominal) commands affect the overflow flag parity.\n\nSubgroup B. groups assume - emblem register pair register pair\n\nThere are besides 3 teams in this subgroup . They replica the jimmy in the stack pointer .\n\n16 mnemotechnic work out The\n\nLD SP, HL F9\n\nLD SP, IX DD F9\n\nLD SP, IY FDF9\n\nThese commands do non change the contents of the flags. demarcation that if the contents of register pair should be copied into another register pair and these commands do not fit , you must run two commands copy a register-register . For ideal , thither is no command LD HL, DE, and re fit(p) using LD H, D and LD L, E. Or contents of the first register pair can be stored on the stack , and then rewritten in the second reg ister pair .\n\nSubgroup C. groups DE, NL.\n\nThere is whole one team that forfeit fors you to shift the contents of register pairs within the mall set of registers.\n\n16 mnemotechnic code The\n\nEXX DE, HL EB\n\nThis is a very multipurpose command concedes you to exchange contents with the contents of a pair of DE pair HL. Flags encourage does not change. Command is used when it is indispensable to character reference a two-byte numeric constant or a pair of DE was recorded in a couple of HK, simply the contents of the latter was not lost.\n\nSubgroup D. police squads alternate register set .\n\nIn this group two commands .\n\n16 mnemonic code The\n\nEXX D9\n\nEx AF, AF 08\n\nThe command causes the switch registers EXX H, L, B, C, D, E on the registers H, L, B, C, D, E. teams EXAF, AF, as the mnemonic switch reg . A and F in A F. Alternative registers are often used to store overcompensatees and data . Placed in these registers , alternative cherishs ​​ are stored from distortion and can be readily and soft repaired.\n\n company 4.Komandy incumbrance registers from the memory.\n\nThe system Z80 includes many commands that forget to get back data in memory and then load them into registers . whole of these commands require the programmer to have a couple of selles or dish out in memory where the data should be copied into the register receiving data.\n\nCommands in this group is best regarded as a command of three subgroups in accordance with a method of portion outing. Types of call uping:\n\n mediate - two-byte address is already placed in the address register pair ;\n\n mail - valid address is specify in two bytes following the opcode ;\n\n Index address of data to be orchestrated by adding the offset respect D with the aboriginal address already contained in the register pair IX or IY.\n\nSubgroup A. Teams that use direct addressing .\n\n16 Mnemonic code The\n\nLD A, (ADDR) 3A ADDR\n\nLD HL, (ADDR) 2AADDR\n\nLD BC , (ADDR) Ed 4B ADDR\n\nLD DE, (ADDR) Ed 5B ADDR\n\nLD D, (IX + D) DD 5D D\n\nLD E, (IX + D) DD 5E D\n\nFor teams that use a couple IY, should be changed to IX and IY DD to FD. None of this group of commands does not change flags.\n\n conference 5.Komandy write memory contents of a register or a constant.\n\n generally the team of this group perform operations contrary to those commands do 4.Komandy book groups to edict the contents of registers in memory or record on that point are constants. These commands get a remedy look at the three groups .\n\nSubgroup A. Teams direct addressing .\n\n16 Mnemonic code The\n\nLD (ADDR), A 32 ADDR\n\nLD (ADDR), HL 22 ADDR ( unvarying form)\n\nEd 63 ADDR ( unusual form )\n\nLD (ADDR), BC Ed 43 ADDR\n\nLD (ADDR), DE Ed 53 ADDR\n\nLD (ADDR), IX ED 22 ADDR\n\nLD (ADDR), IY ED 22 ADDR\n\nLD (ADDR), SP ED 73 ADDR\n\nThese commands produce only direct addressing and it is important to note that there is no command to store the constants. If neces sary , the constant must be pre- loaded into register A. Then, the LD (ADDR), A. Commands like LD (ADDR), HL- effectively double command : LD (ADDR), L and LD (ADDR +1), H. Commands subgroups are often used to store address esteems ​​in a memory and , when these prises ​​are used as variables. For example, commonly used LD (RAMTOP), HL, where RAMTOP- estimate pairs memory address used to store the current value of the speed limit of memory. Fetch the current value of the upper limit can be later on made ​​4 team groups, for example :\n\nLD HL, (RAMTOP).\n\nSubgroup B. Teams of indirection .\n\nTeams in this subgroup rent copying the contents of registers in memory , the address of which is contained in the register pair HL, BC or DE.\n\nthere is also a team record -byte constants at the address condition in the pair HL.\n\n16 Mnemonic code The\n\nLD (HL), A 77\n\nLD (BC), A 02\n\nLD (DE), A 12\n\nLD (HL), X 74\n\nLD (HL), L 75\n\nLD (HL), B 70\n\nLD (HL), C 71\n\nLD (HL), D 72\n\nLD (HL), E 73\n\nLD (HL), + DD 36DD\n\nSubgroup C. Teams indexed addressing .\n\n16 Mnemonic code The\n\nLD (IX + D), A DD 77 D\n\nLD (IX + D), H DD 74 D\n\nLD (IX + D), L DD 75 D\n\nLD (IX + D), B DD 70 D\n\nLD (IX + D), C DD D 71\n\nLD (IX + D), E DD 73 D\n\nLD (IX + D), + DD DD DDD 36\n\nFor teams that use IY- register pair , it is necessary to change the IX and IY DD to DF.\n\n gathering 6.Komandy addition.\n\nThis group of commands performs arithmetic . land instruction stick out the programmer to add ( in unquestioning double star arithmetic ) to a qualify number of register pair , the index register or a memory address .\n\nTeams in this group can be cover into 3 groups :\n\n Team add up;\n\n Team Inc. Special cases of addition, when added to the number 1 ;\n\n Team ADC. The value of the contribute flag is added to the go out. consume flag is one of the stains of the flags register , which is used to signal whether it was when the oddment arithmetic operation overflow register or memory byte .\n\n summarise ADC team and change the sprout flag , and Inc- does not change .\n\nSubgroup A. Teams escape.\n\n16 Mnemonic code The\n\n give A, + DD C6 DD\n\n make for A, A 87\n\n resume A, H 84\n\nhyperkinetic syndrome A, L 85\n\nAdd A, B 80\n\nAdd A, C 81\n\nAdd A, D 82\n\nAdd HL, HL 29\n\nAdd HL, BC 09\n\nAdd HL, DE 19\n\nAdd HL, SP 39\n\nAdd IX, IX DD 29\n\nAdd IX, BC DD 09\n\nAdd IX, DE DD 19\n\nAdd A, E 83\n\nAdd A, (HL) 86\n\nAdd A, (IX + D) DD 86 D\n\nFor teams using IY register should be changed to IX and IY DD to FD.\n\nSubgroup B. Teams Inc.\n\nTeams in this group conquer one to add to the register , a memory cell or a pair of registers . In all cases, the wait flag is not changed.\n\n16 Mnemonic code The\n\nInc A 3C\n\nInc H 24\n\nInc L 2C\n\nInc B 04\n\nInc C 0C\n\nInc D 14\n\nInc E 1C\n\nInc (HL) 34\n\nInc (IX + D) DD 34 D\n\nInc HL 23\n\nInc BC 03\n\nInc DE 13\n\nInc SP 33\n\nInc IX DD 23\n\nIn c IY FD 23\n\nSubgroup C. Teams ADC.\n\n16 Mnemonic code The\n\nADC A, + DD CE DD\n\nADC A, A 8F\n\nADC A, H 8C\n\nADC A, L 8D\n\nADC A, B 88\n\nADC A, C 89\n\nADC A, D 8A\n\nADC A, E 8B\n\nADC A, (HL) 8E\n\nADC A, (IX + D) DD 8E\n\nADC A, (IY + D) FD 8E\n\nADC HL, HL Ed 6A\n\nADC HL, BC Ed 4A\n\nADC HL, DE Ed 5A\n\nADC HL, SP Ed 7A\n\nTeams in this group allow to add two numbers together with the current value of the stretch forth flag . altogether teams in this group change the pay flag . It is decipherable if the operation does not give ADC overflow , and if the set gives .\n\n pigeonholing 7.Komandy deductive reasoning.\n\nTeams allow discount Subtract qualify number of single- register or register pair index memory addresses. Teams in this group effectual to divide into three groups , each of which has its own mnemonic :\n\n Team Sub;\n\nTeam DEC. Special case of price reduction, when subtracted from the number 1 ;\n\n Team SBC. use up flag value is subtracted from t he result. All teams and SBC Sub alter await flag depending on whether the required double star loan. DEC Team reserves the dribble flag unchanged.\n\nGroup 8.Komandy comparison.\n\nTeams in this group use very often in all programs. They allow the programmer to analyse the value in the register A, with a constant value in the registers and memory . Commands perform subtraction without moving , without memorizing the subtraction result and only set flags in the flags register . The initial value in register A is not changed. The carry flag is set , as in the operations of subtraction. A comparison that > = resets the carry flag , and < sets . Teams in this group - team single comparison.\n\n16 Mnemonic code The\n\nCP + DD FE DD\n\nCP A BF\n\nCP H BC\n\nCP L BD\n\nCP B B8\n\nCP C B9\n\nCP D Ba\n\nCP E BB\n\nCP (HL) BE\n\nCP (IX) + D DD Bed\n\nCP (IY) + D FD Bed\n\nGroup 9.Komandy logic.\n\nIt commands AND, Or, XOR. They changing his excitable A and other specified variable . The operation is performed go by number , and 8 - parte result is authoriseed in register A.\n\nSubgroup A. Team AND.\n\nLogical operation is performed on two binary numbers and the result is 1 only if both bits are set tried . Otherwise, the resulting bit is 0.Komandoy AND handily reset bits 0-7 of register A. This process is called unmask and allows you to check certain(prenominal) bits of a byte of data.\n\n16 Mnemonic code The\n\nAND + DD E6\n\nSubgroup B. Team Or.\n\nOr logical operation is performed on two binary digits , and the result is 1 if one or both digits are set . Otherwise, the output bit is reset.\n\n16 Mnemonic code The\n\nOr + DD E6 DD\n\nSubgroup C. Team XOR.\n\nWhen operative team tested two categories . If at least one of them, but not both , is set to one , the resulting bit is also set to 1, otherwise the resulting bit is reset.\n\nGroup 10.Komanda DJNZ.\n\nThe only team in this group is one of the most recyclable and most astray used in Z80.Rabota thi s team can be likened For-Next interlace BASIC program of the following form : For B = X TO 0 Step- 1 : Next B\n\nin this serial publication of variable B is set to X. Then, with each iteration until it decreases until it reaches the value 0.Komanda DJNZ used similarly .\n\nGroup 12 . Command stack.\n\nIn most programs, computer codes is extensive use of the machine stack : the programmer as a place where you can store data , microprocessor - to save the bring forth address . Actions that constitute this group can be divided into two groups for the user and three subgroups for the microprocessor .\n\nSubgroup A.Push and Pop\n\nThese commands allow the programmer to slip by Push 2 bytes of data in the machine stack, and to Pop- copy 2 bytes from the machine stack . These 2 bytes of data to be copied into a strictly defined pair of registers , but it is important to know that there is no record is made , which would indicate which of the two registers which byte of data belongs .\ n\nWhen the command is executed Push, pre- stack pointer decreases to indicate the free address , and copy the contents of the stack register previous(a) . Then the stack pointer decreases subsidiary , and the magnitude of the younger register is copied to the stack. oppose the action takes place during instruction movement Pop.\n\nSubgroup B. Team call back.\n\nAction Team Call the following :\n\n1.Tekuschee counter value , i.e. address of the first cell after ADDR, stored in a stack. The stack pointer is changed as in the case of team Push. High byte of the program counter is stored in the low byte of the stack .\n\n2.Address ADDR then written into the program counter and the program is executed .\n\n3.Po team Ret you take from the program.\n\nSubgroup C. Teams Ret.\n\nTeam- Ret return address of the machine stack byte program counter is restored to . In this double- stack pointer is modified upward. It is important to understand that reduced the return address of the machin e stack is not needfully the one that was placed there at the beginning of the command Call.\n\nSubgroup D. Team RST.\n\n wear subgroup teams in this group contains a command or command RST pusk.Eti repeated commands are similar to the commands Call, but do not require that the address is situated .\n\nGroup 13.Komandy shift .\n\nZ80 instruction set has a large number of commands for a certain shift bit bytes. These commands are very useful . specially because they shift the bits through the carry flag . Shift leftfield double byte value recorded in this byte ( register) , the upper bits are not lost . During the shift to the responsibility value is halved .\n\nGroup 14.Komandy bit processing .\n\n pin down the Z80 has commands that change you to define set and clear certain bits within a byte placed in a register or in-memory .\n\nSubgroup A. Teams pussy.\n\nThey allow you to determine the consideration of a item bit . Bit command flag is set to nought if used bit set , an d vice versa.\n\nSubgroup B. Command Set.\n\nThese commands allow a particular proposition set of bits , wherein none of the flags is not changed.\n\nSubgroup C. Team Res.\n\nThis command resets the specified bit . Flags do not change.\n\nTeams subgroups robotic (Non-Automatic).\n\nLDIR\n\nThis is the most common command of the group. The team leave take to the woods data , which contains the seed address in the register pair HL, to the memory address is in register pair DE. The number of bytes crusaded determined pair BC. In operation, a single byte is moved from (HL) to (DE). assess in the register pair BC then decreases , while the value in HL and DE increases.\n\nLDDR\n\nThis command is the same as the team LDIR, extract that after the sales pitch of each byte value in the HL and DE are reduced. Therefore, the command requires that the base address match the last block address . Destination information should also refers to the last address of the memory area .\n\nCPIR\n \nThis command looks for a specific area of memory to search the availableness of the first grapheme value . HL register pair must contain a base address , BC- The number of bytes to study and register A reference value . When operative bytes at HL compared with the byte is located in A. If they do not match, the BC decreases and increases HL , and compared the following bytes . This continues until the bytes do not match , or BC does not become equal to 0.\n\nhand-operated command.\n\nLDI\n\nRunning this command will move a single byte of data from the address recorded in the register pair HL, at the address recorded in the register pair DE. BC decreases in magnitude .\n\nLDD\n\nAs LDI except that the value of HL and DE are reduced.\n\nCPI\n\n exercise of this command byte is compared to the address defined in the pair HL, with a byte in register A 0 flag is set if they match , otherwise it is reset.\n\nGroup 16 . Command input \\ output .\n\nIn the Z80 has a house-to-house set of commands that allow the programmer to call up data from an external source (In) or provide data to the periphery (Out). There are simple , non- unbidden and automatic commands in this group . In all cases, the data that is hereditary through the In and Out define the shape of an 8- bit data . In Z80 on the team features data bytes from the data bus and copies them to the speech register . During the command line In IORQ active as well as RD. Team- Out Z80 transmits data from the specified register on the data bus , and from there they go to the fringy device . During operation command line IORQ Out and WR will be active . In addition, as RD, WR and IORQ will activate peripheral device device using an address placed on the address bus during the execution of either In, Out or commands . This address points to a specific port and Z80 is a 16 - bit address .\n\nGroup 17 . retard command .\n\nEI\n\nWhen you turn on the system Z80 masked oppose can not interrupt the execution of commands . This station exists as long as the interrupt will not be solved by the programmer team EI.\n\nDI\n\nAt any point in the program the programmer can disable interrupts team DI, which does not allow the microprocessor to receive signals from the line INT.\n\nIM0\n\nThere are three types of interrupts. mood 0 is selected mechanically when you turn on or team IM0. This mode allows peripheral devices to exchange information with mikroprotsessorm program re-start which should follow the reception masked interrupt line INT.\n\nIM1\n\nInterrupt Mode 1 is performed by the team during the program IM1 read-only memory monitor. In other cases, you must enable IM1 to start the program. In this mode, restart forever be selected from the address 0038h when receiving a signal on the line INT, the duration of which corresponds to the processing capabilities of the masked interrupt.\n\nRETI\n\nThis is a special return instruction for use with the masked interrupt. On the team returns to the conservation of the masked interrupt received earlier.\n\nRETN\n\nThis is a team like RETI, but it is relevant in the end of the unmasked interrupt.\n\nGroup 18 . Additional commands .\n\nCPL\n\nIs a simple command that inverts the contents of register A, ie, it sets and resets the cleared bit set . The main flags are not changed.\n\nNEG\n\nThis team twos concomitant of register A, ie, the change A = -A. This command affects the basic flags. 0 mark flags and commutative of the result. Carry flag will be set if the register was originally A 0 .\n\nSCF\n\nSet carry flag .\n\nCCF\n\nInversion of the carry flag .\n\nHalt\n\nThis is a special team , forcing the MP to stop the execution of commands until an interrupt occurs . Therefore, when you receive interrupt Halt command ends. burst command uses it to calculate the number of 1/50 of a second.

No comments:

Post a Comment