🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.acorn.tech
Article #102

converting commandline programs: a crazy idea

#102
From: MUFTI
Date: Mon, 03 Aug 1992 09:37
51 lines
2580 bytes
Hi

Here is a (maybe crazy) idea to convert commandline-programs to desktop-
programs:

1. Take the ready absolute file.

2. Open a desktop-window before the first command of the commandline-program
   and close it after the last command of the commandline-programm.

3. Search for SWI-commands with
      OS_WriteS, OS_Write0, OS_ReadLine, ETC and 
   replace them with new SWI's (from a module) named 
      WIMP_WriteS, WIMP_Write0, WIMP_ReadLine, ETC
   with exact the same parameters, to write/read characters to/from a
   desktopwindow.

4. Search for Jump-commands and redirect them to a routine (which saves
   registers) which counts down (to avoid too much wimppolling) and then calls
   a wimppoll and then jumps to the orginal adress.   

   example: 
   (before)                         (after)
   B label                          B after_end_of_orginal_file
                                    ....
                                    after_end_of_orginal_file:
                                    ; save R14
                                    BL wimppollroutine
                                    ; restore R14
                                    B label
                                    ....
                                    wimppollroutine:
                                    ;save registers
                                    ;decrement counter
                                    ;if counter==0 
                                       ;wimppoll
                                       ;initialise counter 
                                    ;endif
                                    ;restore registers  
                                    MOV R15,R14

With this method, you would have to pray, that all occurenticies of this tokens 
with SWI- and B- commands are used as Assembercommands and not as data ....
(especially in programs with floatingpoint arithmetics ?)

Some comments (or ideas how to find out, if something is data or program code )
about this idea ?

thanks 
so long
MUFTI
Technical Details
Message-ID: <1992Aug3.093740.7715@news.uni-stuttgart.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!news.belwue.de!news.uni-stuttgart.de!helpdesk.rus.uni-stuttgart.de!zrzm0111

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.acorn.tech
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!news.belwue.de!news.uni-stuttgart.de!helpdesk.rus.uni-stuttgart.de!zrzm0111
From: zrzm0111@helpdesk.rus.uni-stuttgart.de (MUFTI)
Subject: converting commandline programs: a crazy idea
Message-ID: <1992Aug3.093740.7715@news.uni-stuttgart.de>
Sender: news@news.uni-stuttgart.de (USENET News System)
Organization: User Help Desk, Comp. Cent. (RUS), U of Stuttgart, FRG
Date: Mon, 3 Aug 1992 09:37:40 GMT
Lines: 51