How to compare values for equality by subtraction (SUBWF and STATUS Z) | PIC assembly programming @PizzeyTechnology
How to compare values for equality by subtraction (SUBWF and STATUS Z) | PIC assembly programming  @PizzeyTechnology
Uploaded March 2022 | Updated November 2026, 12 hours ago
PIC assembly programming for GCE A level Electronics.
In this video I demonstrate how to check the value stored in a file register (a "variable") by subtraction and then checking the STATUS Z bit.
The general method is as follows:
- Store value1 into the working file register.
- Move the contents of the working file register into a specified file register.
- Store value2 into the working file register.
- Subtract value2 from value1 stored in the file register. Output the result to the working file register.
- Check the STATUS Z bit. If this "flag" is set the subtraction resulted in zero, therefore value1=value2.
- Perform a conditional branch based on the value of the Z bit.

Please note there are other ways to compare values. This method may not be ideal for your application.
How to compare values for equality by subtraction (SUBWF and STATUS Z) | PIC assembly programmingArboga G2508 Swedish drill press gearbox disassembly3 phase coolant pump with single phase supply #shortsAEI BC3010 3/4 HP single phase induction motorBoxford metal lathe for saleFlashing warning lamp and polling digital input | GCSE ElectronicsElectronics mock exam 2021 Q4 | Sensors and curves, Potential dividers, MOSFET calculationsUsing a contactor with a VFD on my Harrison M300 lathe (video 2/3)Electronics mock exam 2021 Q3 | Logic, Truth tables, NAND equivalent circuits, Redundant gatesElectronics mock exam 2021 Q5 | Using a transistor as a switch (transducer driver)Fly press bolster and hole punch tooling
Pizzey Technology |

How to compare values for equality by subtraction (SUBWF and STATUS Z) | PIC assembly programming

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER