ASSEMBLER - STATUSBITS - PROCESSOR FLAGS -------------------------------------------------------------------------------------------------- TOOL: Built-In ML-Monitor / RONMON-Special, RUN-11-1987-GERMAN {Commodore C128} Language: Assembler Extra: - Author: Misel Zivanovic Note: (C) 18th DEC 2025 - www.lived.ch, mzretro.ch --------------------------------------------------------------------------------------------------- Commodore C128 has no command to show you the FLAG status, however I've found in RUN-COMPUTER-MAGAZINE a listing which is giving us RONMON and there you have a command: B {and ENTER} which is showing the status of the FLAGS. To know what to do with that in first place, i made this listing below. It should help you to feel yourself like at home while programming in assembler! {I guess, haha} If nothing else, now you know how: - the numbers between 0 and 127 are POSITIVE - the numbers between 128 and 255 are NEGATIVE! And you immediately learned BLP and BMI branch commands - BPL - Branch if the result is PLUS {Positive} - BMI - Branch if the result is MINUS {NEGATIVE} |---------------------------------------|------------------------|--------------------------------------| |CPU-STATUS BITS {0 - 7} |FLAGS | WHO'S KNOCKING ON THE DOOR!? | |---------------------------------------|------------------------|--------------------------------------| | | | | |Bit -| 7 | 6 | 5 | 4 | 3 | 2 | 1| 0 | |7 - NEGATIVE * | {Branch BPL } {Branch: BMI } | |Flag-| N | V | - | B | D | I | Z| C | |6 - OVERFLOW | {Branch: BVC, BVS } | |---------------------------------------|5 - *** UNUSED *** | - | | |4 - BREAK Command | {BRK command } | | |3 - DECIMAL Mode | {SED SEt Decimal or Clear = CLD } | | |2 - INTERRUPT DISABLED | {SEI SEt Interrupt or Clear = CLI } | | |1 - ZERO | {BNE and BEQ commands are using it } | | |0 - CARRY | {BCC and BCS commands are using it } | |---------------------------------------|------------------------|--------------------------------------| |* = | |{#$00-#$7f = POSITIVE VALUES} & {#$80 - #$ff = NEGATIVE VALUES}| | | |---------------------------------------------------------------| STATUS BITS {FLAGS| ARE EFFECTED BY THE FOLLOWING COMMANDS: |----------------------------------| |NEGATIV BIT 7 | | | |----------------------------------| |ADC, AND, ASL, BIT, CMP, CPY, CPX | |DEC, DEX, DEY, EOR, INC, INX, INY | |LDA, LDX, LDY, LSR, ORA, PLA, PLP | |ROL, ROR, RTI, SBC, TAX, TAY, TSX | |TXA, TXS, TYA | |----------------------------------| |----------------------------------| |OVERFLOW BIT 6 | | | |----------------------------------| |ADC, BIT, CLV, PLP, RTI, SBC | |----------------------------------| |----------------------------------| |UNUSED BIT 5 | | | |----------------------------------| |----------------------------------| |BREAK BIT 4 | | | |----------------------------------| |BRK | |----------------------------------| |----------------------------------| |DECIMAL BIT 3 | | | |----------------------------------| |CLD, PLP, RTI, SED | |----------------------------------| |----------------------------------| |INTERRUPT BIT 2 | | | |----------------------------------| |BRK, CLI, PLP, RTI, SEI | |----------------------------------| |----------------------------------| |ZERO BIT 1 | | | |----------------------------------| |ADC, AND, ASL, BIT, CMP, CPY, CPX | |DEC, DEX, DEY, EOR, INC, INX, INY | |LDA, LDX, LDY, LDY, LSR, ORA, PLA | |PLP, ROL, RTI, SBC, TAX, TAY, TSX | |TXA, TXS, TYA | |----------------------------------| |----------------------------------| |CARRY BIT 0 | | | |----------------------------------| |ADC, ASL, CMP, CLC, CPX, CPY, LSR | |PLP, ROL, ROR, RTI, SBC, SEC | |----------------------------------|