=================== ASM and VAL Example =================== -IAN! idallen@ncf.ca Here's an example of assembling some files downloaded to my C:\ directory. I start up a DOS window in that directory, and type this to assemble and link the file "noecho.asm" in the current directory: C:\>asm Arrowsoft Assembler Public Domain v2.00c (64K Model) Copyright (c) 1986, 1987 Arrowsoft Systems, Inc. Input filename (.asm): noecho Object filename (noecho.obj): Listing filename(nul.lst): Cross-reference (nul.crf): Free memory=50996, Warnings=0, Errors=0 Assembly Ended. C:\>val /com VAL 8086 linker - Mar 27 1995 OBJ file(s): noecho COM file[C:\noecho.com]: LST file: LIB file(s): C:\>noecho Bark! Bark! Bark! Ended on: d C:\> I recommend using the command lines given at the start of ONEPAGE.ASM, since that cuts down on the unnecessary verbosity. Here is the same assembly and link, using command line options and file names to remove all the unnecessary verbosity: C:\>asm /s noecho ; C:\>val /com noecho ; C:\>noecho Bark! Bark! Bark! Ended on: d C:\> Here are all the files: C:\>dir noecho.* Directory of C:\ NOECHO OBJ 146 07/07/00 12:28 NOECHO.OBJ NOECHO ASM 2,396 07/07/00 12:21 noecho.asm NOECHO COM 69 07/07/00 12:28 NOECHO.COM 3 file(s) 2,611 bytes C:\> And, for your education and amusement, here's a DEBUG dump of the assembled NOECHO.COM program memory, using DEBUG's "U" (UnAssemble) command to turn the machine code in the *.COM file back into assembler mnemonics (you can try doing this yourself): C:\>debug noecho.com -u 1353:0100 C606410178 MOV BYTE PTR [0141],78 1353:0105 90 NOP 1353:0106 803E410164 CMP BYTE PTR [0141],64 1353:010B 7409 JZ 0116 1353:010D B407 MOV AH,07 1353:010F CD21 INT 21 1353:0111 A24101 MOV [0141],AL 1353:0114 EBF0 JMP 0106 1353:0116 BA2301 MOV DX,0123 1353:0119 B409 MOV AH,09 1353:011B CD21 INT 21 1353:011D B000 MOV AL,00 1353:011F B44C MOV AH,4C -u 1353:0121 CD21 INT 21 1353:0123 0D0A42 OR AX,420A 1353:0126 61 DB 61 1353:0127 726B JB 0194 1353:0129 2120 AND [BX+SI],SP 1353:012B 42 INC DX 1353:012C 61 DB 61 1353:012D 726B JB 019A 1353:012F 2120 AND [BX+SI],SP 1353:0131 42 INC DX 1353:0132 61 DB 61 1353:0133 726B JB 01A0 1353:0135 2120 AND [BX+SI],SP 1353:0137 45 INC BP 1353:0138 6E DB 6E 1353:0139 64 DB 64 1353:013A 65 DB 65 1353:013B 64 DB 64 1353:013C 206F6E AND [BX+6E],CH 1353:013F 3A20 CMP AH,[BX+SI] -u [...etc...] -q C:\> You will note that, as I've been saying, all the labels are missing from the *.COM file - all we have are the machine instructions. Also, DEBUG doesn't know which bytes are instructions and which are data, so it tries to turn everything into instruction mnemonics, even the data. As you see from our instruction "MOV DX,0123", our BARKMSG string starts at offset 0123h, so everything from memory offset 0123 onward is actually data, not instructions. Some of that data just happens to have the same bit patterns as instructions, and DEBUG tries to display it as such.