BBS: Inland Empire Archive Date: 12-08-92 (13:13) Number: 350 From: ROB MCKEE Refer#: NONE To: ALL Recvd: NO Subj: Errorlevel Conf: (2) Quik_Bas
Hi All,
I found out where MS-Dos V.5 Command.com keeps the
ErrorLevel Info (plus &h2b3 from the beginning of
Command.com as Listed by Mem /d) Does anyone know
C:\>MEM/D
Address Name Size Type
------- -------- ------ ------
000000 000400 Interrupt Vector
000400 000100 ROM Communication Area
000500 000200 DOS Communication Area
000700 IO 000A60 System Data
CON System Device Driver
_____________________/\ ____________________________
\/
COM4 System Device Driver
001160 MSDOS 0013D0 System Data
002530 IO 002C70 System Data
_____________________/\ ____________________________
\/
0051B0 MSDOS 000040 System Program
005200 COMMAND 000940 Program
005B50 EZPOINT 000040 Data
005BA0 COMMAND 000400 Environment
The byte on my computer as configured is 0054B3. But what
I want to know how to do is access the List of List from
within QBas. I wrote an ASM program thats hardcoded to
read the Byte at &h54b3. I would like to be able to find
where COMMAND.COM start's in any computer and then read the
ERRORLEVEL.
n ErrLvl.com
RCX
4b
a
MOV AX,054B ; Point to Segment
PUSH DS ; Save Data Seg
MOV DS,AX ; Load new Data Segment
MOV AL,[0003] ; Get Errorlevel
POP DS ; Restore Data Segment
JMP 0113 ; Jmp around Data
DB 00 00 00 0D 0A 24 00 ; Working Data
MOV [0112],AL ; Save Errorlevel
CMP AL,00 ; Is it 0 don't need to Divide then
JZ 012F ; If 0 skip Divide
XOR AH,AH ; 0 out Remainder
MOV BL,0A ; Set Divisor
DIV BL ; Divide
MOV [010E],AH ; Save the 1's digit
XOR AH,AH ; 0 out Remainder
DIV BL ; Divide
MOV [010D],AH ; Save the 10's digit
MOV [010C],AL ; Save the 100's digit
MOV DX,010C ; Set start of string
MOV AH,09 ; Load for Output String Func
ADD BYTE PTR [010C],30 ; Add 30h to make it Ascii #
ADD BYTE PTR [010D],30 ; Add 30h to make it Ascii #
ADD BYTE PTR [010E],30 ; Add 30h to make it Ascii #
INT 21 ; Output the String
MOV AL,[0112] ; Get the ERRORLEVEL again
MOV AH,4C ; Setup for Exit with ERRORLEVEL
INT 21 ; ByeBye...
w
q
------------------------------ 8< ---------------------------
AS you can see, it Exit's with the same Errorlevel that it
had coming into it. I have a listing of the Dos 3.x Master
List but I don't know if it's the same as Dos 5. If I can
intercept the ErrorLevel inside Qbas then I can replace
alot of 'IF ERRORLEVEL statements in my Bat Files and do
more things in my Bat files.
TTYL -Rob
--- EZPoint V2.1
* Origin: Flyer Proof Computer Services V# 510-237-8091 (1:125/1212.13)
TTYL -Rob

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET