<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 27 Feb 1985 0137-:00PST (Wednesday)
From   : 37270588%sdcc3@sdcsvax.ARPA
Subject: Re: changing user areas

>  Sorry to keep bugging you about this things but I've run into another little
>problem, I need to be able to change the user area from the program. The
>inline statement totally confused me and the Bdos function adjusts the wrong
>register. Do you know how to change to the user area?
 
 
The BDOS function code for "getting" and "setting" the user area is 20h.
Perhaps you are not distinguishing hex from decimal or vice-versa (20h = 32d).
Anyways, the contents of register E determines whether to get or set the user
area.  If register E contains FFh, then the curent user area is returned in
register A.  Any other valid user number in register E will set you to that
user number.  i.e.
 
procedure change_users;
   const
      user_code = $0020;   { BDOS call }
      current = $FF;
   var
      new_user : byte;
   begin
      writeln('Current user is: ',bdos(user_code,current));
      write('New user? ');
      readln(new_user);
      bdos(user_code,new_user);   { put new_user in register E to change }
   end;
 
 
--Irwin Hom             {ihnp4, sdcsvax!bang}!crash!ihom
                                    bang!crash!ihom@nosc
                                  sdamos!crash!ihom@ucsd
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>