473,231 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

LOAD AND EXECUTE using D.O.S. interrups

I have been trying to load and execute a .COM file using int 21h DOS interrups (EXEC), but it seems there is a problem with the Parameter Block passed to BX, because executes .COM file but no sends parameters:
Expand|Select|Wrap|Line Numbers
  1.    int len, i, j, retorna;
  2.    union REGS registros;
  3.    struct  parametros {
  4.       int segmento;
  5.       int cmd_ptr_offset;
  6.       int cmd_ptr_segment;
  7.       int fcb1_ptr_offset;
  8.       int fcb1_ptr_segment;
  9.       int fcb2_ptr_offset;
  10.       int fcb2_ptr_segment;
  11.  } par;
  12.  
  13.  
  14.    char* cmd;
  15.    struct SREGS sregs;
  16.  
  17.  
  18.    cmd[0] = (char)  strlen(argv[3]);
  19.    strcpy(&cmd[1],argv[3]);
  20.    strcat(&cmd[1],"\r");
  21.  
  22.    segread(&sregs);
  23.  
  24.    memset(par, 0, sizeof(par));
  25.  
  26.    par.cmd_ptr_offset = (int) cmd;
  27.    par.cmd_ptr_segment = sregs.ds;
  28.    par.fcb1_ptr_offset = 0x5c;
  29.    par.fcb1_ptr_segment = _psp;
  30.    par.fcb2_ptr_offset = 0x6c;
  31.    par.fcb2_ptr_segment = _psp;
  32.    par.segmento = *((int far *)(((long)_psp<<16) | 0x2c));
  33.  
  34.  
  35.      printf("cmd:%s\n",cmd);
  36.  
  37.    registros.h.ah = 0x4b;
  38.    registros.h.al = 0x00;
  39.    registros.x.dx = (int) argv[2];
  40.    registros.x.bx =(int)  &par;
  41.    sregs.es = sregs.ds;
  42.  
  43.    retorna = intdos(&registros,&registros);
  44.  
Mar 21 '08 #1
0 888

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ryan | last post by:
Hello, I was trying to user the code below to run a DTS job. The job fails when I get to the piece of code that begins: EXEC @rc = sp_OAMethod @PackageToken, 'LoadFromSQLServer', ... It...
3
by: Arti Potnis | last post by:
Hi, I am trying to execute the DB2 load utility from a C program. lPid = fork(); execl(csExePath, csExeName,csCmd, NULL); the contents of the parameter variables are as follows:-
3
by: grigno | last post by:
Hi, I'm tring to execute LOAD command with VB6. ...connection... strSQL = "load from c:\temp\pippo.dat of del modified by coldel'|' insert into MYTAB" cnnMain.Execute (strSQL)
5
by: hikums | last post by:
Begin Atomic Declare a integer; Set a=(select count(1) from claims.table1); if a<>0 then import into c:\tmptyfile.txt of del replace into claims.table1; end if; End!
3
by: claus.hirth | last post by:
When I execute the following statment using the Command Center it works: LOAD CLIENT FROM 'Y:\\TheFixedWidthData.txt' OF ASC METHOD L ( 1 1,2 11,12 17) REPLACE INTO S00.TheTargetTable...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
10
by: technocrat | last post by:
Hi, I am trying to declare and cursor and thn load from that cursor into another table. Since I have almost 4 million records, I cant do it without the cursor which reduces the time by almost...
2
by: chandu | last post by:
Hello, I developed one windows appliction . and i want to load that application dinamiclly in a Parent MDI as child appliction when click on a button in parent form.. Just i tried to load the...
3
by: =?Utf-8?B?TGV3aXMgTW90ZW4=?= | last post by:
Hello. We are having a problem here trying to compile C# applications. Only one developer has a problem where they attempt to compile the application and the compiler complains about being out of...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.