SUMMARY
1. The assembler program (ML.EXE) assembles modules that contain PUBLIC variables and segments, plus EXTRN (external) variables. The linker program (LINK.EXE) links modules and library files to create a run-time program executed from the DOS command line. The run-time program usually has the extension EXE, but might contain the extension COM.
2. The MACRO and ENDM directives create a new opcode for use in programs. These macros are similar to procedures, except that there is no call or return. In place of them, the assembler inserts the code of the macro sequence into a program each time it is invoked. Macros can include variables that pass information and data to the macro sequence.
3. Setting focus to an object is accomplished by using the Focus( ) member variable found with most objects.
4. The Convert class in C++ is used to convert from one form to another in many cases, but not in all cases.
5. The mouse driver is accessed from Windows by installing handlers for various Windows events such as Mouse Move, Mouse Down, etc.
6. Conversion from binary to BCD is accomplished with the AAM instruction for numbers that are less than 100 or by repeated division by 10 for larger numbers. Once the number is converted to BCD, 30H is added to convert each digit to ASCII code for placement in a string.
7. When converting from an ASCII number to BCD, 30H is subtracted from each digit. To obtain the binary equivalent, multiply by 10 and then add each new digit.
8. Lookup tables are used for code conversion with the XLAT instruction if the code is an 8-bit code. If the code is wider than 8 bits, a short procedure that accesses a lookup table provides the conversion. Lookup tables are also used to hold addresses so that different parts of a pro- gram or different procedures can be selected.
9. Conditional assembly language statements allow portions of a program to be assembled if a condition is met. These are useful for tailoring software to an application. In Visual C++ Express, a program that contains assembly code must be compiled with the /CLR switch.
10. The disk, memory system contains tracks that hold information stored in sectors. Many disk systems store 512 bytes of information per sector. Data on the disk are organized in a boot sector, file allocation table, root directory, and data storage area. The boot sector loads the DOS system from the disk into the computer memory system. The FAT or MFT indicates which sectors are present and whether they contain data. The root directory contains file names and subdirectories through which all disk files are accessed. The data storage area contains all subdirectories and data files.
11. Files are manipulated with the File object in Visual C++. To read a disk file, the file must be opened, read, and then closed. To write to a disk file, it must be opened, written, and then closed. When a file is opened, the file pointer addresses the first byte of the file. To access data at other locations, the file pointer is moved using a Seek before data are read or written.
12. A sequential access file is a file that is accessed sequentially from the beginning to the end.
A random access file is a file that is accessed at any point. Although all disk files are sequential, they can be treated as random access files by using software.