flat assembler
Message board for the users of flat assembler.

Index > DOS > Quasi-multitasking in DOS

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
cpcdos



Joined: 12 Aug 2013
Posts: 8
cpcdos
Hi !

I have a question
I would like to couple this code (for execute a external program)

Code:
        org     100h

        mov     ah,4Ah                  ; resize memory block
        mov     bx,19000h shr 4         ; only memory needed for .com
        int     21h

; now set up the pointer to command line in the parameters block

        mov     word [cmdline],_command
        mov     word [cmdline+2],ds

; we are ready to execute the program now

        mov     ax,4B00h                ; load and execute program
        mov     dx,_program             ; ASCIIZ path of program
        mov     bx,params               ; parameter block
        int     21h

        int     20h                     ; exit program


_program db 'c:\dos\ctmouse.exe',0
_command db 0                           ; length of command line
         db 13                          ; must end with CR character

params:
 environment dw 0       ; segment of environment, 0 means to use parent's one
 cmdline dd ?           ; pointer to command line
 default_fcb1 dd 0      ; pointers to file control blocks
 default_fcb2 dd 0       
    


in a task in your code (me239)

I can not do Crying or Very sad

Can i help me ?
Thank.
Post 15 Aug 2013, 11:34
View user's profile Send private message Send e-mail Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
cpcdos wrote:
Can i help me ?
How we are supposed to know, can you help yourself or not? Wink

Your code, with slight modification, works fine for me (in NTVDM). I've modified spawned program file name to "hello.com" (which simply says hello), that's all.
Post 15 Aug 2013, 12:27
View user's profile Send private message Reply with quote
cpcdos



Joined: 12 Aug 2013
Posts: 8
cpcdos
Yes, it's works !
But, il would like integrate my code in a task of her program
Code:
org 100h
start:
        push    0
        pop     ds
        mov     ax, word[ds:0008h*4]
        mov     bx, word[ds:0008h*4+2]
        mov     word[cs:int08], ax
        mov     word[cs:int08+2], bx
        push    cs cs
        pop     ds es
        push    ds
        mov     bx, ds
        dec     bx
        mov     ds, bx
        mov     bx, [ds:03]
        sub     bx, (vend-task+15)/16+1
        pop     ds
        mov     ah, 4ah
        int     21h
        mov     ah, 48h
        mov     bx, (vend-task+15)/16
        int     21h
        mov     es, ax
        push    cs
        pop     ds
        xor     di, di
        mov     si, task
        mov     cx, vend-task
        rep     movsb
        mov     ax, es
        dec     ax
        mov     es, ax
        mov     word[es:01], 8
        push    0
        pop     ds
        cli
        inc     ax
        mov     word[ds:0008h*4], 0
        mov     word[ds:0008h*4+2], ax
        sti
        ret
task:
        pushf
        push    ax bx cx dx ds es di si
        push    0b800h
        pop     es
        mov     di, 60*2
        mov     ah, 4fh
        mov     al, 0c9h
        stosw
        mov     al, 0cdh
        mov     cx, 16
        rep     stosw
        mov     al, '[';0bbh
        stosw
        mov     al, 'X'
        stosw
        mov     al, ']'
        stosw
        mov     di, ((80*1)*2)+(60*2)
        mov     al, 0bah
        stosw  
        mov     al, 20h
        mov     cx, 7
        rep     stosw
        mov     ah, 4fh
        mov     al, 'T'
        stosw
        mov     al, 'A'
        stosw
        mov     al, 'S'
        stosw
        mov     al, 'K'
        stosw
        mov     al, ' '
        stosw
        mov     al, '1'
        stosw
        mov     cx, 5
        mov     al, 20h
        rep     stosw
        mov     al, 0bah
        stosw
        mov     di, ((80*2)*2)+(60*2);(80*3)+(60*3)+20
        mov     al, 0bah
        stosw
        mov     al, 20h
        mov     cx, 6
        rep     stosw
        mov     ah, 4fh
        mov     al, 'W'
        stosw
        mov     al, 'I'
        stosw
        mov     al, 'N'
        stosw
        mov     al, 'D'
        stosw
        mov     al, 'O'
        stosw
        mov     al, 'W'
        stosw
        mov     al, ' '
        stosw
        mov     al, '1'
        stosw
        mov     al, '!'
        stosw
        mov     cx, 3
        mov     al, 20h
        rep     stosw
        mov     al, 0bah
        stosw
        mov     di, ((80*3)*2)+(60*2)
        mov     al, 0c8h
        stosw
        mov     cx, 18
        mov     al, 0cdh
        rep     stosw
        mov     al, 0bch
        stosw 
        mov     ax, 0001h
        int     33h
        mov     ax, 0003h
        int     33h
        cmp     cx, 616
        jb      nomouse
        cmp     cx, 640
        ja      nomouse
        cmp     dx, 8
        ja      nomouse
        cmp     bx, 1
        jnz     nomouse
        jmp     killint
nomouse:
        pop     si di es ds dx cx bx ax
        popf
int08old:
db      0eah
int08   dw      0, 0
killint:
        mov     ax, 0002h
        int     33h
        pop     si di es ds dx cx bx ax
        push    ax bx ds
        call    cls
        mov     ax, word[cs:int08-task]
        mov     bx, word[cs: (int08-task)+2]
        cli
        push    0
        pop     ds
        mov     word[ds:0008h*4], ax
        mov     word[ds:0008h*4+2], bx
        sti
        pop     ds bx ax
        popf
        jmp     int08old
cls:
        mov     di, (80*5)+(60*3)+20
        call    drawline
        mov     di, (80*3)+(60*3)+20
        call    drawline
        mov     di, (60*2)+(80*2)
        call    drawline
        mov     di, (60*2)
        call    drawline
        ret
drawline:
        push    es
        push    0b800h
        pop     es
        mov     cx, 20
        mov     ax, 0700h
        rep     stosw
        pop     es
        ret
vend:     

for execute multiple exécutables if it's possible
Post 15 Aug 2013, 12:33
View user's profile Send private message Send e-mail Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386
> for execute multiple exécutables if it's possible

DOS can't run multiple exécutables at same time. You can have multiple exécutables in memory at same time, but only one of them will run. INT $21 / AH=$4B will not return before the child process exited. When doing some interrupt multi-taxing hacks, you have to care about multiple issues, one of them is, that DOS is NOT reentry-safe.

http://board.flatassembler.net/topic.php?t=9256 "7-ZIP encryption | password in commandline | ISR & TSR !"

http://board.flatassembler.net/topic.php?t=7105 "simple multitasking in DOS via MT.COM"
Post 19 Aug 2013, 11:28
View user's profile Send private message Reply with quote
cpcdos



Joined: 12 Aug 2013
Posts: 8
cpcdos
okay Smile
but, how to work deskqview ?
It's a Dos program !? yes ?
Post 19 Aug 2013, 11:52
View user's profile Send private message Send e-mail Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386
> but, how to work deskqview ?

I never tested it ... it uses V86 (??) and does some hacks about the file I/O (??) ...
Post 19 Aug 2013, 12:04
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.