### C Manual Setup for QuickC 2.00 on Hard Drive Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/c/kbase_c/README.md Provides instructions on how to manually set up QuickC version 2.00 on a hard drive. This is a procedural guide for users who need to install the development environment without using an automated installer. ```c // This is a set of instructions, not executable C code. // The steps would involve copying files from the installation media // to the hard drive and configuring environment variables. // Example of a configuration step (conceptual): // SET INCLUDE=C:\QC\INCLUDE // SET LIB=C:\QC\LIB // SET PATH=C:\QC\BIN;%PATH% ``` -------------------------------- ### CodeView Usage Example Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/msdos/encyclopedia/section4/README.md Illustrates the basic command-line syntax for starting CodeView with options and a file to debug. ```bash cv [options] file [arguments] ``` -------------------------------- ### Watch Window Variable Tracking Example (QuickBASIC) Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/qblearn/README.md Illustrates the setup for using the Watch window to monitor variables during debugging. The example shows how variables 'I' and 'J' would be displayed if added to the Watch window. ```quickbasic FOR I = 1 TO 900 FOR J = 1 TO 600 PRINT I PRINT J NEXT J NEXT I END ``` -------------------------------- ### Create TOPS-20 Installation Tape Directory (WFCONV) Source: https://github.com/jeffpar/pcjs/blob/master/software/dec/pdp10/tapes/vtape.txt This example illustrates the structure of a TOPS-20 installation tape directory, specifically for V7.0. It defines the tape format, record sizes, and file entries using `TF-Format: raw`. This format is used to prepare files for creating a virtual installation tape, either by copying from a real system or by converting and concatenating files. ```shell ; Tape directory for V7.0 TOPS-20 installation tape ; Bytes: 22519060, Records: 8704, Files(EOF marks): 7 TF-Format: raw 0: 2560*597 EOF ; MONITR.EXE 1528320: 2560*125 EOF ; EXEC.EXE 1848320: 2560*8 EOF ; DLUSER.EXE 1868800: 1270 EOF ; DLUSER data 1870070: 2560*36 EOF ; DUMPER.EXE 1962230: 2590*7937 EOF ; DUMPER savesets for , etc. 22519060: EOF EOT: ``` -------------------------------- ### Example: Directory Creation and Deletion Workflow Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/msdos/dosref40/README.md Demonstrates a sequence of operations including getting the current directory, creating a new subdirectory, changing to it, returning to the original, and then deleting the new subdirectory. This example utilizes functions for directory manipulation and display. ```assembly old_path db "b:",0,63 dup (?) new_path db "b:\new_dir",0 buffer db "b:",0,63 dup (?) ; begin: get_dir 2,old_path[03H] ; See Function 47H jc error_get ; Routine not shown display_asciz old_path ; See end of chapter make_dir new_path ; THIS FUNCTION jc error_make ; Routine not shown change_dir new_path ; See Function 3BH jc error_change ; Routine not shown get_dir 2,buffer[03H] ; See Function 47H jc error_get ; Routine not shown display_asciz buffer ; See end of chapter change_dir old_path ; See Function 3BH jc error_change ; Routine not shown rem_dir new_path ; See Function 3AH jc error_rem ; Routine not shown get_dir 2,buffer[03H] ; See Function 47H jc error_get ; Routine not shown display_asciz buffer ; See end of chapter ``` -------------------------------- ### QuickC 2.00 Example Program INPUT.C Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/c/kbase_c/README.md This snippet showcases an example program written in C for QuickC 2.00. It demonstrates basic C programming constructs and may serve as a starting point for new projects or as a reference for understanding QuickC's C implementation. ```c #include int main() { printf("Hello, QuickC 2.00!\n"); return 0; } ``` -------------------------------- ### Install Jekyll and Serve PCjs Locally Source: https://github.com/jeffpar/pcjs/wiki/Using-a-Local-Web-Server Steps to install Jekyll, the HTML page generator used by GitHub Pages, and run a local PCjs web server. This involves cloning the repository, installing Ruby and Bundler, installing dependencies, and starting the server. ```bash sudo gem install bundler bundle install bundle exec jekyll serve ``` -------------------------------- ### C 6.00a CD-ROM Setup Missing RAMDRIVE/SMARTDRV Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/c/kbase_c/README.md Notes that the C 6.00a CD-ROM setup does not install RAMDRIVE or SMARTDRV. Users may need to manually install these drivers for optimal performance. ```text This issue pertains to the installation process and does not involve direct code snippets. ``` -------------------------------- ### Client Initialization and DDE Advise Setup (C) Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/msj/msj1/README.md Initializes DDE by adding atoms, initiating a DDE conversation, and posting WM_DDE_ADVISE messages to servers for specific stock data. Relies on DDE.EXE for atom management. ```c HWND hwndServer; ATOM aStockInfo; void SampleRcvrCreate(HWND hwnd) { HMENU hMenu; DDEADVISEBLOCK far *lpmem; int i; aStockInfo = DDEAddAtom((LPSTR)"NYSE.COM.STK"); SendMessage((HWND) -1, WM_DDE_INITIATE, hwnd, MAKELONG(NULL, aStockInfo)); DDEDeleteAtom(aStockInfo); if (hwndServer == NULL) return; stockinfo[0].Atom = DDEAddAtom((LPSTR)"T"); stockinfo[1].Atom = DDEAddAtom((LPSTR)"GM"); stockinfo[2].Atom = DDEAddAtom((LPSTR)"IBM"); stockinfo[3].Atom = DDEAddAtom((LPSTR)"INDU"); for (i = 0; i< NUMSTOCKS; i++) { hmem[i] = GlobalAlloc(GHND, (DWORD)4); lpmem = (DDEADVISEBLOCK far *)GlobalLock(hmem[i]); lpmem->wDDEMODE = 0; lpmem->wFormat = CF_TEXT; GlobalUnlock(hmem[i]); PostMessage( (HWND) hwndServer, WM_DDE_ADVISE, hwnd, MAKELONG(hmem[i],stockinfo[i].Atom) ); } } ``` -------------------------------- ### MASM Programmer's Guide: EXTR Examples Incorrect Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/masm/kbase_m/README.md Indicates that the examples provided in the MASM Programmer's Guide for using the `EXTR` directive (likely referring to `EXTRN`) are incorrect. This affects how external symbols are declared. ```assembly ; Correct usage of EXTRN (External Reference) in MASM ; In Module 1 (e.g., main.asm) .MODEL SMALL EXTRN MyExternalProc:NEAR, ExternalVar:WORD .CODE main PROC MOV AX, @DATA MOV DS, AX CALL MyExternalProc MOV BX, ExternalVar ADD BX, 10 MOV ExternalVar, BX MOV AH, 4Ch INT 21h main ENDP END main ; In Module 2 (e.g., external.asm) .MODEL SMALL .DATA ExternalVar WORD 5 .CODE MyExternalProc PROC ; ... procedure body ... RET MyExternalProc ENDP END ; The Programmer's Guide might have shown incorrect syntax or usage for EXTRN. ``` -------------------------------- ### QuickBASIC Immediate Window Command Example Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/qblearn/README.md Shows an example of a command that can be executed directly in the Immediate window of QuickBASIC. This allows for instant execution of BASIC statements. ```basic LOCATE 4,5 : PRINT "TEST" ``` -------------------------------- ### QuickHelp Format Example Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/c/cadvisor/README.md Demonstrates the QuickHelp format for authoring help text. Each topic begins with one or more '.context' lines defining context strings, followed by the topic text. This format is suitable for text editors and automated translation. ```text .context #define Syntax: #define #define [()] Replaces all subsequent cases of \bidentifier\p with the substitution-text. If \bparameter-list\p is given after \bidentifier\p, each occurrence of \bidentifier\p (\bparameter-list\p) is replaced with a version of \isubstitution-text\p modified by substituting actual arguments for formal parameters. ``` -------------------------------- ### MS-DOS Get Interrupt Vector Macro and Example (Assembly) Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/msdos/dosref40/README.md Defines a macro 'get_vector' to retrieve the interrupt vector for a specified interrupt number using MS-DOS function 35H. An example shows how to get and display the vector for Interrupt 25H. ```assembly get_vector macro interrupt mov al,interrupt mov ah,35H int 21H endm message db "Interrupt 25H -- CS:0000 IP:0000" db 0DH,0AH,"$" vec_seg db 2 dup (?) vec_off db 2 dup (?) ; begin: push es ; save ES get_vector 25H ; THIS FUNCTION mov ax,es ; INT25H segment in AX pop es ; save ES convert ax,16,message[20] ; see end of chapter convert bx,16,message[28] ; see end of chapter display message ; See Function 9 ``` -------------------------------- ### Automated Mouse and Game Startup Script for Trump Castle Source: https://github.com/jeffpar/pcjs/blob/master/software/pcx86/game/other/1988/trump_castle/README.md This script automates the setup of MS Mouse and launches the Trump Castle game on a PCx86 machine. It waits for keyboard input, mounts the MS Mouse disk, installs it, then mounts the Trump Castle disk and starts the game. Dependencies include the PC DOS 3.30 (Disk 1) and MS Mouse 6.14 (SETUP) disks. ```machineScript wait Keyboard DOS; type Keyboard "\r\r"; wait Keyboard; sleep 1000; select FDC listDrives "A:"; select FDC listDisks "MS Mouse 6.14 (SETUP)"; loadDisk FDC; wait FDC; type Keyboard "MOUSE\r"; sleep 2000; select FDC listDrives "A:"; select FDC listDisks "Trump Castle 1.20 (1988)"; loadDisk FDC; wait FDC; type Keyboard "TRUMP\r"; ``` -------------------------------- ### Hotspot and Cross-Reference Example (Simple) Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/c/cadvisor/README.md Shows a basic implementation of a hotspot and cross-reference in QuickHelp format. The word '.EXE' acts as a hotspot, linking to the help topic with the context 'exe_format'. Invisible text is used for the cross-reference. ```text .context EXE2BIN EXE2BIN Convert .EXE file to Binary-Image File \bPurpose\b Converts an executable file in the .EXE\vexe_format\v format to a memory image file in binary format. The EXE2BIN utility is supplied with the MS-DOS distribution disks. ``` -------------------------------- ### NMAKE Example with Paths Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/masm/kbase_m/README.md Provides a complete example of utilizing NMAKE (a build utility) with paths. This demonstrates how to specify include paths and library paths for the build process, ensuring that NMAKE can locate necessary files. ```makefile # NMAKE example with paths CC = cl CFLAGS = /I"C:\MyIncludes" /Zi LFLAGS = /LIBPATH:"C:\MyLibs" TARGET = myprogram.exe {TARGET}: main.obj utils.obj $(CC) $(CFLAGS) $(LFLAGS) main.obj utils.obj /OUT:{TARGET} main.obj: main.c $(CC) $(CFLAGS) /c main.c utils.obj: utils.c $(CC) $(CFLAGS) /c utils.c clean: DEL *.obj *.exe ``` -------------------------------- ### PCjs Scripting Example: IBM TopView 'startMouse' - PCjs Source: https://github.com/jeffpar/pcjs/blob/master/blog/_posts/2018/2018-03-22-turbo-pascal-vs-quickpascal.md A sophisticated PCjs script demonstrating automated setup for IBM's TopView 1.01. It simulates disk loading, driver installation, and configuration for serial mouse support, showcasing advanced scripting capabilities. ```text wait Keyboard DOS; type Keyboard "$date\r$time\r"; wait Keyboard; sleep 1000; select FDC listDrives "A:"; select FDC listDisks "MS Mouse 5.00 (SYSTEM)"; loadDisk FDC; wait FDC; type Keyboard "MOUSE\r"; sleep 7000; type Keyboard "B:\rSETUP\r$50.3\r$20n\r$20y\r$20\r$20\r$20.1\r"; ``` -------------------------------- ### HELPMAKE Modifying Help Files (QuickC Example) Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/masm/kbase_m/README.md This snippet provides an example using HELPMAKE to modify existing help files, specifically mentioning QuickC. It suggests that HELPMAKE can be used for updating help documentation. ```help_authoring ; Example of modifying a help file with HELPMAKE (conceptual) ; HELPMAKE myhelp.hlp /MODIFY mynewcontent.txt ; This assumes mynewcontent.txt contains the changes. ``` -------------------------------- ### Get File Size (Function 23H) - Assembly Example Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/msdos/dosref40/README.md An assembly example demonstrating the use of Function 23H to get a file's size. It prompts the user for a filename, opens the file to populate the FCB, calls the file_size macro, and then displays the record length and number of records. ```assembly fcb db 37 dup (?) prompt db "File name: $" msg1 db "Record length: ",0DH,0AH,"$" msg2 db "Records: ",0DH,0AH,"$" crlf db 0DH,0AH,"$" reply db 17 dup(?) ; begin: display prompt ; see Function 09H get_string 17,reply ; see Function 0AH cmp reply[1],0 ; just a CR? jne get_length ; no, keep going jmp all_done ; yes, go home get_length: display crlf ; see Function 09H parse reply[2],fcb ; see Function 29H open fcb ; see Function 0FH file_size fcb ; THIS FUNCTION mov ax,word ptr fcb[33] ; get record length convert ax,10,msg2[9] ; see end of chapter mov ax,word ptr fcb[14] ; get record number convert ax,10,msg1[15] ; see end of chapter display msg1 ; see Function 09H display msg2 ; see Function 09H all_done: close fcb ; see Function 10H ``` -------------------------------- ### Main Program Logic (DIVZERO.ASM) Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/msdos/encyclopedia/figures/README.md The 'start' routine initializes the program by getting the current Interrupt 00H vector, installing the custom interrupt handler, performing test divisions, restoring the original interrupt vector, and terminating the program. It uses MS-DOS functions 35h and 25h for vector manipulation. ```assembly ; ; The code beginning at 'start' is the application ; program. It alters the vector for Interrupt 00H to ; point to the new handler, carries out some divide ; operations (including one that will trigger an ; interrupt) for demonstration purposes, restores ; the original contents of the Interrupt 00H vector, ; and then terminates. ; start: mov ax,3500h ; get current contents int 21h ; of Int 00H vector ; save segment:offset ; of previous Int 00H handler mov word ptr oldint0,bx mov word ptr oldint0+2,es ; install new handler... mov dx,offset int0 ; DS:DX = handler address mov ax,2500h ; call MS-DOS to set int 21h ; Int 00H vector ; now our handler is active, ; carry out some test divides. mov ax,20h ; test divide mov bx,1 ; divide by 1 call divide mov ax,1234h ; test divide mov bx,5eh ; divide by 5EH call divide mov ax,5678h ; test divide mov bx,7fh ; divide by 127 ``` -------------------------------- ### NMAKE Utility Example and Path Usage in NMAKE Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/kbase_b/README.md Provides an explanation and example of the NMAKE.EXE utility, including how to utilize paths within NMAKE makefiles. This is useful for understanding build processes and dependency management. ```makefile # Example NMAKE Makefile TARGET = myprogram OBJS = main.obj utils.obj $(TARGET): $(OBJS) link $(OBJS); main.obj: main.c c1 /c main.c utils.obj: utils.c c1 /c utils.c # Example of using paths INCLUDE_PATH = C:\MyIncludes main.c: cl /I$(INCLUDE_PATH) main.c ``` -------------------------------- ### Get Range of IMS Values for a Module Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/c/ctoolkit/README.md Retrieves the starting and ending IMS values for a given IMOD. If the start and end values are equal, the module contains no definitions. ```c VOID API MsRangeOfMod (IMOD imod, IMS far *pimsMin, IMS far *pimsMac); ``` -------------------------------- ### Helpex (Sample Help) Project File Configuration Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/win/w3sdktl/README.md This snippet shows the configuration for the 'helpex' sample Help project file. It includes options for the root directory, index file, title, and compression, as well as a list of files and a map section with defined HELPIDs. ```INI [OPTIONS] ROOT=c:\help INDEX=main_index TITLE=Help Example COMPRESS=true [FILES] helpex.rtf ; jump topics terms.rtf ; look-up terms [MAP] main_index 0xFFFF #define HELPID_EDIT_CLEAR 100 #define HELPID_EDIT_COPY 101 #define HELPID_EDIT_CUT 102 #define HELPID_EDIT_PASTE 103 #define HELPID_EDIT_UNDO 104 #define HELPID_FILE_EXIT 200 #define HELPID_FILE_NEW 201 #define HELPID_FILE_OPEN 202 #define HELPID_FILE_PRINT 203 #define HELPID_FILE_SAVE 204 #define HELPID_FILE_SAVE_AS 205 #define HELPID_EDIT_WINDOW 300 #define HELPID_MAXIMIZE_ICON 301 #define HELPID_MINIMIZE_ICON 302 #define HELPID_SPLIT_BAR 303 #define HELPID_SIZE_BOX 304 #define HELPID_SYSTEM_MENU 305 #define HELPID_TITLE_BAR 306 #define HELPID_SIZING_BORDER 307 ``` -------------------------------- ### Pascal Example Compilation Issue Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/kbase_b/README.md Highlights a problem where a Pascal example provided in a programmer's guide fails to compile. This suggests a potential error in the example code or an incompatibility with the compiler version. ```pascal (* This is a placeholder for a typical Pascal program structure. *) (* The actual problematic code would be specific to the example in the guide. *) program ExampleProgram; var i: Integer; begin (* Example code that might cause compilation errors: *) (* For i := 1 to 10 do writeln('Count: ', i); *) (* Potential issue: Incorrect syntax, undeclared variables, or compiler-specific features. *) writeln('Pascal example program.'); end. ``` -------------------------------- ### Get Printer Setup String (MS-DOS API Function 5EH, Code 03H) Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/msdos/dosref40/README.md Retrieves the current printer setup string. The function returns the length of the string and a pointer to the ASCII setup string. Requires a valid assign-list index for the printer. ```assembly ; Example usage for getting printer setup string (conceptual, requires context) ; AH = 5EH ; AL = 03H ; BX = printer_assign_list_index ; ES:DI = buffer_for_setup_string ; int 21H ; ; Return: ; CX = length of setup string ; ES:DI = pointer to ASCII printer setup string ``` -------------------------------- ### QuickC 2.00 Creating a .COM File (/BI) Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/c/kbase_c/README.md This documentation covers the process of creating a `.COM` executable file using QuickC 2.00 with the `/BI` option. It outlines the necessary steps and considerations for generating small, memory-resident programs. ```text QCL /BI myprogram.c ``` -------------------------------- ### Mouse Script for IBM TopView Debugger Setup Source: https://github.com/jeffpar/pcjs/blob/master/software/pcx86/sys/ext/ibm/topview/1.00/debugger/README.md This script automates mouse setup and IBM TopView installation. It initializes the keyboard, selects specific disks from the floppy drive, loads them, and then executes the TopView setup program with predefined responses. ```shell wait Keyboard DOS; type Keyboard "$date\r$time\r"; wait Keyboard; sleep 1000; select FDC listDrives "A:"; select FDC listDisks "MS Mouse 5.00 (SYSTEM)"; loadDisk FDC; wait FDC; type Keyboard "MOUSE\r"; sleep 10000; type Keyboard "B:\rSETUP\r$70.3\r$30n\r$30y\r$30\r$30\r$30\r"; ``` -------------------------------- ### Load Quick Library with QBX Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/b7start/README.md Shows the command-line syntax for starting QBX with a specific Quick library loaded. This makes the library's routines available to your programs within the QBX environment. The '/L' option is used to specify the library file. ```shell QBX /L CHRTBEFR.QLB ``` -------------------------------- ### QuickBASIC $INCLUDE Metacommand Examples Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/qblearn/README.md Demonstrates how to use the $INCLUDE metacommand in QuickBASIC to incorporate external files into a program. It shows examples of specifying include files with full and relative path names. ```quickbasic ' $INCLUDE: 'C:\includedeclares.bi' ' $INCLUDE: '..\includedeclares.bi' ``` -------------------------------- ### Write and Run a First QuickBASIC Program Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/qblearn/README.md This snippet demonstrates how to create and execute a basic QuickBASIC program. It includes clearing the screen, printing text, and performing a simple calculation. The program is written in QuickBASIC. ```quickbasic cls print "This is my first QuickBASIC program" print 2 + 2 ``` -------------------------------- ### PRINTERS.INI File Format Example Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/win/w3ddkprn/README.md This example demonstrates the structure of the PRINTERS.INI file, which lists PostScript printer names and their corresponding full display names. This file is used in conjunction with .WPD files for printer installation. ```ini [PSCRIPT] abc_ps = ABC PostScript Printer xyz_ps = XYZ PostScript Printer ver 43.1 ``` -------------------------------- ### Execute BASIC Command in QBX Immediate Window Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/b7start/README.md Demonstrates how to type and execute a BASIC command directly in QBX's Immediate window. This is useful for testing small code snippets or performing quick operations. The command is executed upon pressing Enter. ```basic CLS "Today's date is: " + DATE$ ``` -------------------------------- ### Real-Coordinate Graphics Example Program Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/c/c4yrself/README.md An example C program demonstrating the use of real-coordinate windowing functions in PCjs graphics. It includes setup for graphics modes, viewports, and real-coordinate windows, along with plotting functions. ```c #include #include #include #define TRUE 1 #define FALSE 0 int four_colors( void ); void three_graphs( void ); void grid_shape( void ); int halfx, halfy; struct videoconfig screen; double bananas[] = { -0.3, -0.2, -0.224, -0.1, -0.5, +0.21, +2.9, +0.3, +0.2, 0.0, -0.885, -1.1, -0.3, -0.2, +.001, +.005, +0.14, 0.0, -0.9, -0.13, +0.3 }; main() { if( four_colors() ) three_graphs(); else printf( "This program requires a CGA, EGA,\n or VGA graphics card.\n" ); } /* . Additional functions defined below . . */ ``` -------------------------------- ### List PWB Command-Line Options Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/basic/b7start/README.md The /? option displays a list of available command-line options for running PWB. This is a helpful command for users to discover and understand PWB's startup functionalities. ```bash PWB /? ``` -------------------------------- ### Pascal: Example Compilation Error Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/masm/kbase_m/README.md Addresses an issue where a Pascal example provided in a programmer's guide fails to compile. This might involve syntax errors, incorrect compiler flags, or missing include files. ```pascal (* Q68881: Pascal Example in Programmer's Guide Won't Compile *) program ExampleProgram; var i: integer; begin (* The original example might have had a syntax error here, e.g.: *) (* writeln('Hello, world!') // Missing semicolon or incorrect syntax *) (* Corrected version (assuming a simple output) *) writeln('Hello, world!'); for i := 1 to 10 do begin writeln('Count: ', i); end; end. ``` -------------------------------- ### Example autoexec.bat configuration Source: https://github.com/jeffpar/pcjs/blob/master/tools/pc/README.md This is an example of an autoexec.bat file. It sets the PATH environment variable to 'C:\' and then lists all files in the current directory. This configuration is typical for setting up the environment when a PCjs machine starts. ```batch @ECHO OFF PATH C:\ dir *.* ``` -------------------------------- ### PCx86 Environment Setup and File Copying Source: https://github.com/jeffpar/pcjs/blob/master/blog/_posts/2017/2017-07-03-fantasyland.md This snippet shows the initialization of the PCx86 emulator, loading of various system ROMs and hard disk images, and the copying of files from a diskette to the C: drive. It sets up the necessary environment for the EGATEST build. ```shell Loading /machines/pcx86/ibm/5160/rom/hdc/IBM-XEBEC-1982.json5....... Loading /machines/pcx86/ibm/5160/rom/basic/BASIC110.json5....... Loading /machines/pcx86/ibm/5160/rom/bios/1982-11-08/XTBIOS-REV1.json5....... Loading /machines/pcx86/ibm/video/ega/1984-09-13/IBM-EGA.json5....... HDC: Type 3 "10Mb Hard Disk" is fixed disk 0 Loading /harddisks/pcx86/10mb/MSDOS320-C400.json....... Loading /software/pcx86/lang/logitech/modula2/1.10/state.json........ Bus: 8Kb ROM at 000C8000 Bus: 8Kb ROM at 000FE000 Bus: 32Kb ROM at 000F6000 Bus: 16Kb ROM at 000C0000 HDC: Mounted disk "10Mb Hard Disk" in drive C Bus: 640Kb RAM at 0000 RAM: 0xa0000 (640Kb) size overrides SW1 RAM: ROM BIOS memory test has been disabled Bus: 32Kb VIDEO at 000B8000 Type ? for help with PCx86 Debugger commands AX=0100 BX=0004 CX=00F9 DX=007F SP=09F6 BP=0000 SI=00D3 DI=01A9 SS=028C DS=028C ES=028C PS=F202 V0 D0 I1 T0 S0 Z0 A0 P0 C0 &028C:14AD 2E CS: &028C:14AE 8F068005 POP WORD [0580] running Loading /disks/pcx86/shareware/pctj/PCTJ8610.json....... FDC: Mounted diskette "PC Tech Journal (1986-10)" in drive A C:\>mkdir egatest C:\>cd egatest C:\EGATEST>copy a:*.* A:DOTTIME.DEF A:DOTTIME.MOD A:DRAWPOLY.DEF A:DRAWPOLY.MOD A:EDITBLCK A:EGAMAKE.BAT A:EGATEST.EXE A:EGATEST.MOD A:FONTBUMP.DEF A:FONTBUMP.MOD A:INFO A:LOWEGA.DEF A:LOWEGA.MOD A:OPCODES.DEF A:OPCODES.MOD A:OTHRFONT.DAT A:PAUSES.DEF A:PAUSES.MOD A:POINTLIB.DEF A:POINTLIB.MOD 20 File(s) copied C:\EGATEST>egamake C:\EGATEST>rem C:\EGATEST>rem compile files in this order to avoid version conflicts C:\EGATEST>rem ``` -------------------------------- ### Absolute Disk Write (INT 26H) Macro and Example Source: https://github.com/jeffpar/pcjs/blob/master/documents/books/mspl13/msdos/dosref40/README.md Provides a macro definition for `abs_disk_write` and an example of its usage. This interrupt writes data from memory to a specified sector on a disk. It requires careful parameter setup and warns against misuse. ```assembly abs_disk_write macro disk,buffer,num_sectors,first_sector mov al,disk mov bx,offset buffer mov cx,num_sectors mov dx,first_sector int 25H popf endm Example: The following program copies the contents of a single-sided disk in drive A to the disk in drive B. prompt db "Source in A, target in B",0DH,0AH db "Any key to start. $" first dw 0 buffer db 60 dup (512 dup (?)) ; 60 sectors ; begin: display prompt ; see Function 09H ; read_kbd ; see Function 08H ; mov cx,6 ; copy 6 groups of ; ; 60 sectors ; copy: push cx ; save the loop counter ; abs_disk_read 0,buffer,60,first ; THIS INTERRUPT ; abs_disk_write 1,buffer,60,first ; see INT 26H ; add first,60 ; do the next 60 sectors ; pop cx ; restore the loop counter ; loop copy ```