Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
system prog new.docx
Скачиваний:
1
Добавлен:
01.05.2025
Размер:
276 Кб
Скачать
☆

39. Management of files. Management of listing. Comments.

File Management

In the old DOS world, files would be manipulated using interrupts. In Windows, we

use Windows functions in order to access files. These are the 4 functions we can use:

CreateFile – Creates or opens a file, and returns its handle.

ReadFile – Reads data from a file.

WriteFile – You guessed it! Writes data to a file.

CloseHandle – Closes the handle that you obtained using CreateFile.

Management of listing

Typically, assemblers, in addition to creating an object file, provide the ability to create a program listing (TASM / L - for TASM, ml / Fl - for MASM). Listing - a file containing the text of the assembler program, the code is assembled, each command, a list of certain labels, cross-references, segments and groups. The format of the listing file is different for different assemblers and directives control the format of the file is also very different, but some of the most comprehensive guidelines yet supported by all three assemblers discussed in this book.

TITLE text - defines the header listing. The title appears in the beginning of each page;

SUBTTL text - defines a subtitle listing. The subtitle appears on the next line after the title;

PAGE height, width - sets the size of the listing pages (10-255 height, width 59-255). PAGE directive without arguments, starts a new page, the directive PAGE + begins a new section, and page numbering is from the beginning;

NAME text - specifies the name of the module program. If NAME is not specified, the name used in the first 6 characters from the TITLE; if no NAME, nor TITLE, for the name of the file name is taken;

. XLIST - cancel the issuance of the listing;

. LIST - to resolve the issue of listing;

. SALL - prohibit the listing of macro definitions;

. SFCOND - prohibit the listing not assembled conditional blocks;

. LFCOND - permit listing not assembled conditional blocks;

. TFCOND - change the listing of conditional blocks to the opposite;

. CREF - to allow cross-reference listing;

. XCREF - prohibit the listing of cross-references.

Comments

Besides the usual comments which start with, (comma) and ending at the end of a string, the large blocks of comments describing specific directive COMMENT.

comment @

any text

@

Operand for COMMENT - any character that will be the end of the comment. The entire section of the text, until the next occurrence of that character, the assembler is completely ignored.

40) Virtual drivers and virtual Windows engines.

Virtual drivers are used primarily for hardware virtualization, ie, to provide simultaneously performed tasks sharing capabilities of the computer. Measuring and control equipment that connects to a computer in order to create an automated installation is unlikely to be used in a multi-tasking, but its use for the control of virtual drivers can significantly reduce software costs and to reduce the response time. Consider the example of a virtual device driver, the service interruption from the interface board timer counter. It is obvious that the composition of such driver shall enter an interrupt handler from the board. The functions of the processor determines the programmer, in the simplest case, the handler can just read the data from the output of the counter register and the interrupt mask. However, the application is not the completion of the measurements, is more natural to arrange a call from an interrupt handler driver of a function application, which can be passed to the read data. In fact, this function will play the role of the interrupt handler applications, but it will not be called by the interrupt handler and driver. Virtual Engines in Windows When Windows is run in verbose mode, the system creates a virtual engine, in which all applications run Windows. The system virtual engine is running in protected mode. For each DOS session started again creates a separate virtual engine running in a virtual processor mode V86. Each virtual engine has a virtual processor register set and its own address space. System virtual engine also has a table LDT, wherein only one. This means that all Windows applications run in the same address space. This fact facilitates the exchange of data between applications, because it is possible to create a global memory block that is available to any application, but greatly reduces the security of Windows applications from each other. And in fact, the majority of errors in applications for its manifestation lead to having to restart the entire system.

The memory structure in the virtual engine MS-DOS

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]