• ]

    From Chris Hoppman@1:129/305 to Jasen Betts on Sunday, December 14, 2003 16:56:00
    For A := 0 to 100 do
    begin
    {Do some stuff here}
    TimeSlice;
    end;
    btw.. TimeSlice; is a call to a procedure that does the timeslices.
    If you would like I can echo back the accual timeslice procedure.
    I was using a shortten version of the code. Just an example that cover
    the point I was asking about.

    first off check the documentation for "timeslice" I don't find it documented as a standard part of TP

    Back in the day no, but for OS/2, DesqView, and Windows you should have
    them. ( It's still isn't a standard call in TP,BP). They are basicly calls
    to registers in asm telling the OS exactly what you just told me. That my program isn't doing anything major and to release a time share to other programs.

    OTOH if you want to delay for a long time there may be some sort of sleep procedure avaialable. (but your code suggests to me that you want to
    "do some stuff" between timeslices so probably you are doing it the best wa

    Sleep(ms); is for delphi.

    Delay(ms); is the part that will pause the program, but I don't want to do that. Plus, it is the part that gives the RTE 200 (Where the program on 233+ system will not run)..

    Anyhow, after thinking about it. Here is another sample is better suitted for what I am asking.

    Program TestTimeSlices;
    Uses CRT, DOS;
    Type
    Tasker : (None,DesqView,Windows,OS2);

    Var
    Ch : Char;

    procedure TimeSlice;
    Begin
    case Tasker of
    None: asm
    int 28h
    end;
    DesqView: asm
    mov ax, 1000h
    int 15h
    end;
    Windows: asm
    mov ax, 1680h
    int 2Fh
    end;
    OS2: asm
    push dx
    xor dx, dx
    mov ax, 0
    sti
    hlt
    db 035h, 0Cah
    pop dx
    end;
    end;
    end;

    Begin
    {I am not going to write out the code to detect the OS. So, I am going}
    {to say it is windows}
    Tasker := Tasker + Windows;
    Repeat
    if keypressed then ch := readkey;
    TimeSlice;
    Until Upcase(Ch) := Q;
    Write('You pressed the key: ',Ch);
    repeat TimeSlice; until keypressed ;

    End.

    --- Renegade v11-26.3 DOS
    * Origin: The Titantic BBS Telnet - ttb.slyip.com (1:129/305)
  • From mark lewis@1:3634/12 to Chris Hoppman on Monday, December 15, 2003 12:18:40
    Delay(ms); is the part that will pause the program,
    but I don't want to do that. Plus, it is the part
    that gives the RTE 200 (Where the program on 233+
    system will not run)..

    only if you use the one in the CRT unit that comes with the borland product... i use my own and have actually recreated the stuff in the CRT unit that i use and i don't use the CRT unit any more... there are several ways of doing a delay that are accurate and actually work properly under a multitasker...

    )\/(ark


    * Origin: (1:3634/12)
  • From mark lewis@1:3634/12 to Chris Hoppman on Monday, December 15, 2003 12:28:24
    OS2: asm
    push dx
    xor dx, dx
    mov ax, 0
    sti
    hlt
    db 035h, 0Cah
    pop dx

    the stuff i've used for years doesn't push or pop the dx register and it does not have the sti call in it... the only difference between what i use for Warp3
    and Warp4 is "mov ax, 2" for Warp3...

    oh yes... and the db line should read "db 035h,0cah,90h" without the quotes...

    my actual killtime procedure is

    Procedure KillTime; assembler;
    asm
    PUSHF
    CALL DWord Ptr [os_slice_vec]
    end;

    so that may cover why i don't worry about the DX register... i dunno... i used to have iret at the end of the os/2 slice calls but had problems and have it commented out, currently...

    again, just to clarify, my slice routines are stuck into an interrupt vector so
    i just call killtime whenever and it pokes the already installed slice routine...

    why did i do it this way? why should we figure out what os we're running each and every time we go to slice? figure out the os during program startup and go from there... in your above, you have to decide which slice to use on every invocation of the slice routine... i see that as inefficient... thus i came up with the decision stuff during program start and just install the desired slice
    then...

    )\/(ark


    * Origin: (1:3634/12)
  • From Chris Hoppman@1:129/305 to Mark Lewis on Monday, December 15, 2003 20:49:57
    why did i do it this way? why should we figure out what os we're running ea and every time we go to slice? figure out the os during program startup and from there... in your above, you have to decide which slice to use on every invocation of the slice routine... i see that as inefficient... thus i came with the decision stuff during program start and just install the desired slice then...

    Good point. It would make for better programming. Once someone installs the software are they going to change the OS it runs on? I don't really think they will.

    chris

    --- Renegade v12-15.3 - Alpha
    * Origin: The Titantic BBS Telnet - ttb.slyip.com (1:129/305)
  • From mark lewis@1:3634/12 to Chris Hoppman on Monday, December 15, 2003 23:34:36
    why did i do it this way? why should we figure out what os we're running ML>> ea
    and every time we go to slice? figure out the os during program startup ML>> and
    from there... in your above, you have to decide which slice to use on
    every
    invocation of the slice routine... i see that as inefficient... thus i ML>> came
    with the decision stuff during program start and just install the desired ML>> slice then...

    ugh, nasty quotes... i'm not going to straighten them out any more ;-(

    Good point. It would make for better programming. Once
    someone installs the software are they going to change
    the OS it runs on? I don't really think they will.

    it doesn't matter as the application will install the interrupt vector each time it loads and uninstall it each time it unloads... i run the same application across a network under several different OS' with no problems... it
    detects the OS and does its thing as needed...

    )\/(ark


    * Origin: (1:3634/12)
  • From Scott Adams@1:112/91 to mark lewis on Tuesday, December 16, 2003 23:47:44
    Quoting mark lewis to Chris Hoppman <=-

    Delay(ms); is the part that will pause the program,
    but I don't want to do that. Plus, it is the part
    that gives the RTE 200 (Where the program on 233+
    system will not run)..

    only if you use the one in the CRT unit that comes with the borland product... i use my own and have actually recreated the stuff in the
    CRT unit that i use and i don't use the CRT unit any more... there are several ways of doing a delay that are accurate and actually work
    properly under a multitasker...

    Yep. Course you gotta watch out for Thrashing. But then
    that's why they invented profilers. Ok...so who uses
    profilers? :)...no one ...


    ... I do not understand, he is Warrior caste. - Delenn
    --- Fringe BBS
    * Origin: EWOG II - The Fringe - 904-733-1721 (1:112/91)
  • From Chris Hoppman@1:129/305 to Mark Lewis on Tuesday, December 16, 2003 10:24:05
    it doesn't matter as the application will install the interrupt vector each time it loads and uninstall it each time it unloads... i run the same application across a network under several different OS' with no problems.. it detects the OS and does its thing as needed...

    Okay I orginally read what you wrote wrong. I thought you just detectted it
    on the first run of your program and stored it in a ini file and use that one for each run after that.

    I understand now that you detect each time you start your program, but not each time the slice is called, because it was already detected upon startting of your program.

    chris

    --- Renegade v12-15.3 - Alpha
    * Origin: The Titantic BBS Telnet - ttb.slyip.com (1:129/305)
  • From Jasen Betts@3:640/1042 to mark lewis on Wednesday, December 17, 2003 06:09:23
    Hi mark.

    15-Dec-03 12:28:24, mark lewis wrote to Chris Hoppman


    OS2: asm
    push dx
    xor dx, dx
    mov ax, 0
    sti
    hlt
    db 035h, 0Cah
    pop dx

    the stuff i've used for years doesn't push or pop the dx register and
    it does not have the sti call in it... the only difference between
    what i use for Warp3 and Warp4 is "mov ax, 2" for Warp3..

    oh yes... and the db line should read "db 035h,0cah,90h" without the quotes...

    that means XOR AX,$90CA what does that do?

    Bye <=-

    ---
    * Origin: Bushido does not mean what it sounds like. (3:640/1042)
  • From Jasen Betts@3:640/1042 to Chris Hoppman on Wednesday, December 17, 2003 06:19:36
    Hi Chris.

    15-Dec-03 20:49:57, Chris Hoppman wrote to Mark Lewis

    Good point. It would make for better programming. Once someone
    installs the software are they going to change the OS it runs on?
    I don't really think they will.

    I think Mark means to detect the OS at the start of execution (in the ititialisation part of the unit or when timeslice is first run, that way
    there no need to mess with data files to store it etc), you can be certain
    that noone will change the OS while the program is running :)

    Bye <=-

    ---
    * Origin: Money is the root of all wealth. (3:640/1042)
  • From mark lewis@1:3634/12 to Chris Hoppman on Thursday, December 18, 2003 01:11:40
    it doesn't matter as the application will install
    the interrupt vector each time it loads and uninstall
    it each time it unloads... i run the same application
    across a network under several different OS' with no
    problems.. it detects the OS and does its thing as
    needed...

    Okay I orginally read what you wrote wrong. I thought
    you just detectted it on the first run of your program
    and stored it in a ini file and use that one for each
    run after that.

    no... many of my programs don't use any external configuration files... none of
    my programs use an INI file by that extension or format, though i do have code to read and write them...

    I understand now that you detect each time you start
    your program, but not each time the slice is called,
    because it was already detected upon startting of your
    program.

    that is correct...

    )\/(ark


    * Origin: (1:3634/12)
  • From mark lewis@1:3634/12 to Jasen Betts on Thursday, December 18, 2003 01:16:36
    hlt
    db 035h, 0Cah
    pop dx

    the stuff i've used for years doesn't push or pop the dx register and
    it does not have the sti call in it... the only difference between
    what i use for Warp3 and Warp4 is "mov ax, 2" for Warp3..

    oh yes... and the db line should read "db 035h,0cah,90h" without the
    quotes...

    that means XOR AX,$90CA what does that do?

    its a signature that the hlt is really a slice call... or so the comments state
    that the code came from... too late to hunt for it at the moment...

    )\/(ark


    * Origin: (1:3634/12)