flat assembler
Message board for the users of flat assembler.

Index > DOS > need little help with resident (TSR)

Author
Thread Post new topic Reply to topic
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 03 Feb 2007, 16:48
hi community, i need little help, can someone add resident functionality to my little screen-saver program? i'm newbie in dos programming, thanks

ps. the resident must react to key-press and having timer for running screen-saver again

very appreciated for you help


Description: screen-saver source
Download
Filename: main.asm
Filesize: 1.8 KB
Downloaded: 751 Time(s)


_________________
[not enough memory]
Post 03 Feb 2007, 16:48
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 03 Feb 2007, 20:30
hi, it is long time ago, but:
1. hook keyboard and timer interrupt
2. place all code that needs to remain resident into beginning of app
3. call DOS interrupt "terminate and stay resident"
Post 03 Feb 2007, 20:30
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 09 Feb 2007, 10:09
can someone post simple resident program written in flat assembler?
Post 09 Feb 2007, 10:09
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 09 Feb 2007, 10:45
uff. i think no one writes these anymore, as DOS is dead. You can find many in MASM and figure out how to rewrite them to FASM, it's easy.
Post 09 Feb 2007, 10:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 10 Feb 2007, 02:24
Quote:
as DOS is dead


NO. Shocked

Quote:
You can find many in MASM and figure out how to rewrite them to FASM, it's easy.


Right.

Check CTMOUSE or other FreeDOS utils. Or SNARF. But most of it will be
MA$M, or NASM at best, no FASM Sad

http://www.unet.univie.ac.at/~a0503736/php/drdoswiki/index.php?n=Main.Gallery?action=downloadman&upname=SNARF.zip

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 10 Feb 2007, 02:24
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 10 Feb 2007, 04:35
Er, maybe you'll prefer to get SNARF 1.3 (MASM?) from its homepage (no offense, NTOSKRNL_VXE).

Also, see CTMOUSE.
Post 10 Feb 2007, 04:35
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 10 Feb 2007, 06:04
http://maven.smith.edu/~thiebaut/ArtOfAssembly/CH18/CH18-1.html

About MA$M, I prefer to disassemble the binary (if exists, using NDISASM),
and fix up this (looking into the source for label names and comments),
rather than fixing the MA$M source code. The MA$M syntax is
horrible, with all the messing-linking-up of the "sections" and
"segments", and all the useless directives "assume", "tiny", "addr", "offset", ... Sad

Tomasz wrote ( http://board.flatassembler.net/topic.php?t=3197 ) :
Quote:
My assembler, generating the code in flat addressing space, was always outputting the code exactly in the same order, as it was defined in source.


Incredible how long it took before someone "invented" such an obvious design Shocked Shocked

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 10 Feb 2007, 06:04
View user's profile Send private message Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth 10 Feb 2007, 13:43
>> My assembler, generating the code in flat addressing space, was always
>> outputting the code exactly in the same order, as it was defined in source.

> Incredible how long it took before someone "invented" such an obvious design

IMO this is one of FASM's biggest flaws.

> and all the useless directives "assume", "tiny", "addr", "offset", ...

none of these directives is "useless", as you would soon have to realize if you wrote something like FD Emm386 or a similiar project with modules written in different languages and using a segmented memory model.
Post 10 Feb 2007, 13:43
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 11 Feb 2007, 01:20
Anyways, Vasilev, look at Simtel.net (under Home › Utilities/Drivers/System Files › Terminate and stay resident utilities) or Garbo's FTP for some utils.
Post 11 Feb 2007, 01:20
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 11 Feb 2007, 01:57
Quote:
IMO this is one of FASM's biggest flaws


You can do better with MASM, I with FASM Wink

Quote:
directives is "useless", as you would soon have to realize if you wrote something like FD Emm386 or a similiar project with modules written in different languages and using a segmented memory model.


Well, if I had to fix up JEMM386, CWSDPMI or HDPMI32 or a similar project,
I would completely disassemble it with NDISASM and port to FASM -
no "C" at all Shocked

Tomasz wrote (FASM source):

Code:
        mov     word [edx+3Ch],ax
        mov     word [edx+18h],40h
        lea     edi,[edx+40h]
        mov     esi,default_stub
        mov     ecx,default_stub_end-default_stub
        rep     movs byte [edi],[esi]
        pop     esi
        jmp     stub_ok
      default_stub:
        use16
        push    cs
        pop     ds
        mov     dx,stub_message-default_stub
        mov     ah,9
        int     21h
        mov     ax,4C01h
        int     21h
      stub_message db 'This program cannot be run in DOS mode.',0Dh,0Ah,24h
        rq      1
      default_stub_end:
        use32
      stub_from_file:
        push    esi
        mov     esi,edx
        call    open_binary_file
    


Shocked

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 11 Feb 2007, 01:57
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 11 Feb 2007, 02:15
Privalov wrote:

stub_message db 'This program cannot be run in DOS mode.',0Dh,0Ah,24h


Perhaps he should say instead, "Use the DOS version or run this under HXRT w/ MSVCRT.DLL." Smile
Post 11 Feb 2007, 02:15
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 11 Feb 2007, 03:17
Quote:
run this under HXRT


WOW !!! Exactly that's what I'll write into my PE stubs Shocked

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 11 Feb 2007, 03:17
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 11 Feb 2007, 19:53
Make sure you actually try it first (running FASM/Win32 console under HXRT: I still haven't, sorry, didn't mean to be misleading ... I was too stubborn/lazy to try digging up MSVCRT.DLL from my old Win95 install disks, but I'm fairly certain that it should work).

EDIT:
Hey, Vasilev, also check out Toddy (free DOS cmdline editor TSR, like DOSKEY, w/ Wolfware ASM src).
Post 11 Feb 2007, 19:53
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 05 Mar 2007, 22:18
Also check out the FreeDOS resident calculator.

EDIT: Screen saver for DOS? See MYSTIC.ZIP and Sleeper from WASM223.ZIP.
Post 05 Mar 2007, 22:18
View user's profile Send private message Visit poster's website Reply with quote
ATV



Joined: 31 Aug 2004
Posts: 109
Location: Finland
ATV 06 Mar 2007, 14:06
There seems to be little interest to write tsr programs.
I was looking some of my own (and very old) tools.
They are written for ArrowsoftAsm/TASM syntax, They have been used under 486 with dos v6.22
Probably WinXP don't like some of my tricks.
You are free to copy paste if you find something useful.
Code:
Program list of tsr_pak.zip

clock    - tiny tsr clock
filelog  - log dos file calls
grabvesa - save capture to pcx with vga,vesa v1.2 (HotKey: <Right Shift> double click)
hexview  - memory hexdump utility (HotKey: Alt-F12)
tsr_tet  - tiny tsr tetris (HotKey: Ctrl+T)
tsrdebug - tsr version of tiny debug (HotKey: Alt+F9)
zoomvesa - zoom vesa v1.2 screen (HotKey: Ctrl+F11 and Ctrl+F12)    


Description: TSR examples
Download
Filename: tsr_pak.zip
Filesize: 78.49 KB
Downloaded: 755 Time(s)

Post 06 Mar 2007, 14:06
View user's profile Send private message Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 06 Mar 2007, 14:44
ok, here is my tsr screen-saver with password feature


Description:
Download
Filename: main.asm
Filesize: 5.13 KB
Downloaded: 766 Time(s)


_________________
[not enough memory]
Post 06 Mar 2007, 14:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.