C++ Operator Overloading and Polymorphism
Member Operators
Member operators are functions that define the behavior of operators when used with a class’s objects.
- Unary: One operand. Examples:
++i
,--i
,+value
,-value
. Declaration:return_type operator ++/--()
- Binary: Two operands. Examples:
=
,+=
,-
,*
,/
,==
,&&
. Declaration:return_type operator symbol (type [identifier])
- Ternary: Three operands. Example:
condition ? expression1 : expression2
Operators can be overloaded as:
- Member operators: Defined within the class, with access to
Assembly Code Examples: Periodic Interrupts and Keypad Access
Example 1: Periodic Interrupt and Counter
This program demonstrates a periodic interrupt that increments a counter (0 to 99) and prints its value to the text display.
JMP boot
JMP isr
stackTop EQU 0xFF
txtDisplayTens EQU 0x2E0
txtDisplayUnits EQU 0x2E1
counter: ; the counter
DW 0
boot:
MOV SP, stackTop ; Set SP
MOV A, 2 ; Set bit 1 of IRQMASK
OUT 0 ; Unmask timer IRQ
MOV A, 0x20 ; Set timer preload
OUT 3
STI
HLT
isr:
PUSH A
PUSH B
PUSH C
MOV A, [counter] ; Increment the
INC A ; counter
Read More
Oracle SQL and PL/SQL Quick Reference
UPPER() lower() InitCap() LENGTH() ROUND(num, 2) TRUNC(num,2)
SUBS/TR(string, initial (pos: from left, neg: from right), length (optional))
INSTR(string, lookup (case sensitive), starting pos, nth occurrence (optional))
LPAD(string, total length, fill), RPAD(string, total length, fill character)
REPLACE(‘original’, ‘find’, ‘replace’), TRIM(whattotrim FROM string)
MOD(number, divisor) -> return remainder
MONTHS_BETWEEN(date, date), ADD_MONTHS(date, # of months to add)
NEXT_DAY(date, ‘FRIDAY’)
Read MoreUnderstanding PC Components and Startup Processes
Understanding PC Components and Startup
What is the BIOS?
The BIOS (Basic Input/Output System) is what allows the computer to start. It controls the keyboard and floppy disk, and allows control to be passed to the operating system.
What is the CMOS?
The CMOS (Complementary Metal-Oxide-Semiconductor) is a small RAM chip that stores the system’s configuration.
What is Setup?
Setup is a crucial program recorded in the BIOS chip. It’s used to change the modes of transmission and the recognition (or non-recognition)
Read MoreUnderstanding Computer Capabilities: Diligence, Versatility, and Memory
Understanding Computer Capabilities
Diligence
Unlike humans, computers never tire of repetitive tasks. They can continually work for hours without creating errors. Even when a large number of executions are needed, each execution requires the same duration and is executed with the same accuracy.
Versatility
Versatility is the quality of being flexible. Today, computers are used in various fields of our daily lives. For example, they are used as personal computers (PCs) for home use, for business-oriented
Read MoreOracle Products and Database Architecture Explained
Oracle Products
Oracle Databases
The Oracle database is designed for Enterprise Grid Computing.
Oracle Application Server
Certified for Java 2 Platform Enterprise Edition (J2EE), Oracle provides the tools to develop and deploy Web-based applications.
Oracle Applications
Oracle E-Business Suite is a complete set of business applications.
Oracle Collaboration Suite
Oracle Collaboration Suite is a single integrated system for all data communications.
Global Grid Forum (GGF)
The Global Grid Forum (GGF) is an
Read More