View unanswered posts | View active topics It is currently 17 Apr 2014 06:29



Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
DOS and VBScript - A Better Interaction? 
Author Message
Expert

Joined: 06 Dec 2011 22:15
Posts: 619
Location: México City, México
Post Re: DOS and VBScript - A Better Interaction?
foxidrive wrote:
Do you mean Win64 bit compatible? 32 bit Windows can run .com files.

I meant Win32 API function calls compatible. Old programs use DOS API function calls, that currently not run in Windows 64-bits versions (even if they are .EXE file format).

The current standard is Win32 API functions, that run in any Windows version.

Antonio


07 Jun 2012 08:06
Profile

Joined: 08 Apr 2012 17:11
Posts: 187
Post Re: DOS and VBScript - A Better Interaction?
Aacini wrote:
I only use the best: assembly language!

More than 25 years ago I wrote several small programs as auxiliary commands for Batch files. They were really small files, less than 400 bytes the majority. For example, below is my GetKey program that read a key from keyboard and return its Ascii code via ERRORLEVEL. This is the MS-DOS 16-bits version:
Code:
mov   ah,8         ;DOS function: Keyboard input without echo
int   21H         ;AL = Ascii code of key pressed
mov   ah,4CH      ;DOS function: Terminate program
int   21H         ;Return Ascii code via ERRORLEVEL

This program generate a .COM file 8 (eight) bytes long! This program requires several modifications to make it Windows 32-bits compatible, so the resulting .EXE file is 1,536 bytes long! (although many of these are zero-filled bytes required in .EXE file format).

Antonio

I find Assembly very interesting, yet hard to learn; I just can't understand what all those MOVs and INTs stand for. :lol:


21 Jun 2012 16:20
Profile WWW

Joined: 15 Jun 2012 13:16
Posts: 263
Location: Italy
Post Re: DOS and VBScript - A Better Interaction?
Fawers wrote:
Aacini wrote:
I only use the best: assembly language!

More than 25 years ago I wrote several small programs as auxiliary commands for Batch files. They were really small files, less than 400 bytes the majority. For example, below is my GetKey program that read a key from keyboard and return its Ascii code via ERRORLEVEL. This is the MS-DOS 16-bits version:
Code:
mov   ah,8         ;DOS function: Keyboard input without echo
int   21H         ;AL = Ascii code of key pressed
mov   ah,4CH      ;DOS function: Terminate program
int   21H         ;Return Ascii code via ERRORLEVEL

This program generate a .COM file 8 (eight) bytes long! This program requires several modifications to make it Windows 32-bits compatible, so the resulting .EXE file is 1,536 bytes long! (although many of these are zero-filled bytes required in .EXE file format).

Antonio

I find Assembly very interesting, yet hard to learn; I just can't understand what all those MOVs and INTs stand for. :lol:


Code:
Mov ah,8       Move in the register AH (like a variable) the value 8
int 21H          Call the interrupt number 21Hex (like a subroutine in the bios or emulated)
                   ah=8 is like a parameter/index for the function/subroutine in the bios code


21 Jun 2012 17:16
Profile
Expert

Joined: 13 Jan 2012 21:24
Posts: 394
Post Re: DOS and VBScript - A Better Interaction?
Aacini wrote:
I only use the best: assembly language!

More than 25 years ago I wrote several small programs as auxiliary commands for Batch files. They were really small files, less than 400 bytes the majority. For example, below is my GetKey program that read a key from keyboard and return its Ascii code via ERRORLEVEL. This is the MS-DOS 16-bits version:
Code:
mov   ah,8         ;DOS function: Keyboard input without echo
int   21H         ;AL = Ascii code of key pressed
mov   ah,4CH      ;DOS function: Terminate program
int   21H         ;Return Ascii code via ERRORLEVEL

This program generate a .COM file 8 (eight) bytes long! This program requires several modifications to make it Windows 32-bits compatible, so the resulting .EXE file is 1,536 bytes long! (although many of these are zero-filled bytes required in .EXE file format).

In fairness, 16-bit DOS had no notion of character codes wider than 8-bit, no ANSI vs. OEM codepage concerns, no ALT+[0]### keyboard input etc.

As for assembly, it is indeed what every other language translates down to, eventually. But as they say, one can write bad (or good) code in any language. I still have a skeleton C console-mode program somewhere, in perfectly valid 32b PE format, which parses and echoes back its arguments, compiled to an .exe of just 1,024 bytes. Only "hackish" part of it was to trim down the 16b stub - the one which prints "This program cannot be run in DOS mode" if you really tried to run it under 16b DOS - mine simply beeps, instead ;-) The rest was a combination of "libctiny" and frugal compiler/linker switches.

Liviu


21 Jun 2012 20:17
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2


Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Forum style by Vjacheslav Trushkin for Free Forums/DivisionCore.