Interrupt 0Bh (Janus)

This is a brief Description of the janus code. This Code supports lowlevel access to the Janus system — the link between a PC and an Amiga.
THE PUBLIC ROUTINES Name ID Description
1.Generation: GETSERVICE1 0 not supported any more
  GETBASE 1 report segments, offset of janus mem
  ALLOCMEM 2 allocate janus memory
  FREEMEM 3 free janus memory
  SETPARAM 4 set pointer to service parameter
  SETSERVICE 5 not supported any more
  STOPSERVICE 6 not supported any more
  CALLAMIGA 7 call service on Amiga side
  WAITAMIGA 8 wait for service becomes ready
  CHECKAMIGA 9 check service status
2.Generation: ADDSERVICE 10 add a dyn-service
  GETSERVICE 11 link to a dyn-service
  CALLSERVICE 12 call a dyn-service
  RELEASESERVICE 13 unlink from a dyn-service
  DELETESERVICE 14 delete a dyn-service
  LOCKSERVICEDATA 15 lock private mem of a dyn-service
  UNLOCKSERVICEDATA 16 unlock private mem of a dyn-service
  INITLOCK 17 Initialize a byte for use as a lock byte
  LOCKATTEMPT 18 Try once to obtain a Lock
  LOCK 19 Obtain a Lock
  UNLOCK 20 Release a Lock
  ALLOCJREMEMBER 21 Allocate Janus memory and link into a Remember list
  ATTACHJREMEMBER 22 Attach the list of one Janus memory key to another
  FREEJREMEMBER 23 Free memory allocated by calls to AllocJRemember()
  ALLOCSERVICEMEM 24 Allocate Janus memory linked to a ServiceData struct
  FREESERVICEMEM 25 Free mem added to a ServiceData by AllocServiceMem()

Service 0: JanusHandler/Get_service

NAME
Get_service -- Gets a new Service Number.

Expects Return
AH =GETSERVICE1 AL = Status (JSERV_NOFUNCTION)

NOTES
Not Supported anymore

Service 1: JanusHandler/GetBase

NAME
GetBase -- Get the segment addresses and offsets for an old style service.

SYNOPSIS

  • mov AH,GETBASE
  • mov AL,Service_number
  • int 0Bh

FUNCTION
Returns the segment address for buffer and parameter memory. Also returns the parameter memory offset for the old style service if defined.

Inputs Result
AH = GETBASE ES = Parameter memory segment
AL = Janus Service Number DI = Parameter offset if defined, else -1
  DX = Buffer memory segment
  AL = Status return (JSERV_OK)

EXAMPLE

  • mov AH,GETBASE
  • mov AL,JSERV_AMIGASERVICE
  • int 0Bh

Service 2: JanusHandler/AllocMem

NAME
AllocMem -- Allocate Janus memory.

SYNOPSIS

  • mov AH,ALLOCMEM
  • mov AL,Type
  • mov BX,Size
  • int 0Bh

FUNCTION
Allocates memory from the Janus dual-port RAM.

Inputs Result
AH = ALLOCMEM BX = Offset of allocated memory else 0
AL = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER) AL = Status (JSERV_OK,JSERV_NOJANUSMEM)
BX = Number of bytes to allocate  

EXAMPLE

  • mov AH,ALLOCMEM
  • mov AL,MEMF_BUFFER
  • mov BX,200
  • int 0Bh

SEE ALSO


Service 3: JanusHandler/FreeMem

NAME
FreeMem -- Free Janus memory previously allocated with AllocMem.

SYNOPSIS

  • mov AH,FREEMEM
  • mov AL,Type
  • mov BX,Offset
  • int 0bh

FUNCTION
Frees Janus dual-port memory previously allocated with AllocMem.

Inputs Result
AH = FREEMEM AL = Status (JSERV_OK, JSERV_NOJANUSMEM)
AL = Type of memory to free (MEMF_BUFFER, MEMF_PARAMETER)  
BX = Offset of memory to free. (same value returned by AllocMem)  

EXAMPLE

  • mov AH,FREEMEM
  • mov AL,MEMF_BUFFER
  • mov BX,Offset
  • int 0Bh

NOTES
Crashes if Type/Offset not valid!

SEE ALSO


Service 4: JanusHandler/SetParam

NAME
SetParam -- Set the parameter memory offset for an old style service.

SYNOPSIS

  • mov AH,SETPARAM
  • mov AL,ServiceNumber
  • mov BX,Offset
  • int 0Bh

FUNCTION
Sets the parameter memory pointer for the old style service to the offset given.

Inputs Result
AH = SETPARAM AL = Status (JSERV_OK)
AL = Janus Service Number  
BX = Offset of parameter memory for this service)  

EXAMPLE

  • mov AH,SETPARAM
  • mov AL,JSERV_AMIGASERVICE
  • mov BX,Offset
  • int 0Bh

NOTES
This is a low level Janus call retained for compatibility with V1.0.
Service programmers should not use this function.


Service 5: JanusHandler/SetService

NAME
SetService -- Set an address for a far call for that service.

Inputs Result
AH = SETSERVICE AL = Status (JSERV_NOFUNCTION)
AL = Janus Service Number  
ES:DX = Entry address for FAR call  

NOTES
Not Supported anymore


Service 6: JanusHandler/StopService

NAME
StopService -- Prevents AMIGA from using the far call (see above) for this function and releases this Service Number. No memory is freed up. No calls are accepted from either side anymore.

Inputs Result
AH = STOPSERVICE AL = Status (JSERV_NOFUNCTION)
AL = Number of Service to stop  

NOTES

  • Not Supported anymore

Service 7: JanusHandler/CallAmiga

NAME
CallAmiga -- Call an old style service.

SYNOPSIS

  • mov AH,Function
  • mov AL,Service_Number
  • int 0Bh

FUNCTION

  • Signals the Amiga side of the given old style service.
Inputs Result
AH =CALLAMIGA AL = Status (JSERV_PENDING, JSERV_FINISHED, JSERV_NOSERVICE)
AL = Janus Service Number  

EXAMPLE

  • mov AH,CALLAMIGA
  • mov AL,JSERV_AMIGASERVICE
  • int 0Bh

NOTES

  • This is a low level Janus call retained for compatibility with V1.0. Service programmers should not use this function.

Service 8: JanusHandler/WaitAmiga

NAME
WaitAmiga -- Wait for a previously issued CallAmiga to complete.

SYNOPSIS

  • mov AH,Function
  • mov AL,Service_Number
  • int 0Bh

FUNCTION

  • Waits for the Amiga to respond to the last CallAmiga.
Inputs Result
AH = WAITAMIGA AL = Status (JSERV_FINISHED, JSERV_NOSERVICE)
AL = Janus Service Number  

EXAMPLE

  • mov AH,WAITAMIGA
  • mov AL,JSERV_AMIGASERVICE
  • int 0Bh

NOTES

  • This is a low level Janus call retained for compatibility with V1.0. Service programmers should not use this function.

Service 9: JanusHandler/CheckAmiga

NAME
CheckAmiga -- Check the status of a previously issued CallAmiga.

SYNOPSIS

  • mov AH,Function
  • mov AL,Service_Number
  • int 0Bh

FUNCTION

  • Checks the response status of the last CallAmiga.
Inputs Result
AH = CHECKAMIGA AL = Status (JSERV_PENDING, JSERV_FINISHED, JSERV_NOSERVICE)
AL = Janus Service Number  

EXAMPLE

  • mov AH,CHECKAMIGA
  • mov AL,JSERV_AMIGASERVICE
  • int 0Bh

NOTES

  • This is a low level Janus call retained for compatibility with V1.0. Service programmers should not use this function.

Service 10: JanusHandler/AddService

NAME
AddService -- Add a service to the system.

SYNOPSIS

  • mov AH,ADDSERVICE
  • mov DS,ApplicationID_high_word
  • mov SI,ApplicationID_low_word
  • mov CX,LocalID
  • mov BX,Size
  • mov DX,Type
  • mov AL,Flags
  • mov ES,Handler_Segment
  • mov DI,Handler_Offset
  • int 0Bh

FUNCTION
Adds a service to the system.

Inputs Result
AH = ADDSERVICE AL = Status (JSERV_OK, JSERV_NOJANUSMEM, JSERV_NOSERVICE,JSERV_NOJANUSBASE)
DS = High word of 32 bit application ID ES = Segment of ServiceData structure
SI = Low word of application ID DI = Offset of ServiceData structure
CX = Local ID  
BX = Size in bytes of memory to allocate  
DX = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER)  
AL = AddService flags from services.[hi]  
ES = Segment of assembly language routine to call when this service is called or NULL.  
DI = Offset of assembly language routine to call when this service is called or NULL.  
   

EXAMPLE

  • mov AH,ADDSERVICE
  • mov DS,ApplicationID_high_word
  • mov SI,ApplicationID_low_word
  • mov CX,LocalID
  • mov BX,Size
  • mov DX,MEMF_BUFFER
  • mov AL,ADDS_EXCLUSIVE | ADDS_TOAMIGA_ONLY
  • mov ES,Handler_Segment
  • mov DI,Handler_Offset
  • int 0Bh

SEE ALSO


Service 11: JanusHandler/GetService

NAME
GetService -- Get a service and its ServiceData pointer

SYNOPSIS

  • mov AH,GETSERVICE
  • mov DS,ApplicationID_high_word
  • mov SI,ApplicationID_low_word
  • mov CX,LocalID
  • mov AL,Flags
  • mov ES,Handler_Segment
  • mov DI,Handler_Offset
  • int 0Bh

FUNCTION
Gets a pointer to a Services ServiceData structure if the Service exists.

Inputs Result
AH = GETSERVICE  
DS = High word of 32bit application ID AL = Status (JSERV_OK, JSERV_NOSERVICE)
SI = Low word of 32bit application ID ES = Segment of ServiceData structure
CX = Local ID DI = Offset of ServiceData structure
AL = Flags  
ES = Segment of assembly language handler to be called whenever this service is called or NULL.  
DI = Offset of assembly language handler to be called whenever this service is called or NULL.  
   

EXAMPLE

  • mov ax,ApplicationID_high_word
  • mov DS,ax
  • mov SI,ApplicationID_low_word
  • mov CX,LocalID
  • mov ax,Handler_Segment
  • mov ES,ax
  • mov DI,Handler_Offset
  • mov AH,GETSERVICE
  • mov AL,GETS_WAIT
  • int 0Bh

SEE ALSO


Service 12: JanusHandler/CallService

NAME
CallService -- Signal all other users of a service.

SYNOPSIS

  • mov AH,Function
  • mov DI,ServiceData_Offset
  • int 0Bh

FUNCTION
To signal all users of a service except the one that called CallService.

Inputs Result
AH = CALLSERVICE  
DI = Offset of the services ServiceData structure. AL = Status (JSERV_OK, JSERV_NOJANUSMEM, JSERV_NOJANUSBASE)

EXAMPLE

  • mov AH,CALLSERVICE
  • mov DI,ServiceData_Offset
  • int 0Bh

SEE ALSO


Service 13: JanusHandler/ReleaseService

NAME
ReleaseService -- Release a service previously obtained with GetService

SYNOPSIS

  • mov AH,RELEASESERVICE
  • mov DI,ServiceData_Offset
  • int 0Bh

FUNCTION
To Release use of a service previously gotten via GetService.

Inputs Result
AH = RELEASESERVICE  
DI = Offset of ServiceData structure. AL = Status (JSERV_OK, JSERV_NOJANUSBASE)

EXAMPLE

  • mov AH,RELEASESERVICE
  • mov DI,ServiceData_Offset
  • int 0Bh

SEE ALSO


Service 14: JanusHandler/DeleteService

NAME
DeleteService -- Delete a service previously added with AddService

SYNOPSIS

  • mov AH,,DELETESERVICE
  • mov DI,ServiceData_Offset
  • int 0Bh

FUNCTION
To Delete a service previously added with AddService.

Inputs Result
AH = ,DELETESERVICE  
DI = Offset of ServiceData structure. AL = Status (JSERV_OK, JSERV_NOJANUSBASE)

EXAMPLE

  • mov AH,DELETESERVICE
  • mov DI,ServiceData_Offset
  • int 0Bh

SEE ALSO


Service 15: JanusHandler/LockServiceData

NAME
LockServiceData -- Perform the steps necessary to Lock a ServiceData structure.

SYNOPSIS

  • mov AH,LOCKSERVICEDATA
  • mov DI,ServiceData_Offset
  • int 0Bh

FUNCTION
Performs the necessary steps to Lock a ServiceData structure for exclusive access.

Inputs Result
AH = LOCKSERVICEDATA  
DI = Offset of ServiceData structure. AL = Status (JSERV_OK)

EXAMPLE

  • mov AH,LOCKSERVICEDATA
  • mov DI,ServiceData_Offset
  • int 0Bh

SEE ALSO


Service 16: JanusHandler/UnLockServiceData

NAME
UnLockServiceData -- Perform the steps necessary to UnLock a ServiceData structure.

SYNOPSIS

  • mov AH,UnLockServiceData
  • mov DI,ServiceData_Offset
  • int 0Bh

FUNCTION
Performs the necessary steps to UnLock a ServiceData structure.

Inputs Result
AH = UNLOCKSERVICEDATA  
DI = Offset of ServiceData structure. AL = Status (JSERV_OK)

EXAMPLE

  • mov AH,UNLOCKSERVICEDATA
  • mov DI,ServiceData_Offset
  • int 0Bh

SEE ALSO


Service 17: JanusHandler/InitLock

NAME
JanusInitLock -- Initialize a byte for use as a lock byte.

SYNOPSIS

  • mov AH,INITLOCK
  • mov ES,Segment
  • mov DI,Offset
  • int 0Bh

FUNCTION
Performs the necessary steps to Initialize a Janus Lock byte.

Inputs Result
AH = INITLOCK The Lock byte is initialized.
ES = Segment of lock byte.  
DI = Offset of lock byte  

RESULT
The Lock byte is initialized.

EXAMPLE

  • mov AH,INITLOCK
  • mov ES,Segment
  • mov DI,Offset
  • int 0Bh

SEE ALSO


Service 18: JanusHandler/LockAttempt

NAME
JanusLockAttempt -- Try once to obtain a Lock

SYNOPSIS

  • mov AH,LOCKATTEMPT
  • mov ES,Segment
  • mov DI,Offset
  • int 0Bh

FUNCTION
Attempts once to gain a Lock.

Inputs Result
AH = LOCKATTEMPT AL = TRUE if lock is gotten FALSE otherwise.
ES = Segment of lock byte.  
DI = Offset of lock byte  

EXAMPLE

  • mov AH,LOCKATTEMPT
  • mov ES,Segment
  • mov DI,Offset
  • int 0Bh

SEE ALSO


Service 19: JanusHandler/Lock

NAME
JanusLock -- Obtain a Lock

SYNOPSIS

  • mov AH,LOCK
  • mov ES,Segment
  • mov DI,Offset
  • int 0Bh

FUNCTION
Get a lock.

Inputs Result
AH = LOCK Returns when the lock is gotten.
ES = Segment of lock byte.  
DI = Offset of lock byte  

EXAMPLE

  • mov AH,LOCK
  • mov ES,Segment
  • mov DI,Offset
  • int 0Bh

SEE ALSO


Service 20: JanusHandler/Unlock

NAME
JanusUnlock -- Release a Lock

SYNOPSIS

  • mov AH,UNLOCK
  • mov ES,Segment
  • mov DI,Offset
  • int 0Bh

FUNCTION
Release a lock.

Inputs Result
AH = UNLOCK Returns when the lock is released.
ES = Segment of lock byte.  
DI = Offset of lock byte  

EXAMPLE

  • mov AH,UNLOCK
  • mov ES,Segment
  • mov DI,Offset
  • int 0Bh

SEE ALSO


Service 21: JanusHandler/AllocJRemember

NAME
AllocJRemember -- Allocate Janus memory and link into a Remember list

SYNOPSIS

  • mov AH,ALLOCJREMEMBER
  • mov AL,Type
  • mov BX,Size
  • mov ES,JRememberKey_Segment
  • mov DI,JRememberKey_Offset
  • int 0Bh

FUNCTION
Allocates memory from the Janus dual-port RAM, but also adds the details of the allocation into a master list so that you make just one call the FreeJRemember() routine at a later time to free all the memory you allocated.

Inputs Result
AH = ALLOCJREMEMBER BX = Offset of allocated memory else 0
AL = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER) AL = Status (JSERV_OK,JSERV_NOJANUSMEM)
BX = Number of bytes to allocate  
DI = Offset of JRememberKey
(Before your very first call to AllocJRemember() the pointer should be set to NULL.)
 

EXAMPLE

  • mov AH,ALLOCJREMEMBER
  • mov AL,MEMF_BUFFER
  • mov BX,200
  • mov ES,JRememberKey_Segment
  • mov DI,JRememberKey_Offset
  • int 0Bh

SEE ALSO


Service 22: JanusHandler/AttachJRemember

NAME
AttachJRemember -- Attach the list of one Janus memory key to another

SYNOPSIS

  • mov AH,ATTACHJREMEMBER
  • mov ES,To_JRememberKey_Segment
  • mov DI,To_JRememberKey_Offset
  • mov DS,From_JRememberKey_Segment
  • mov SI,From_JRememberKey_Offset
  • int 0Bh

FUNCTION
This routine accepts two Janus RememberKeys created by calls to AllocJRemember() and attaches the contents of the FromKey to the ToKey. In the process, FromKey is set equal to NULL.

Inputs Result
AH = ATTACHJREMEMBER None
ES = Segment of To_JRememberKey  
DI = Offset of To_JRememberKey
(address of a pointer to JanusRemember structures,
which pointer is going to receive the list pointed to by FromKey)
 
DS = Segment of From_JRememberKey  
SI = Offset of From_JRememberKey
( address of a pointer to JanusRemember structures,
which pointer has the list that's going to be attached ToKey,
after which the FromKey variable will be set to NULL.)
 

SEE ALSO


Service 23: JanusHandler/FreeJRemember

NAME
FreeJRemember -- Free memory allocated by calls to AllocJRemember()

SYNOPSIS

  • mov AH,Function
  • mov AL,ReallyForget
  • mov ES,JRememberKey_Segment
  • movDI,JRememberKey_Offset
  • int 0Bh

FUNCTION
This function frees up Janus memory allocated by the AllocJRemember() function.
It will either free up just the JanusRemember structures(ReallyForget = FALSE), which supply the link nodes that tie your allocations together,
or it will deallocate both the link nodes AND your memory buffers too (ReallyForget = TRUE).

Inputs Result
AH = FREEJREMEMBER None
AL = ReallyForget (BOOL)
(a BOOL FALSE or TRUE describing, respectively,
whether you want to free up only the Remember nodes or if you want this
procedure to really forget about all of the memory,
including both the nodes and the memory buffers pointed to by the nodes.)
 
ES = Segment of JRememberKey  
DI = Offset of JRememberKey
(the address of a pointer to struct JanusRemember.
This pointer should either be NULL or set to some value
(possibly NULL) by a call to AllocRemember()
 
   

SEE ALSO


Service 24: JanusHandler/AllocServiceMem

NAME
AllocServiceMem -- Allocate Janus memory linked to a ServiceData struct

SYNOPSIS

  • mov AH,ALLOCSERVICEMEM
  • mov AL,Type
  • mov BX,Size
  • mov DI,ServiceData_Offset
  • int 0Bh

FUNCTION
This routine allocates memory for you and records the details of the allocation in the specified ServiceData structure. This memory, unless you free it explicitly with a call to FreeServiceMem(), will be automatically freed when the service is deleted and removed from the system.

Inputs Result
AH = ALLOCSERVICEMEM BX = Offset of allocated memory else 0
AL = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER) AL = Status (JSERV_OK,JSERV_NOJANUSMEM)
BX = Number of bytes to allocate  
DI = Offset of ServiceData structure  

SEE ALSO


Service 25: JanusHandler/FreeServiceMem

NAME
FreeServiceMem -- Free mem added to a ServiceData by AllocServiceMem()

SYNOPSIS

  • SYNOPSIS
  • mov AH,FREESERVICEMEM
  • mov AL,Type
  • mov BX,ServiceMem_Offset
  • mov DI,ServiceData_Offset
  • int 0Bh

FUNCTION
This routine frees memory that had been allocated with a call to AllocServiceMem(). You can choose to free a single block of memory or all the memory of the ServiceData structure.

Inputs Result
AH = FREESERVICEMEM None
AL = Type of memory to allocate (MEMF_BUFFER, MEMF_PARAMETER)  
BX = Offset of prior allocated memory
or NULL if you want to delete all of the ServiceData's memory
 
DI = Offset of ServiceData structure  

SEE ALSO

Last Update: 20.06.2022