BRK

BRK

In 6502 assembly language programming, BRK is an opcode that causes a software interrupt or trap. The generalized actions of BRK are as follows:

* The B bit in the processor status register is set to indicate that a BRK instruction is being processed.
* The program counter is incremented by two and then pushed on to the stack, most significant byte first.

* The status register is pushed on to the stack.

* Maskable interrupts (IRQ) are disabled by setting the I bit in the status register.

* The program counter is loaded with the address stored in memory address 0xFFFE (LSB) and 0xFFFF (MSB—the 6502 is little endian), and execution is continued at that point.

Note that neither the accumulator or index registers are pushed on to the stack. Also, the vector (0xFFFE) through which the processor jumps in response to BRK is the same as that for an interrupt request, requiring that the IRQ service routine get a copy of the status register from the stack to check the B bit so as to determine whether the interrupt was hardware or software.

In the original 6502, the simultaneous assertion of a hardware interrupt line and execution of BRK was not accounted for in the design—the BRK instruction will be ignored in such a case. Also, the status of the decimal mode flag in the processor status register was preserved, which could potentially result in a difficult to locate bug in the interrupt handler if decimal mode happened to be enabled at the time of BRK being executed. This was fixed in the CMOS versions of the processor.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • brk — bȓk m <N mn bȓci/bȑkovi> DEFINICIJA 1. (ob. mn brci) razg. dlake koje rastu muškarcu iznad gornje usne 2. (ob. mn brkovi) duge dlake na njušci nekih životinja 3. ovršak nekih biljaka (vrh klipa kukuruza) 4. pom. uže ili koloturnik kojim se… …   Hrvatski jezični portal

  • Brk — {{{image}}}   Sigles d une seule lettre   Sigles de deux lettres > Sigles de trois lettres AAA à DZZ EAA à HZZ IAA à LZZ MAA à PZZ QAA à TZZ UAA à XZZ …   Wikipédia en Français

  • bȓk — m 〈N mn bȓci/bȑkovi〉 1. {{001f}}(razg. ob. mn) dlake koje rastu muškarcu iznad gornje usne 2. {{001f}}(ob. mn) duge dlake na njušci nekih životinja 3. {{001f}}ovršak nekih biljaka (vrh klipa kukuruza) 4. {{001f}}pom. uže ili koloturnik kojim se… …   Veliki rječnik hrvatskoga jezika

  • brk — Definition: West Semitic, to bless. Probably a metathesized variant of krb. 1. Baruch, from Hebrew bārûk, blessed, passive participle of *bārak, to bless (only attested in derived stem bērēk, to bless). 2. broker, from Arabic al barka, colloquial …   The American Heritage dictionary of the English language

  • bŕk — a m (ȓ) nav. mn. 1. dlaka pod nosom: brki mu že poganjajo; brke briti, česati; brke si striže na krtačko; brke pogladiti, sukati, vihati si; dolgi, povešeni brki / desni, levi brk ∙ brki so se mu povesili užaljen je, potrt; ekspr. oče se je… …   Slovar slovenskega knjižnega jezika

  • BRK — Die Abkürzung BRK steht für: Bad Brückenau, deutsches Kfz Zeichen Badisches Rotes Kreuz Bayerisches Rotes Kreuz UN Behindertenrechtskonvention Berkshire Hathaway Berliner Rotes Kreuz …   Deutsch Wikipedia

  • Brk — Die Abkürzung BRK steht für: Bad Brückenau, deutsches Kfz Zeichen Bayerisches Rotes Kreuz Berkshire Hathaway Berliner Rotes Kreuz …   Deutsch Wikipedia

  • BRK —   Sigles d’une seule lettre   Sigles de deux lettres > Sigles de trois lettres   Sigles de quatre lettres   Sigles de cinq lettres   Sigles de six lettres   Sigles de sept… …   Wikipédia en Français

  • brk — West Semitic, to bless. Probably a metathesized variant of krb. 1. Baruch, from Hebrew bārûk, blessed, passive participle of *bārak, to bless (only attested in derived stem bērēk, to bless). 2. broker, from Arabic al barka, colloquial variant of… …   Universalium

  • BRK — Fax (Brooktrout Fax Mail) (Computing » File Extensions) ** Mailer REXX script (The Brake!) (Computing » File Extensions) ** Bourke, New South Wales, Australia (Regional » Airport Codes) ** Black Rook (Miscellaneous » Chess) …   Abbreviations dictionary

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”