HP2100-related Batch Files for Windows ====================================== hp2100abs.bat - "runs" ABS files in the HP2100 simulator hp2100abs.sim - default simulator setup for hp2100abs.bat asmhpasm.bat - assembles HP .asm/.hpa sources with HPASM asm21.bat - assembles HP .asm/.hpa sources with Asm21.pl ptheader.bin - just 8 zero bytes in a file to add as a ABS leader Caution... batch files and software in general can be dangerous to data if incorrectly edited or something goes horribly wrong. Be careful and all should be fine, but these files come with no warrantee, you the user assume all responsibility for whatever happens if you use them so please study the code first, understand what they do, and if you have any questions ask me. It's perfectly possible to assemble HP assembly source and simulate the resulting code under hp2100.exe without using these batch files. The main advantages to using the asm batches (or similar batch files) is to add a leader to the ABS output and rename the output files to .abs and .lst with the same base name as the source file. The hp2100abs.bat file is useful for double-clicking and running ABS files that are compatible with a default simulator configuration without having to set up extra sim scripts, launch the simulator, etc. It is not intended for seting up disk/magtape or other sims that go beyond basic TTY/PTR/PTP devices, for convenience the hp2100abs.sim file is a copy of a typical HP-IPL/OS sim setup script and can be copied to another file and edited to operate fixed simulations where disk and/or magtape files are attached. These batch files are written to reside in the directory C:\hp2100bat, to put in a different directory edit the batch files to change the file paths. The batches and these instructions are written to run hpasm.exe, asm21.pl and hp2100.exe from the C:\hp2100bat directory, edit them if you wish these files to reside elsewhere. Setting up batches, associations and all that can be complicated if not familiar with the process, and I have no idea what PC skill level a reader of this might have so giving a brief overview, then a more detailed step-by-step version. Also note that batch files in general are OS-specific and depend on other programs and commands doing what they do on my system, so I cannot guarantee they'll work on all Windows systems, you may have to tweak them to adapt. I tested these under Windows XP SP2 and they seem to work OK, the assembler batches even work with long or space-containing directory or file names but this is not guaranteed. They work as-is under Win95 but the association process is different (options|file types, define new types and actions). I'm pretty sure long names won't work under Win95 (but I seem to recall that adding lfnfor on before the for command and lfnfor off after it would enable such things... or something like that). For advanced users: copy the batches, hp2100abs.sim and ptheader.bin to the directory C:\hp2100bat (or where edited to reside), copy hpasm.exe and/or asm21.pl and the hp2100.exe file to C:\hp2100bat, if using asm21.pl install ActivePerl or another Windows perl runtime, associate .abs files to hp2100abs.bat and associate .asm and .hpa files to the asm*.bat file(s) you wish to use. Copy hp2100abs.bat and hp2100abs.sim to new files and edit appropriately if you want crlf enters, telnet or other configurations when "running" ABS files. Now the long version... To "install" copy the hp2100bat directory (you're in it, go back one level) to Local Drive C:\ (open another Explorer window, set it to C:\ and drag the hp2100bat folder to it while holding down the control key). Open the new C:\hp2100bat folder add the following files to it, depending on what you want to do... hp2100.exe if you want to run ABS files with hp2100abs.bat hpasm.exe if you want to assemble with asmhpasm.bat asm21.pl if you want to assemble with asm21.bat hpasm.exe and its C source is among the files at: http://www.infionline.net/~wtnewton/oldcomp/hp2100/hpos_utl.zip My modified hp2100.exe is at: http://www.infionline.net/~wtnewton/oldcomp/hp2100.exe.zip or get it with all the sims at: http://simh.trailing-edge.com/ asm21.pl is at: http://www.brouhaha.com/~eric/software/asm21/ To use asm21.pl a Perl interpreter must be installed, such as ActivePerl from: http://activestate.com/store/activeperl/download/ This is a 15 meg download that soaks up another 100 megs but installation is brain-dead easy, get the MSI installer, run it, accept the defaults. Note! You need to see the extensions! By default Windows hides them but then you won't know what you're editing, so find that option that says "Hide extensions of registered types" (or something like that) and uncheck it. Extensions matter greatly especially when there are multiple kinds of text that all end up with the same icon. Feel free to do it by icons instead but you'll have to give each extension a different icon, one way or another you need to distinguish between .sim .txt .ipl .asm etc. To set up associations... associate .abs files with C:\hp2100bat\hp2100abs.bat associate .asm and .hpa files with C:\hp2100bat\asmhpasm.bat and/or associate .asm and .hpa files with C:\hp2100bat\asm21.bat associate .asm and .hpa with Notepad for editing associate .sim files with C:\hp2100bat\hp2100.exe associate .sim files with Notepad for editing To change associations right click a file with the indicated extension, select Properties, click Change, click Browse, change the location to Local Disk C: and navigate to the C:\hp2100bat folder and select the appropriate batch file. The Notepad associations can be selected from the list after clicking Change, feel free to use any text editor you want (Notepad used in these docs to represent "a text editor"). Adjust accordingly if batch files were edited to be in a different directory. Once installed and associated, double-clicking an .abs file should "run" it, double-clicking a .sim file should load it into Notepad, right-clicking a .sim file and selecting Run With then hp2100abs should "run" it, double-clicking a .asm or .hpa file should load it into Notepad, and right-clicking a .asm or .hpa file and selecting Run With should show options for asmhpasm and/or asm21. You might prefer that double-clicking a .sim file "run" it in the simulator (rather than editing), the default double-click action can be changed by right-clicking a file, properties, change, then select one of the associated programs for the desired action. Sometimes different simulator configurations are needed for some ABS files, in particular things like chess.abs which requires crlf when enter is pressed. To make a version of hp2100abs.bat which does crlf enters... (this is one way) Load hp2100abs.bat into Notepad (right-click, select edit), Save As "hp2100crlf.bat" (the quotes are needed to keep from adding .txt). Exit Notepad. Load hp2100abs.sim into Notepad, Save As "hp2100crlf.sim". Exit Notepad. Load hp2100crlf.sim into Notepad, uncomment the set tty autolf line and Save. Load hp2100crlf.bat into Notepad, change the line that references hp2100abs.sim to hp2100crlf.sim instead (make sure there are no spaces after it) and Save. Associate .abs with C:\hp2100bat\hp2100crlf.bat Right-clicking .abs files and selecting Run With should show an option for hp2100crlf. The hp2100abs.bat and new hp2100crlf.bat can be used to make desktop shortcuts to specific ABS files (like games). Additional copies of the batch and sim script can be used to support other configurations (telnet, different slots, whatever you need to do). When making the shortcut specify the command line C:\hp2100bat\hp2100abs.bat C:\pathto\your.abs (adjust accordingly if using alternate batches and to specify the location and name of the abs file to run). Modifying hp2100abs.bat to support screen codes using telnet... XP does not support screen codes in console applications, I tried every way I could find (including ansicon.exe/dll) but the only thing that worked with hp2100.exe was to enable a telnet client. Usually the hp2100abs.bat file is used mainly for quick checks and the corresponding .sim file does not include options for disk files etc or those files would get created for every ABS file that's run. However it is sometimes handy to be able to properly process binaries that output screen codes, for example to run the hposdemo.abs build. The following batch file can be added to the C:\hp2100bat directory and associated with .abs files to permit running them using a telnet terminal... ------- begin hp2100abs_telnet.bat -------------- :: this is a modification of hp2100abs.bat for :: running an ABS file in a telnet terminal @echo off ::--- edit here to set up ----------------- ::must not be any spaces after next line... set simscr=C:\hp2100bat\hp2100abs.sim set hp2100=C:\hp2100bat\hp2100.exe set tempabs=C:\hp2100bat\abs_temp.abs ::----------------------------------------- if exist %1 goto checksim echo ABS file %1 not found goto end :checksim if exist %simscr% goto chksim2 echo Script %simscr% not found goto end :chksim2 if exist %hp2100% goto doit echo Simulator %hp2100% not found goto end :doit copy %1 %tempabs% > nul copy %simscr% %simscr%.tmp > nul echo set telnet 23 >> %simscr%.tmp echo load %tempabs% >> %simscr%.tmp echo run 2 >> %simscr%.tmp start %hp2100% %simscr%.tmp start telnet localhost :: temp files not deleted :end ------- end hp2100abs_telnet.bat ---------------- The first time it's used you'll probably have to unblock XP's firewall and set up the command line telnet client... press control ] to access the telnet setup prompt and enter display to show parameters... local echo should be off and for most applications line ends should be sent as just CR. To change the settings enter unset crlf and/or enter unset localecho then enter q to save the changes (this closes the window and halts the simulator, exit that too). Upon running an ABS file again it should work with the proper settings. When running a ABS file with telnet, control-E and simulator commands need to be given in the simulator window (not the telnet window). Setting up a fixed simulation using telnet... There are a couple of ways to automatically launch telnet when running a disk/magtape simulation, directly from the .sim script using the ! command, or using a batch file. First set up the simulation and move the disk and/or magtape image files to where they'll be and get it operational. To enable telnet edit the .sim script and add the line: set telnet 23 anywhere before the run or boot line that actually executes the simulation. This has to be done for either method. To directly launch telnet from the sim script, after the telnet line add the line: ! start telnet localhost Alternatively and probably better, write a batch file (in the same directory as the sim script and other sim files) that starts the hp2100 simulator then starts the telnet client. In the case of the boot_7906.sim script and if hp2100.exe is in C:\hp2100bat (if using the other batches) the batch would look like: @echo off start C:\hp2100bat\hp2100.exe boot_7906.sim start telnet localhost Save the batch file as "boot_7906.bat" or another descriptive .bat name, run this batch to launch the telnet-enabled simulation. These examples can be modified to use HyperTerminal instead, first a configuration needs to be set up that connects to telnet localhost... run HyperTerminal from Start, All Programs, Accessories, Communications. In the new connection dialog give it a name, telnet_localhost for example, select TCP/IP then specify localhost. It'll say it can't connect. Save the setup, in another explorer window open the C:\hp2100bat folder (or another convenient place to copy it to), in HyperTerminal File|Open then drag the telnet_localhost.ht file to the C:\hp2100bat folder.. hold control to copy if you want it to remain in the default location too for selecting with File|Open. Modify the start telnet localhost lines in batch files or in the sim script to instead: start hypertrm.exe C:\hp2100bat\telnet_localhost.ht Precede with ! if in the sim script, adjust paths accordingly if you put the .ht file somewhere else.. if put in the same directory as a fixed sim startup batch or script then just hypertrm.exe telnet_localhost.ht will do. When using HyperTerminal for the telnet client it is useful to set line delay to 500ms and character delay to 30ms (or so, File|Properties, Settings then Ascii Setup) to permit pasting code into the terminal slow enough to not cause errors. Setting up HyperTerminal is a bit more involved than a plain console telnet terminal but worth it to be able to paste. Terry Newton