AMX 86 - Manuals
AMX 86 – Manual in PDF format online.
Manuals:
Manual AMX 86
Summary
AMX 86 User's Guide K ADAK i TECHNICAL SUPPORT KADAK Products Ltd. is committed to technical support for its software products. Ourprograms are designed to be easily incorporated in your systems and every effort hasbeen made to eliminate errors. Engineering Change Notices (ECNs) are provided periodi...
ii K ADAK AMX 86 User's Guide Copyright © 1990-2005 by KADAK Products Ltd. All rights reserved. No part of this publication may be reproduced, transmitted, transcribed,stored in a retrieval system, or translated into any language or computerlanguage, in any form or by any means, electronic, mechanic...
AMX 86 User's Guide K ADAK iii AMX 86 USER'S GUIDE Table of Contents Page Section 1: System Description 1. AMX Overview 1 1.1 Introduction ........................................................................................ 1 1.2 Glossary ............................................................
AMX 86 User's Guide K ADAK v AMX 86 USER'S GUIDE Table of Contents (Cont'd.) Page Section 1: System Description (Cont'd.) 12. AMX Linked List Manager 139 12.1 Introduction ...................................................................................... 13912.2 Linked Lists .......................
vi K ADAK AMX 86 User's Guide AMX 86 USER'S GUIDE Table of Contents (Cont'd.) Page Appendices A. AMX 86 Reserved Words 347 B. AMX 86 Error Codes 349 C. Configuration Generator Specifications 353 C.1 Introduction ....................................................................................... ...
AMX Overview K ADAK 1 1. AMX Overview 1.1 Introduction The AMX ™ Multitasking Executive provides a simple solution to the complexity of real- time multitasking. AMX supervises the orderly execution of a set of application programmodules called tasks. AMX allows the system designer to concentrate on ...
2 K ADAK AMX Overview Section Summary This manual is divided into three sections. Each section is divided into chapters. Section 1 of this manual describes the AMX Multitasking System and how it is used.Separate chapters are provided for each of the AMX managers. Section 2 describes the AMX System C...
AMX Overview K ADAK 7 1.3 AMX Nomenclature The following nomenclature has been adopted throughout the AMX User's Guide. Processor registers are referenced as follows: 8-Bit Registers AH, AL, BH, BL, CH, CL, DH, DL 16-Bit Registers AX, BX, CX, DX, SP, BP, SI, DI Instruction Pointer IP Flags (Conditio...
8 K ADAK AMX Overview This page left blank intentionally.
General AMX Operation K ADAK 9 2. General AMX Operation 2.1 Introduction to Multitasking A real-time system is characterized by the need to respond rapidly to events occurring asynchronously in time. A multitasking system is one in which a number of activities orprocesses must be performed simultane...
General AMX Operation K ADAK 11 2.2 AMX Operation AMX Startup Each AMX-based system consists of the AMX executive program and a set ofapplication tasks and interrupt service procedures. This collection of programs residentin the memory of the microprocessor configuration represents the entire operat...
General AMX Operation K ADAK 13 The Task Scheduler Following system initialization, AMX proceeds to its Task Scheduler. The TaskScheduler searches its list of available tasks to determine the highest priority task capableof execution. Task execution priorities are determined by the system designer. ...
14 K ADAK General AMX Operation The Interrupt Supervisor Tasks execute with the processor interrupt facility enabled to permit service of externaldevices. When an external interrupt occurs, the task is interrupted in the manner dictatedby the processor. The processor automatically saves the return a...
General AMX Operation K ADAK 15 Timing Facilities The AMX Timer Manager provides a Clock Handler and a Kernel Task to providecomplete timing control for your real-time application. The AMX Clock Handler isindependent of any particular hardware configuration. If AMX timing facilities are to beutilize...
16 K ADAK General AMX Operation Message Queuing One of the more powerful features of AMX is its ability to queue messages for tasks.The queuing facility permits messages to pile up in a controlled fashion, freeing the ISP,Timer Procedure or task which is sending the message to continue with its appo...
General AMX Operation K ADAK 17 2.3 AMX Managers AMX provides a set of managers to simplify event synchronization, resourcemanipulation and memory allocation. Not all applications will make use of all of themanagers. The system designer can decide which of the AMX managers is best suitedfor a partic...
18 K ADAK General AMX Operation The AMX 86 Task Mailbox facility provides a general purpose message queuing mechanism for tasks. This service is not provided by a separate AMX manager; it is aninherent feature of AMX 86. Any task can have up to four private mailboxes in whichthe task can receive AMX...
General AMX Operation K ADAK 19 The Circular List Manager provides a general purpose circular list facility for maintaining compact lists of 8-bit, 16-bit or 32-bit variables. Circular lists areparticularly useful for managing character streams associated with input/output devices. The Linked List M...
20 K ADAK General AMX Operation 2.4 Starting AMX An AMX operating system consists of AMX, the subset of its managers which youchoose to use and your complement of application programs. All of these modules areconnected together to form the AMX operating system as described in the AMX ToolGuide. Befo...
General AMX Operation K ADAK 21 Permanent Launch In most applications, your AMX operating system is resident in ROM or loaded intoRAM. AMX is started in real mode and given permanent control of the processor. An AMX system can be launched permanently from a main program coded in C asillustrated in t...
General AMX Operation K ADAK 23 Temporary Launch Your AMX operating system can be started, allowed to run for a while and then stopped.This type of operation is called a temporary launch. The most common application ofthis type occurs on PC compatibles. An AMX operating system is started from DOS,al...
Application Tasks K ADAK 25 3. Application Tasks 3.1 Task Creation The AMX Multitasking Executive provides a simple solution to the complexity of real-time multitasking. AMX supervises the orderly execution of a set of application program modules called tasks. Each task solves a particular problem a...
26 K ADAK Application Tasks Tasks which do not receive messages are written as Large or Medium model C functionswithout formal parameters. These tasks must be started using AMX procedure ajtrig . For this reason, such tasks are called trigger tasks . For example, a task that immediately ends would a...
Application Tasks K ADAK 27 3.2 Task States A task is always in one of the following states: IdleReadyRunWaitHalt When a task is created, AMX assigns it a Task Control Block and sets it in the idle state.An idle task has no outstanding requests to execute pending. It is waiting to be triggered. A re...
28 K ADAK Application Tasks event of interestor timeout occurs ajtrig - trigger a task ajwait - wait ajwatm - timed wait ajsenw - send message to taskmailbox and wait for ack ajmxwat - wait on a message exchange ajsmrsv - reserve a resource ajsmwat - wait on a semaphore ajevwat - wait for event task...
32 K ADAK Application Tasks 3.6 Task and Event Synchronization AMX offers several simple forms of task/event synchronization. Using the ajwait call, a task can unconditionally wait for an event. The event can be task dependent, device dependent or time dependent. The task, having issued an ajwait ca...
36 K ADAK Application Tasks 3.9 Message Passing AMX supports the passing of a message to a task mailbox or message exchange. Messages can be sent to a task by: Application TasksInterrupt Service ProceduresTimer ProceduresRestart ProceduresExit Procedures You can send a message to a task mailbox or m...
38 K ADAK Application Tasks Figure 3.9-1 provides an example of the manner in which messages are allowed to queueon a message exchange. The same message queuing technique is used when messagesare sent to a task's private mailboxes within its Task Control Block (TCB). In the example, the following si...
Application Tasks K ADAK 41 Message Extension AMX delivers messages to a task by copying the message from a message envelope to amessage frame on the task's stack. AMX also presents an extension to the applicationmessage on the task's stack. The message extension identifies who sent the message and,...
42 K ADAK Application Tasks 3.10 Restart Procedures The manner in which the operating system begins execution is application dependent.Execution begins in the user domain providing the opportunity for hardware specific andapplication dependent setup prior to the initialization of the AMX system. For...
Application Tasks K ADAK 43 Restart Procedures can enable specific device interrupts if required. Note that interruptsfrom a device should not be enabled until the application ISP has been installed and madeready to handle the interrupting device. Restart Procedures should not enable the processor i...
44 K ADAK Application Tasks 3.11 Exit Procedures An AMX system can be shut down in an orderly fashion by a task call to procedure ajexit . The manner in which the operating system ends execution is application dependent. For example, hardware interfaces may require restoration to their initialstates...
46 K ADAK Application Tasks 3.12 Task Enhancements AMX offers several task enhancements which, although rarely used, can occasionallycome in handy. These enhancements are briefly summarized below. Task Control Block Extension Within a task's Task Control Block, 16 bytes are reserved for the private ...
Application Tasks K ADAK 47 AMX Kernel Task Priority The AMX Kernel Task operates as the highest priority task in your AMX system. Itsexecution priority is zero. It has the reserved task tag 'AMXK' . Occasionally, an application is encountered in which a task must execute at very highpriority in ord...
Interrupt Service Procedures K ADAK 49 4. Interrupt Service Procedures 4.1 The Processor Interrupt Facility The key to event-driven, real-time, multitasking systems is the processor's interruptfacility. Tasks execute with the interrupt facility enabled permitting the system torespond to a real-time ...
Interrupt Service Procedures K ADAK 51 4.2 ISPs for External Interrupts Two types of ISPs exist: nonconforming ISPs and conforming ISPs. Nonconforming ISPs A nonconforming ISP must quickly service the device to remove the interruptingcondition. The ISP must preserve all registers which it uses. The ...
52 K ADAK Interrupt Service Procedures If the Interrupt Handler requested AMX to initiate or resume execution of some task ofhigher priority than the interrupted task, the AMX Interrupt Supervisor suspends theinterrupted task and marks it as ready to resume execution at the earliest opportunity.The ...
Interrupt Service Procedures K ADAK 53 Conforming ISP Construction The construction of an Interrupt Service Procedure (ISP) to service an external interruptis a simple process. The conforming ISP consists of two parts: the ISP root and your Interrupt Handler. The ISP root is a code fragment most eas...
54 K ADAK Interrupt Service Procedures The Interrupt Service Procedure should be coded using assembly language if speed ofexecution is critical. EXTRN AAINT:FAR EXTRN AAINX:FAR ;DVC_CODE SEGMENT BYTE 'CODE'; PUBLIC DVCISP ; The ISP is located in user program memory; ASSUME CS:DVC_CODE ;DVCISP PROC F...
56 K ADAK Interrupt Service Procedures 4.3 Nested Interrupts AMX supports nested interrupts. The AMX Interrupt Supervisor maintains a privatenesting level indicator. AMX must be informed of the start ( AAINT ) and end ( AAINX ) of each interrupt. When AMX sees that a task has been interrupted, it sw...
Interrupt Service Procedures K ADAK 57 4.4 ISP/Task Communication AMX provides a set of service procedures to ease the communication between tasks anddevice Interrupt Handlers. These AMX procedures simplify event synchronization andpermit parameter passing to tasks. Wait/Wake Synchronization The ajw...
58 K ADAK Interrupt Service Procedures Semaphore Synchronization The AMX Semaphore Manager provides an even more powerful synchronizationcapability. It provides the automatic timeout facility and also allows more than one taskto wait for the same event, with each task determining its own waiting pri...
Interrupt Service Procedures K ADAK 59 Task Triggering An Interrupt Handler can communicate with a task by invoking the task's execution.When an interrupt occurs, the Interrupt Handler issues the ajtrig call to AMX identifying the task which it wishes to have executed. This technique can be very use...
60 K ADAK Interrupt Service Procedures 4.5 Task Error Traps The 80x86 processor automatically detects the occurrence of execution errors such asdivision by zero, arithmetic overflow or an array bound violation. These errors, by theirvery nature, must be handled by the application in the context of t...
Interrupt Service Procedures K ADAK 65 4.7 Special Interrupts Nonconforming Interrupts In some systems there may be devices which generate interrupts requiring nocommunication or synchronization with any task in the system. For example, a high-speed scanner can interrupt the processor whenever new d...
66 K ADAK Interrupt Service Procedures Shared Interrupt Handlers Occasionally a single Interrupt Handler can be used to service more than one identicaldevice. For example, an Interrupt Handler for an asynchronous serial I/O device (UART)could be used to service the UART for each of several communica...
68 K ADAK Interrupt Service Procedures 4.8 Vector Table Initialization The 80x86 processor operating in real mode vectors to an Interrupt Service Procedure(ISP) directly through its Interrupt Vector Table which, in AMX nomenclature, is simplycalled the AMX Vector Table. The Vector Table may be locat...
AMX Timing Control K ADAK 69 5. AMX Timing Control 5.1 Introduction to Timing Facilities Most real-time systems are characterized by the need to provide precise control over thetiming of activities. A hardware clock provides the timing source; AMX provides thecontrol over its use. The unit of time i...
70 K ADAK AMX Timing Control Calendar Clock The AMX Time/Date Manager provides Y2K compliant time of day calendar support ifrequired. The AMX calendar clock includes second, minute, hour, day, month, year andday of the week. AMX services are provided to set and read the calendar clock. Aformatting p...
AMX Timing Control K ADAK 71 5.2 AMX Clock Handler and Kernel Task AMX includes a conforming clock ISP root, a Clock Handler and a Kernel Task toprovide timing facilities. Whenever a clock interrupt occurs, the clock ISP root calls yourapplication clock Interrupt Handler to dismiss the hardware cloc...
72 K ADAK AMX Timing Control Clock ISP Implementation AMX can provide timing facilities only if a hardware clock interrupt is available. Forefficiency, it is recommended that the clock ISP be coded in assembly language asillustrated below. Note that the clock ISP root and Interrupt Handler have been...
AMX Timing Control K ADAK 75 5.3 Interval Timers and Timer Procedures AMX supports any number of application interval timers in a system. The maximumnumber in a system is defined in your System Configuration Module (see Chapter 14.5). A timer must be created by an application before it can be used. ...
AMX Timing Control K ADAK 77 Timer Procedures can be written as Large or Medium model C functions with formalparameters. #include "amx831cf.h" /* AMX C Interface Header */ void cdecl truser( /* Timer Procedure */ AMXID timerid, /* timer id */ struct userblock FAR *userp) /* pointer to user b...
78 K ADAK AMX Timing Control The Timer Procedure can be coded in assembler as a FAR procedure as follows: TMR_CODE SEGMENT BYTE 'CODE';; The Timer Procedure is located in user program memory; ASSUME CS:TMR_CODE ;TRUSER PROC FAR MOV DX,WORD PTR [BP] ;DX = timer id LES BX,DWORD PTR [BP+2] ;ES:BX = 32-...
AMX Timing Control K ADAK 79 5.4 Task Time Slicing AMX provides task time slicing as an option. The AMX system must be configured toinclude a clock if time slicing is to be possible. Time slice intervals are then specified asmultiples of the AMX system tick. Time slicing is normally disabled. It is ...
80 K ADAK AMX Timing Control Figure 5.4-1 illustrates the allocation of processing time to two tasks, B and C. Task Bwas created first with a time slice interval of 100 AMX system ticks. Task C was createdlater with a time slice interval of 50 AMX system ticks. At time t1 , tasks B and C were both t...
82 K ADAK AMX Timing Control 5.5 Time/Date Manager Most real-time systems require the maintenance of a calendar clock. The AMXTime/Date Manager provides this facility. The Y2K compliant calendar clock maintained by the Time/Date Manager includessecond, minute, hour, day, month and year. Leap year is...
AMX Timing Control K ADAK 83 Operation The Time/Date Manager includes two components: an AMX Restart Procedure and a setof service procedures. If your AMX System Configuration Module enables the Time/Date option, AMXautomatically calls the Time/Date Restart Procedure during the launch prior to execu...
88 K ADAK AMX Timing Control Time/Date ASCII Formats The Time/Date Manager procedure ajtdf can be used to format time and date into an ASCII character string in any of several popular formats. The time and date is presentedto ajtdf in the standard AMX time/date structure. The ASCII string is returne...
AMX Semaphore Manager K ADAK 91 6. AMX Semaphore Manager 6.1 Introduction E.W. Dijkstra introduced two primitive operations to resolve two seemingly unrelatedproblems: mutually exclusive access by tasks to critical resources and thesynchronization of asynchronously occurring activities. The abstract...
AMX Semaphore Manager K ADAK 93 6.2 Semaphore Use The Semaphore Manager supports any number of semaphores. The maximum number ofsemaphores in a system is defined in your System Configuration Module (see Chapter14.5). The defined maximum sets an upper limit on the number of actual semaphoresthat can ...
94 K ADAK AMX Semaphore Manager Counting Semaphore A counting semaphore is created by specifying an initial semaphore count greater than orequal to zero in the call to ajsmcre . When used for mutual exclusion, the semaphore should be given an initial value of one. If a semaphore is initialized with ...
AMX Semaphore Manager K ADAK 95 Resource Semaphore AMX resource semaphores provide the simplest mechanism for controlling the access tocritical resources. Resources may include disk files, I/O devices, database components,regions of memory, specific words of memory or any other entity which is consi...
96 K ADAK AMX Semaphore Manager If the resource does not become available within the timeout interval specified by thetask, the task will be removed from the resource semaphore wait queue and will resumeexecution with a timeout indication. Tasks which need to use a resource but which cannot wait for...
AMX Semaphore Manager K ADAK 97 6.3 Semaphore Applications Mutual Exclusion Assume that three tasks, A, B and C, require shared access to a common data structurebeing used to control some process. Access to the data structure must be mutuallyexclusive so that one task cannot be modifying the data in...
AMX Semaphore Manager K ADAK 99 Task/Event Synchronization A counting semaphore can be used to provide synchronization between a task waiting foran event and a task, ISP or Timer Procedure in which the event is detected. Thefollowing example assumes that a device ISP detects the event. A task create...
100 K ADAK AMX Semaphore Manager EXTRN AAINT:FAR ;enter ISP EXTRN AAINX:FAR ;leave ISP EXTRN AASMSIG:FAR ;signal to a semaphore EXTRN _SYNCISP:WORD ;ISP synchronization semaphore id ;;DVC_CODE SEGMENT BYTE 'CODE'; ASSUME CS:DVC_CODE ;;DVCISP PROC FAR CALL AAINT ;tell AMX :Clear interrupt sourceCheck...
AMX Semaphore Manager K ADAK 101 Resource Nesting Assume that two tasks, A and B, have to share a numeric coprocessor. Furthermore,these two tasks also must share a common library procedure ncmath which must use the coprocessor. A resource semaphore must be used because ownership of the numeric copr...
AMX Event Manager K ADAK 103 7. AMX Event Manager 7.1 Introduction The AMX Event Manager provides the most general form of event synchronizationoffered by AMX. The Event Manager provides a convenient mechanism for separatingthe tasks waiting for events from the tasks, Timer Procedures and Interrupt ...
AMX Event Manager K ADAK 105 7.2 Event Synchronization The AMX Event Manager supports any number of event groups in a system. Each eventgroup includes 16 event flags. The maximum number of event groups in a system isdefined in your System Configuration Module (see Chapter 14.5). The defined maximums...
106 K ADAK AMX Event Manager Events are signalled by tasks, ISPs and Timer Procedures. The event is signalled with acall to procedure ajevsig . The caller specifies the group id of the event group which contains the particular event. More than one event can be signalled in a single call to ajevsig ....
AMX Event Manager K ADAK 107 7.3 Event Flag Application The following example, coded in C, is provided to illustrate the use of the AMX EventManager for event synchronization. The example shows two tasks, A and B, which must be synchronized to the state of amotor. Task A must wait for the motor to b...
AMX Message Exchange Manager K ADAK 111 8. AMX Message Exchange Manager 8.1 Introduction The AMX Message Exchange Manager provides a very flexible, general purposemechanism for inter process communication and synchronization using prioritizedmessages. In particular, it offers an instant solution to ...
112 K ADAK AMX Message Exchange Manager The task's wait priority is not to be confused with the message queue priority. Themessage queue priority determines the priority ordering of messages in the messageexchange when no task is waiting for a message. The task's wait priority determines theorder of...
AMX Message Exchange Manager K ADAK 113 8.2 Message Exchange Use The Message Exchange Manager supports any number of message exchanges. Themaximum number of message exchanges in a system is defined in your SystemConfiguration Module (see Chapter 14.5). The defined maximum sets an upper limit onthe n...
114 K ADAK AMX Message Exchange Manager Messages are sent to message exchanges in AMX message envelopes. The MessageExchange Manager gets a free message envelope from the common pool of envelopesmaintained by AMX. You must therefore be sure to allocate enough message envelopesto meet the needs of al...
AMX Message Exchange Manager K ADAK 115 8.3 Message Exchange Application The following example, coded in C, is provided to illustrate the use of the AMX MessageExchange Manager. This example illustrates a solution to the problem posed in the introduction (Chapter 8.1).Two message processing tasks, A...
AMX Buffer Manager K ADAK 119 9. AMX Buffer Manager 9.1 Introduction The AMX Buffer Manager simplifies the management of memory buffers in a real-timesystem. It provides a general mechanism for the allocation and control of fixed sizebuffers. The AMX Buffer Manager provides fast, efficient access to...
120 K ADAK AMX Buffer Manager 9.2 Buffer Pool Use The Buffer Manager supports any number of pools of buffers. The maximum number ofbuffer pools in a system is defined in your System Configuration Module (see Chapter14.5). The defined maximum sets an upper limit on the number of actual buffer poolsth...
AMX Buffer Manager K ADAK 121 Get Buffer Once a buffer pool has been created, you may call procedure ajbget to get a buffer from the pool. The Buffer Manager unlinks a buffer from the pool's free list, sets theassociated buffer use count to one and returns a pointer to the first byte of the buffer.Y...
122 K ADAK AMX Buffer Manager 9.3 Buffer Applications Consider the following example. A process control system using AMX has a printer onwhich errors and status messages are to be logged. These messages are generated byseveral tasks as they perform their process control functions. These tasks must n...
124 K ADAK AMX Buffer Manager 9.4 Buffer Manager Caveats Although the Buffer Manager attempts to check as many error conditions as possible, itcannot protect against a bad system design. However, if a little care is taken duringsystem design, the Buffer Manager can help make a system more reliable t...
AMX Memory Manager K ADAK rev9 125 10. AMX Memory Manager 10.1 Introduction The AMX Memory Manager simplifies the management of memory in an AMX system.It provides a general mechanism for the dynamic allocation and control of memory and isspecifically designed for use in a multitasking environment. ...
AMX Memory Manager K ADAK 127 10.2 Nomenclature The following nomenclature has been adopted by the Memory Manager. A Memory Section is a contiguous, double word aligned area of Random Access Memory Random (RAM) which has been specified by the user to be under the control ofthe Memory Manager. A sect...
128 K ADAK AMX Memory Manager 10.3 Memory Allocation The Memory Manager maintains a single memory pool. The memory pool consists ofany number of memory sections of varying sizes measured in bytes. Any memorysection size which is a multiple of 4 and greater than or equal to 64 bytes is allowed.Usuall...
AMX Memory Manager K ADAK 129 Use Count When the Memory Manager allocates a block of memory for the use of a task, it sets theblock's use count to one. The block owner may call the Memory Manager procedure ajmau to increase the use count. If the use count is increased by one, the block will have to ...
130 K ADAK AMX Memory Manager 10.4 Private Memory Allocation A particularly unique feature of the Memory Manager permits any block of memory(including those acquired from the Memory Manager) to be treated as a memory sectionfrom which smaller private blocks can be dynamically allocated. To use this ...
AMX Memory Manager K ADAK 131 10.5 Memory Assignment The sections of memory which make up the memory pool controlled by the MemoryManager must be provided by your application. The Memory Manager makes noassumptions concerning the whereabouts of the memory over which it has control. Sections of memor...
132 K ADAK AMX Memory Manager 10.6 Memory Assignment Procedure An application Memory Assignment Procedure must be provided to dynamically assignmemory sections to the Memory Manager. The Memory Assignment Procedure is calledby the Memory Manager when AMX is started, prior to execution of any of your...
134 K ADAK AMX Memory Manager The Memory Assignment Procedure can be coded in assembler as a FAR procedure. USER_CODE SEGMENT BYTE 'CODE'; ASSUME CS:USER_CODE ; PUBLIC MEMPROC ;PARAM STRUC ;Define parameters on stack DW ? ;Save BP DD ? ;Return address MEMSIZEP DD ? ;A(storage for section size in byt...
AMX Circular List Manager K ADAK 135 11. AMX Circular List Manager 11.1 Circular Lists The AMX Circular List Manager provides a general circular list facility for use byapplication program modules. Circular lists must be located in alterable memory (RAM). A circular list is a data structure used by ...
136 K ADAK AMX Circular List Manager 11.2 Circular List Use A circular list is created by an application with a call to procedure ajrstl . The caller must provide three parameters: the number of slots in the list, the size of each slot (1, 2 or4 bytes) and a pointer to RAM storage for the circular l...
AMX Circular List Manager K ADAK 137 11.3 Circular List Structure Circular lists are application data structures which are only accessible by calls to theAMX Circular List Manager. The internal structure of the list is private to the CircularList Manager. Lists can be created dynamically or statical...
138 K ADAK AMX Circular List Manager The same lists can be coded in assembly language as follows: USER_DATA SEGMENT WORD 'DATA';; Circular Lists must be in program data;NSLOT EQU 64 ; EVEN ;Force word alignment BYTELIST LABEL WORD DW 4 DUP(?) ;Header DB NSLOT DUP(?) ;Slots ; EVEN ;Force word alignme...
AMX Linked List Manager K ADAK 139 12. AMX Linked List Manager 12.1 Introduction The Linked List Manager provides a general set of fast linked list services suitable foruse in real-time systems. The Linked List Manager removes the tedium and potential forserious error inherent in many applications i...
140 K ADAK AMX Linked List Manager 12.2 Linked Lists Terminology A list header is a structure provided by the application to be used to anchor a list. The list header is used to identify a list. The content of the list header is private to the LinkedList Manager. An object is an application data str...
142 K ADAK AMX Linked List Manager 12.3 Linked List Use A list consists of a list header and objects linked to the list header by list nodes (or keynodes). Storage for the list header must be provided by you. A pointer to the list headeracts as the list identifier. An empty list is created by callin...
AMX Linked List Manager K ADAK 143 The following example coded in C illustrates the use of the Linked List Manager. Anobject called uobject is defined with a key node at offset keynode in the object. An array of ten objects is provided. A keyed list keylist is created and the ten objects are added t...
Advanced Topics K ADAK 147 13. Advanced Topics 13.1 Fatal Exit There are a number of conditions which, if encountered by AMX, are considered to befatal. Any attempt by AMX to continue execution will lead to unpredictable results atbest. All of these conditions cause AMX to force a branch to its fata...
148 K ADAK Advanced Topics Fatal Exit Procedure AMX allows you to provide a Fatal Exit Procedure of your own by specifying the nameof your procedure in your System Configuration Module (see Chapter 14.5). Whenever AMX or your application forces a fatal exit, AMX checks to see if you haveprovided a F...
Advanced Topics K ADAK 149 Your Fatal Exit Procedure can be coded as a Large model C procedure as illustrated inthe following example. #include "amx831ec.h" /* AMX Error Code Definitions */ void cdecl fatalexit(int error) /* Fatal exit error code */ { :Inhibit all interrupt sourcesProvide an...
150 K ADAK Advanced Topics 13.2 User Error Procedure Most AMX procedures return error status to the caller. The error status is a signedinteger. AEREROK = 0 No error AERxxx > 0 Warning: possible fault AERxxx < 0 Error: may be unrecoverable The defined error codes are summarized in Appendix B. ...
152 K ADAK Advanced Topics 13.3 Task Scheduling Hooks AMX does not provide direct support for specific hardware extensions such as a mathcoprocessor or a memory management unit. Instead, AMX allows a set of applicationprocedures to be connected to its Task Scheduler. These procedures can save and re...
Advanced Topics K ADAK 153 13.4 Abnormal Task Termination A task is a procedure which is called by the AMX Task Scheduler. The task endsexecution normally by returning to AMX. AMX provides procedure ajend which can be used by a task to end execution and return to AMX under circumstances in which its...
154 K ADAK Advanced Topics Kill a Task A task can be killed. The task is first stopped as just described. All outstanding requeststo the task for its execution are purged. The effect is the same as if the task continued tomake calls to ajend to end its operation until finally there were no task exec...
Advanced Topics K ADAK 155 A Task Termination Procedure can be coded as a Large or Medium model C procedure asillustrated in the following example. The procedure receives an integer reason codeindicating whether the task is being stopped, killed or deleted. The mnemonics for thesereason codes are pr...
Advanced Topics K ADAK 157 Termination Processing AMX will only stop or kill a task which is running, waiting or ready to execute. A taskcan be deleted if it is in any of these states or idle. Occasionally, a request to terminate atask will occur while that task is performing some operation which AM...
Advanced Topics K ADAK 159 13.6 Breakpoint Manager The AMX Breakpoint Manager can be used to improve the operation of the debugger thatyou use to test your AMX system. Your use of the Breakpoint Manager is optional; use itonly if it augments your debugger as described below. If you enjoy the use of ...
160 K ADAK Advanced Topics Using the Breakpoint Manager The Breakpoint Manager is included in your application only if it is enabled in your UserParameter File. Use the AMX Configuration Builder to edit your User Parameter File(see Chapter 14.13). Enable the breakpoint support option in the Breakpoi...
Advanced Topics K ADAK 161 Interrupt Masking The Breakpoint Manager must be tailored to inhibit interrupts at breakpoints. Whichinterrupts are to be inhibited and how this is done is both system and hardwaredependent. When you include the Breakpoint Manager in your AMX system, module AA831BKA.OBJ is...
162 K ADAK Advanced Topics NMI Breakpoints Some hardware debuggers may use the non-maskable interrupt (NMI) to generatebreakpoints. The Breakpoint Manager can be tailored to support such debuggers byenabling its NMI handler. When an NMI interrupt is detected, the Breakpoint Manager calls the NMI han...
164 K ADAK AMX System Configuration 14.2 System Configuration Builder The AMX Configuration Builder is a software generation tool which can be used tocreate your AMX System Configuration Module. The Builder helps to reduce totalsystem implementation time by eliminating the manual generation process ...
AMX System Configuration K ADAK rev8 165 System DocumentationTemplate File AM831CG.CTD System ConfigurationTemplate File AM831CG.CT User Parameter File SYSCFG.UP Configuration Manager Enter/Edit/View AMX System Parameters Configuration Generator SYSCFG.ASM SYSCFG.TXT SystemConfigurationModuleFile Fi...
166 K ADAK AMX System Configuration 14.3 Using the Builder Starting the Builder The AMX Configuration Builder will operate on a PC or compatible running theMicrosoft ® Windows ® operating system. The Builder is delivered with the following files. File Purpose AM831CM .EXE AMX Configuration Manager (...
AMX System Configuration K ADAK 167 Screen Layout Figure 14.3-1 illustrates the Configuration Manager's screen layout. The title baridentifies the User Parameter File being created or edited. Below the title bar is the menubar from which the operations you wish the Manager to perform can be selected...
168 rev9 K ADAK AMX System Configuration Menus All commands to the Configuration Manager are available as items on the menus presenton the menu bar. The File menu provides the conventional New , Open , Save and Save As... commands for creating and editing your User Parameter File. It also provides t...
AMX System Configuration K ADAK 169 If you have modified some of the fields on a property page and then decide that thesemodified values are not correct, use the Undo Page command on the Edit menu or Toolbar to force the Configuration Manager to restore the content of all fields on the page to theva...
170 K ADAK AMX System Configuration 14.4 System Parameter Definition The System Parameter window allows you to define the general operating parameters ofyour AMX system. The layout of the window is shown in Figure 14.3-1 in Chapter 14.3. Kernel Options AMX Message Envelopes AMX passes a message to a...
AMX System Configuration K ADAK 171 AMX Interrupt Stack Size The AMX Interrupt Supervisor requires a minimum Interrupt Stack size of 128 bytes.The stack size must be a multiple of 4 bytes. In addition to this minimum, you must allocate sufficient stack to satisfy the applicationISP with the greatest...
172 K ADAK AMX System Configuration Timing Options Hardware Clock Frequency This parameter defines the frequency of the AMX hardware clock in hertz. It is used byAMX to convert milliseconds to equivalent AMX system ticks. If your hardware clockfrequency is not integral, round the clock frequency to ...
AMX System Configuration K ADAK 173 14.5 AMX Object Allocation The AMX Object Allocation window allows you to define the number of private AMXobjects required for each of the optional AMX managers to be included in your system.The layout of the window is shown below. Maximum Number of Tasks This par...
174 K ADAK AMX System Configuration Maximum Number of Semaphores This parameter defines the maximum number of resource and counting semaphoreswhich your system can support concurrently. If you do not require any semaphores, setthis parameter to 0. Otherwise, the parameter should be set to the number...
AMX System Configuration K ADAK 175 Memory Assignment Procedure Name If you use the AMX Memory Manager, you must provide a Memory AssignmentProcedure to assign memory sections to its memory pool for allocation to tasks (seeChapter 10.6). This parameter specifies the name of that procedure. If you ar...
AMX System Configuration K ADAK 177 Add, Edit and Delete Restart and Exit Procedures To add a new procedure, click on the Add button below the list. A new procedure named ---New--- will appear at the bottom of the list. Click on the name ---New--- and it will be opened ready for editing. Enter the n...
178 K ADAK AMX System Configuration 14.7 Task Definition The Task Definition window allows you to define the tasks to be automatically created byAMX at system startup. You do not have to predefine all of your tasks in this manner;you may also create tasks dynamically using ajtkcre . The layout of th...
180 K ADAK AMX System Configuration Medium Model Tasks can be either Large or Medium. If your task is Medium model, check this box.Otherwise, leave this box unchecked. If you declare the task to be Medium, the Builder will allocate the task's stack in asegment which is part of group DGROUP so that D...
AMX System Configuration K ADAK 181 14.8 Timer Definition The Timer Definition window allows you to define the timers to be automatically createdby AMX at system startup. You do not have to predefine all of your timers in thismanner; you may also create timers dynamically using ajtmcre . Note that A...
182 K ADAK AMX System Configuration Tag Each timer can have a unique 4-character timer tag. This parameter defines that tag.Although AMX does not restrict the content of the timer tag field, the ConfigurationManager only supports 4 ASCII characters as a tag. Id Variable This parameter defines the na...
AMX System Configuration K ADAK 183 14.9 Semaphore Definition The Semaphore Definition window allows you to define the semaphores to beautomatically created by AMX at system startup. You do not have to predefine all ofyour semaphores in this manner; you may also dynamically create resource semaphore...
184 K ADAK AMX System Configuration Tag Each semaphore can have a unique 4-character semaphore tag. This parameter definesthat tag. Although AMX does not restrict the content of the semaphore tag field, theConfiguration Manager only supports 4 ASCII characters as a tag. Id Variable This parameter de...
AMX System Configuration K ADAK 185 14.10 Event Group Definition The Event Group Definition window allows you to define the event groups to beautomatically created by AMX at system startup. You do not have to predefine all ofyour event groups in this manner; you may also create event groups dynamica...
AMX System Configuration K ADAK 187 14.11 Message Exchange Definition The Message Exchange Definition window allows you to define the message exchangesto be automatically created by AMX at system startup. You do not have to predefine allof your message exchanges in this manner; you may also create m...
188 K ADAK AMX System Configuration Tag Each message exchange can have a unique 4-character message exchange tag. Thisparameter defines that tag. Although AMX does not restrict the content of the messageexchange tag field, the Configuration Manager only supports 4 ASCII characters as a tag. Id Varia...
AMX System Configuration K ADAK 189 14.12 Buffer Pool Definition The Buffer Pool Definition window allows you to define the buffer pools to beautomatically created by AMX at system startup. You do not have to predefine all ofyour buffer pools in this manner; you may also create buffer pools dynamica...
190 K ADAK AMX System Configuration Tag Each buffer pool can have a unique 4-character buffer pool tag. This parameter definesthat tag. Although AMX does not restrict the content of the buffer pool tag field, theConfiguration Manager only supports 4 ASCII characters as a tag. Id Variable This parame...
AMX System Configuration K ADAK 191 14.13 Breakpoint Manager Definition The AMX Breakpoint Manager can be used to improve the operation of your debugger inthe AMX multitasking environment. Your use of the Breakpoint Manager is optional.The layout of the window is shown below. Include Breakpoint Mana...
194 K ADAK AMX Service Procedures 15.2 Summary of Services AMX provides a wide variety of services from which the real-time system designer canchoose. Many of the services are optional and, if not used, will not even be present inyour AMX system. The AMX managers are all optional. All of AMX and its...
AMX Service Procedures K ADAK 195 Task Control ajend AAEND End task execution ajgmsg AAGMSG Get the highest priority message availableOptionally get a message of a specific priority ajresum AARESUM Resume a suspended task ajsend AASEND Start a task by sending it a message at one of 4 priorities ajse...
196 K ADAK AMX Service Procedures Timing Control ajclk AACLK AMX Clock Handler ajtick AATICK Read elapsed system ticks ajtmcnv AATMCNV Convert milliseconds to system ticks ajtmcre AATMCRE Create an interval timer ajtmdel AATMDEL Delete an interval timer ajtmrd AATMRD Read an interval timer ajtmtag A...
AMX Service Procedures K ADAK 197 Message Exchange Manager ajmxcre AAMXCRE Create a message exchange ajmxdel AAMXDEL Delete a message exchange ajmxget AAMXGET Get a message from a message exchange (no wait) ajmxsnd AAMXSND Send message to a message exchange ajmxsndp ajmxtag AAMXTAG Find exchange id ...
AMX Service Procedures K ADAK 199 Processor and C Interface Procedures In addition to the services provided by AMX and its managers, the AMX Libraryincludes several C procedures of a general nature which simplify applicationprogramming in real-time systems on your target processor. ajcfjlong Long ju...
200 K ADAK AMX Service Procedures AMX 86 PC Supervisor Service Procedures In addition to the services provided by AMX and its managers, the AMX 86 PCSupervisor Library includes several C procedures which are of use only if the AMX 86PC Supervisor is used by your application. These procedures are doc...
AMX 86 Procedures K ADAK 201 16. AMX 86 Procedures 16.1 Introduction A description of every AMX Library procedure is provided in this chapter. Thedescriptions are ordered alphabetically for easy reference. Italics are used to distinguish programming examples. Procedure names and variable names which...
AMX 86 Procedures K ADAK 203 Assembly Language Programming If you are programming in assembly language, refer to Appendix E for a description ofthe AMX assembly language calling conventions. The appendix includes a summary ofthe input and output register specifications for every AMX procedure. Exper...
AMX 86 Procedures K ADAK 205 ajabl ajabl Purpose Add to Bottom of Circular List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup char item; /* one byte item */ int status; .. status = ajabl(&list, item);AX ES:BX CL,CX or DX:CX Where &list is a pointer to a ci...
206 K ADAK AMX 86 Procedures ajatl ajatl Purpose Add to Top of Circular List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup char item; /* one byte item */ int status; .. status = ajatl(&list, item);AX ES:BX CL,CX or DX:CX Where &list is a pointer to a circu...
208 K ADAK AMX 86 Procedures ajbcre ajbcre Purpose Create a Buffer Pool Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. AMXID poolid; struct amxbps pooldef;int status; .. status = ajbcre(&pooldef, &poolid);AX ES:BX DX= Where ...
AMX 86 Procedures K ADAK 209 Results Interrupts are disabled and then restored to their state at the time of thecall. Status is returned. AEROK = Call successful AERNFP = No free buffer pool AERNBF = No buffers defined in your pool definition AERBTS = Buffer size defined in your pool definition is t...
210 K ADAK AMX 86 Procedures ajbdel ajbdel Purpose Delete a Buffer Pool Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID poolid; int status; .. status = ajbdel(poolid);AX DX Where poolid is the pool id of the buffer pool to be deleted. Results Interrupts are di...
AMX 86 Procedures K ADAK 211 ajbfre ajbfre Purpose Free a Buffer Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup char *buffp; int status; .. status = ajbfre(buffp);AX ES:BX Where buffp is a pointer to a buffer obtained by an ajbget call. Results Interrupts are disab...
214 K ADAK AMX 86 Procedures ajbia ajbia Purpose Initialize (Reset) All Buffer Pools Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup int status; .. status = ajbia();AX Results Interrupts are disabled and then restored to their state at the time of thecall. Status is...
AMX 86 Procedures K ADAK 215 ajbip ajbip Purpose Initialize (Reset) One Buffer Pool Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID poolid; int status; .. status = ajbip(poolid);AX DX Where poolid is the pool id of the buffer pool to be initialized. Results In...
AMX 86 Procedures K ADAK 217 ajcfjlong ajcfjlong ajcfjset ajcfjset Purpose ajcfjset Sets a Mark for a Long Jumpajcfjlong Long Jumps to that Mark These procedures are provided for AMX portability. They are notreplacements for C library procedures longjmp or setjmp although they function in a similar ...
220 K ADAK AMX 86 Procedures ajclk ajclk Purpose AMX Clock Handler Used by o Task n ISP o Timer Procedure o Restart Procedure o Exit Procedure Setup Interrupts must be disabled. ajclk(); Results Interrupts may be enabled and/or disabled and will then be restored totheir state at the time of the call...
AMX 86 Procedures K ADAK 221 ajdi ajdi ajei ajei Purpose Disable or Enable Interrupts Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup ajdi();ajei(); Results Interrupts are disabled by ajdi() or enabled by ajei() . The interrupt enable flag ( IF ) in the processor st...
222 K ADAK AMX 86 Procedures ajend ajend Purpose End Execution of a Task Used by n Task o ISP o Timer Procedure o Restart Procedure o Exit Procedure Setup ajend(); Results There is no return from ajend . If any task is waiting for this task to finish processing its message, AMXwill automatically cal...
226 K ADAK AMX 86 Procedures ajevdel ajevdel Purpose Delete an Event Group Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID group; int status; .. status = ajevdel(group);AX BX Where group is the group id of an event group acquired with a call to ajevcre . Resul...
AMX 86 Procedures K ADAK 227 ajevnt ajevnt Purpose Get the Saved Event Flags Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup unsigned int value; .. value = ajevnt();AX Where value is the state of the 16 event flags at the time the calling task most recently complete...
228 K ADAK AMX 86 Procedures ajevrd ajevrd Purpose Read the Current Event States in an Event Group Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID group; unsigned int value;int status; .. status = ajevrd(group, &value);AX BX CX= Where group is the group id...
230 K ADAK AMX 86 Procedures ajevtag ajevtag Purpose Find an Event Group Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID group; char tag[4]; int status; .. status = ajevtag(&group, tag);AX BX= [DX:CX] see note Where &group is a pointer to storage for t...
AMX 86 Procedures K ADAK 231 ajevwat ajevwat Purpose Wait for Event(s) in an Event Group Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup AMXID group; unsigned int mask;unsigned int value;int match; long timeout; int status; .. status = ajevwat(group, mask, value, ma...
234 K ADAK AMX 86 Procedures ajfatl ajfatl Purpose Fatal Exit from AMX Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup int errcode; .. ajfatl(errcode); CX Where errcode is an error code which will be passed to your Fatal Exit Procedure if one was provided in your Us...
AMX 86 Procedures K ADAK 235 ajflagrd, ajflagrddi ajflagrd, ajflagrddi ajflagwr ajflagwr Purpose Read Processor FlagsRead Processor Flags and Disable InterruptsWrite Processor Flags Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup unsigned int flags; .. flags = ajfla...
236 K ADAK AMX 86 Procedures ajgmsg ajgmsg Purpose Get Message from Task Mailbox Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup int priority; char msg[AMXMSZ]; int status; .. status = ajgmsg(priority, msg);AX CX ES:BX Where priority is the priority of the task mail...
AMX 86 Procedures K ADAK 237 ajgofs ajgofs Purpose Get Pointer Offset Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup unsigned int ofs;char FAR *pntr; .. ofs = ajgofs(pntr); Results Interrupts are untouched. The 16-bit unsigned integer value of the offset part of th...
238 K ADAK AMX 86 Procedures ajgseg ajgseg Purpose Get Pointer Segment Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup unsigned short int seg;char FAR *pntr; .. seg = ajgseg(pntr); Results Interrupts are untouched. The 16-bit unsigned integer value of the segment se...
AMX 86 Procedures K ADAK 239 ajgsreg ajgsreg Purpose Get Segment Registers Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxsregs sregarray; .. ajgsreg(&sregarray); Where &sregarray is a pointer to storage to receive...
AMX 86 Procedures K ADAK 241 ajinb ajinb ajinw ajinw Purpose Read an 8-Bit Input Port (Byte)Read a 16-Bit Input Port (Word) Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup int portno; char portbyte; short int portword; .. portbyte = ajinb(portno); portword = ajinw(p...
242 K ADAK AMX 86 Procedures ajint ajint ajinx ajinx Purpose Begin Interrupt Service Used by o Task n ISP o Timer Procedure o Restart Procedure o Exit Procedure Setup ajint(); Results Interrupts are disabled. The AMX Interrupt Supervisor saves all registers on the caller's stack. If atask has just b...
244 K ADAK AMX 86 Procedures ajitrp ajitrp Purpose Install a Task Trap Handler Install a task trap handler to service divide error, overflow or bound checkerror traps. Used by n Task o ISP o Timer Procedure o Restart Procedure o Exit Procedure Setup int inttype; void handler(); int status; .. status...
AMX 86 Procedures K ADAK 245 ajivtr ajivtr Purpose Read an Interrupt Vector Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup int inttype; void (*oldproc)(); int status; .. status = ajivtr(inttype, &oldproc);AX DX ES:BX Where inttype is the 8086 interrupt type (0-...
246 K ADAK AMX 86 Procedures ajivtw ajivtw Purpose Write an Interrupt Vector Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup int inttype; void newproc(); int status; .. status = ajivtw(inttype, newproc);AX DX ES:BX Where inttype is the 8086 interrupt type (0-255). n...
AMX 86 Procedures K ADAK 247 ajivtx ajivtx Purpose Exchange an Interrupt Vector Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup int inttype; void (*oldproc)(); void newproc(); int status; .. status = ajivtx(inttype, newproc, &oldproc);AX DX ES:BX DS:DI Where int...
248 K ADAK AMX 86 Procedures ajlcre ajlcre Purpose Create an Empty List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;int offset; .. ajlcre(&list, offset); DS:SI CX Where &list is a pointer to the list he...
AMX 86 Procedures K ADAK 249 ajlhead ajlhead Purpose Find First Object on List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object; .. object = ajlhead(&list);ES:BX DS:SI Where &list is a ...
250 K ADAK AMX 86 Procedures ajlinsc ajlinsc Purpose Insert Object before Current Object on List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *newobj, *curobj; .. ajlinsc(&list, newobj, curobj)...
AMX 86 Procedures K ADAK 251 ajlinsh ajlinsh Purpose Insert Object at Head of List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object; .. ajlinsh(&list, object); DS:SI ES:BX Where &list i...
252 K ADAK AMX 86 Procedures ajlinsk ajlinsk Purpose Insert Object into Keyed List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object;unsigned int key; .. ajlinsk(&list, object, key); DS:SI E...
AMX 86 Procedures K ADAK 253 ajlinst ajlinst Purpose Insert Object at Tail of List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object; .. ajlinst(&list, object); DS:SI ES:BX Where &list i...
254 K ADAK AMX 86 Procedures ajlmerg ajlmerg Purpose Merge Two Lists Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs destlist, srclist;struct appobj *destobj, *srcobj; .. ajlmerg(&destlist, &srclist, destobj, sr...
AMX 86 Procedures K ADAK 255 Note Assembly language call is: PUSH <segment srcobj> PUSH <offset srcobj> PUSH <segment destobj> PUSH <offset destobj> PUSH <segment scrlist> PUSH <offset scrlist> PUSH <segment destlist> PUSH <offset destlist> CALL AALMER...
256 K ADAK AMX 86 Procedures ajlnext ajlnext Purpose Find Next Object on List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx83lsd.h" .. struct amxlhs list;struct appobj *object, *curobj; .. object = ajlnext(&list, curobj);ES:BX DS:SI ES:BX...
AMX 86 Procedures K ADAK 257 ajlordk ajlordk Purpose Reorder an Object in a Keyed List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object;unsigned int key; .. ajlordk(&list, object, key); DS:...
258 K ADAK AMX 86 Procedures ajlprev ajlprev Purpose Find Previous Object on List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object, *curobj; .. object = ajlprev(&list, curobj);ES:BX DS:SI E...
AMX 86 Procedures K ADAK 259 ajlrmvc ajlrmvc Purpose Remove Object from List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object; .. ajlrmvc(&list, object); DS:SI ES:BX Where &list is a po...
260 K ADAK AMX 86 Procedures ajlrmvh ajlrmvh Purpose Remove Object from Head of List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object; .. object = ajlrmvh(&list);ES:BX DS:SI Where &list...
AMX 86 Procedures K ADAK 261 ajlrmvt ajlrmvt Purpose Remove Object from Tail of List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object; .. object = ajlrmvt(&list);ES:BX DS:SI Where &list...
262 K ADAK AMX 86 Procedures ajltail ajltail Purpose Find Last Object on List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxlhs list;struct appobj *object; .. object = ajltail(&list);ES:BX DS:SI Where &list is a p...
264 K ADAK AMX 86 Procedures ajmfre ajmfre Purpose Free Previously Allocated Block Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup char *blockp; int status; .. status = ajmfre(blockp);AX ES:BX Where blockp is a pointer to a memory block allocated by ajmget or ajmgeh...
AMX 86 Procedures K ADAK 265 ajmgeh ajmgeh Purpose Get a Memory Block Using a Memory Handle Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup long size; char *blockp; long memsize; char *handle; int status; .. status = ajmgeh(size, &blockp, &memsize, handle);A...
AMX 86 Procedures K ADAK 269 ajmodl ajmodl Purpose Get the DGROUP Segment Value Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup ajmodl(); Results Interrupts are untouched. The data segment register DS is set to the base segment of group DGROUP . This procedure is pr...
270 K ADAK AMX 86 Procedures ajmset ajmset Purpose Set (Fill) Memory Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup char *mempntr; long memsize; unsigned short int pattern;int status; .. status = ajmset(mempntr, memsize, pattern);AX ES:BX DX:CX SI Where mempntr is ...
272 K ADAK AMX 86 Procedures ajmxdel ajmxdel Purpose Delete a Message Exchange Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID exchange; int status; .. status = ajmxdel(exchange);AX BX Where exchange is the exchange id of the message exchange to be deleted. Re...
AMX 86 Procedures K ADAK 275 ajmxsndp ajmxsndp Purpose Send Message to a Message Exchange Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID exchange; int priority; int status; int parm1; int parm2; .. status = ajmxsndp(exchange, priority, parm1, parm2...);AX AAM...
276 K ADAK AMX 86 Procedures ajmxtag ajmxtag Purpose Find a Message Exchange Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID exchange; char tag[4]; int status; .. status = ajmxtag(&exchange, tag);AX BX= [DX:CX] see note Where &exchange is a pointer to ...
278 K ADAK AMX 86 Procedures ajoutb ajoutb ajoutw ajoutw Purpose Write to an 8-Bit Output Port (Byte)Write to a 16-Bit Output Port (Word) Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup int portno; char portbyte; short int portword; .. ajoutb(portno, portbyte);ajout...
AMX 86 Procedures K ADAK 279 ajproc ajproc ajprocq ajprocq Purpose Call Software Procedure You can use this procedure to call any software procedure which, becauseof register setup requirements, cannot otherwise be called from C. Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Proc...
AMX 86 Procedures K ADAK 281 ajprvl ajprvl Purpose Lower Task Privilege Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup ajprvl(); Results Interrupts are disabled and then restored to their state at the time of thecall. Restrictions Must follow every call to ajprvr ....
282 K ADAK AMX 86 Procedures ajprvr ajprvr Purpose Raise Task Privilege Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup ajprvr(); Results Interrupts are disabled and then restored to their state at the time of thecall. Restrictions Must be followed by a call to ajpr...
AMX 86 Procedures K ADAK 283 ajrbl ajrbl Purpose Remove from Bottom of Circular List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup char item; /* one byte item */ int status; .. status = ajrbl(&list, &item); AX ES:BX CL=, CX= or DX:CX= Where &list is a ...
284 K ADAK AMX 86 Procedures ajresum ajresum Purpose Resume a Suspended Task Resume a task known to be suspended as a result of an ajsusp call. Used by n Task n ISP n Timer Procedure o Restart Procedure n Exit Procedure Setup AMXID taskid; int status; .. status = ajresum(taskid);AX DX Where taskid i...
AMX 86 Procedures K ADAK 285 ajrstl ajrstl Purpose Initialize (Reset) a Circular List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup /* define type of slots */ typedef char SLOT1; /* byte slot */ typedef short int SLOT2; /* word slot */ typedef long SLOT4; /* doubl...
286 K ADAK AMX 86 Procedures ajrtl ajrtl Purpose Remove from Top of Circular List Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup char item; /* one byte item */ int status; .. status = ajrtl(&list, &item);AX BX CL=, CX= or DX:CX= Where &list is a pointer...
288 K ADAK AMX 86 Procedures ajsendp ajsendp Purpose Send a Message to a Task Mailbox To request AMX to send a message to a task at a given priority and tobegin execution of that task as soon as possible. Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID taskid;...
AMX 86 Procedures K ADAK 289 ajsenw ajsenw Purpose Send a Message to a Task Mailbox (Wait for Ack) To request AMX to send a message to a task at a given priority and tobegin execution of that task as soon as possible. The task making therequest is placed into the wait state until either: 1. the call...
AMX 86 Procedures K ADAK 291 ajsenwp ajsenwp Purpose Send a Message to a Task Mailbox (Wait for Ack) To request AMX to send a message to a task at a given priority and tobegin execution of that task as soon as possible. The task making the request is placed into the wait state until either: 1. the c...
AMX 86 Procedures K ADAK 293 ajsgnl ajsgnl Purpose Signal a Task Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID taskid; unsigned int tsignals;unsigned long siginfo;int status; .. status = ajsgnl(taskid, tsignals, &siginfo); AX DX BX[14..0] BX:CX= BX[15]=0...
AMX 86 Procedures K ADAK 295 ajsgrd ajsgrd Purpose Read Pending Task Signals Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup unsigned int tsignals; .. tsignals = ajsgrd();AX Where tsignals is the current state of the calling task's task signals. Results Interrupts a...
296 K ADAK AMX 86 Procedures ajsgres ajsgres Purpose Reset Pending Task Signals Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup unsigned int tsignals; .. ajsgres(tsignals); BX[14..0]BX[15]=0 Where tsignals is a 15-bit mask identifying the task signals to be reset. O...
AMX 86 Procedures K ADAK 297 ajsgwat ajsgwat Purpose Wait for Task Signal(s) Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup unsigned int tsignals;long timeout; int match; int status; unsigned int sigrecv; .. status = ajsgwat(tsignals, match, timeout, &sigrecv);...
AMX 86 Procedures K ADAK 299 ajsint ajsint ajsintq ajsintq Purpose Generate Software Interrupt Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxregs regarray;int inttype; unsigned int regeax: .. regeax = ajsint(inttype, &...
302 K ADAK AMX 86 Procedures ajsmdel ajsmdel Purpose Delete a Semaphore Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID semid; int status; .. status = ajsmdel(semid);AX BX Where semid is the semaphore id of a resource or counting semaphore acquired by a call t...
AMX 86 Procedures K ADAK 303 ajsmfre ajsmfre Purpose Unconditionally Free a Resource Semaphore Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup AMXID semid; int status; .. status = ajsmfre(semid);AX BX Where semid is the semaphore id of a resource semaphore acquired ...
304 K ADAK AMX 86 Procedures ajsmget ajsmget Purpose Get Use of a Semaphore (no wait) Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID semid; int status; . . status = ajsmget(semid);AX BX Where semid is the semaphore id of a counting semaphore acquired by a cal...
AMX 86 Procedures K ADAK 305 ajsmrls ajsmrls Purpose Release a Resource Semaphore Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup AMXID semid; int status; .. status = ajsmrls(semid); /* nested release */ AX BX Where semid is the semaphore id of a resource semaphore ...
308 K ADAK AMX 86 Procedures ajsmsig ajsmsig Purpose Signal a Semaphore Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID semid; int status; .. status = ajsmsig(semid);AX BX Where semid is the semaphore id of a counting semaphore acquired by a call to ajsmcre . ...
310 K ADAK AMX 86 Procedures ajsmwat ajsmwat Purpose Wait on a Semaphore Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup AMXID semid; long timeout; unsigned int priority;int status; .. status = ajsmwat(semid, timeout, priority);AX BX DX:CX DI Where semid is the sema...
AMX 86 Procedures K ADAK 311 ajsofs ajsofs Purpose Set Pointer Offset Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup unsigned int ofs;char FAR *pntr; .. ajsofs(&pntr, ofs); Results Interrupts are untouched. The offset part of the FAR pointer variable pntr is se...
312 K ADAK AMX 86 Procedures ajsseg ajsseg Purpose Set Pointer Segment Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup unsigned short int seg;char FAR *pntr; .. ajsseg(&pntr, seg); Results Interrupts are untouched. The segment selector part of the FAR pointer va...
314 K ADAK AMX 86 Procedures ajsusp ajsusp Purpose Suspend a Task Used by n Task o ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID taskid; int status; .. status = ajsusp(taskid);AX DX Where taskid is the task id of the task to be suspended. Results Interrupts are disabled and ...
AMX 86 Procedures K ADAK 315 ajtdf ajtdf Purpose Format Time and Date as an ASCII String Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxtds tdbuf;char ascii[26]; int format; int n; .. n = ajtdf(&tdbuf, format, ascii);A...
316 K ADAK AMX 86 Procedures ajtdg ajtdg Purpose Get Current Time and Date Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxtds tdbuf; .. ajtdg(&tdbuf); ES:BX Where &tdbuf is a pointer to the structure which is to re...
AMX 86 Procedures K ADAK 317 ajtds ajtds Purpose Set the Time and Date Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxtds tdbuf; .. Initialize tdbuf with new time and date. .. ajtds(&tdbuf); ES:BX Where &tdbuf is a...
318 K ADAK AMX 86 Procedures ajtick ajtick Purpose Read System Tick Counter Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup unsigned long tickcnt; .. tickcnt = ajtick();DX:AX Results Interrupts are untouched. tickcnt is the current value of the AMX system tick count...
320 K ADAK AMX 86 Procedures ajtkdel ajtkdel Purpose Delete a Task This procedure removes a task from your AMX system. Its task id will nolonger be valid. Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup AMXID taskid; int priority; int status; .. status = ajtkdel(tas...
AMX 86 Procedures K ADAK 321 ajtkid ajtkid Purpose Get Task Id of Current Task Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup AMXID taskid; .. taskid = ajtkid();AX Where taskid is the task id of the currently executing task. Results Interrupts are untouched. See Al...
322 K ADAK AMX 86 Procedures ajtkill ajtkill Purpose Kill a Task This procedure will force a ready, executing or suspended task to end. Allmessages in the task's mailboxes at the time of the kill request will beflushed. All requests for task execution pending at the time of the killrequest will be e...
AMX 86 Procedures K ADAK 323 ajtkpry ajtkpry Purpose Change Task Priority Used by n Task o ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID taskid; int priority; int status; .. status = ajtkpry(taskid, priority);AX DX CX Where taskid is the task id of the task whose priority is...
324 K ADAK AMX 86 Procedures ajtkstp ajtkstp Purpose Stop Execution of Task This procedure will force a ready, executing or suspended task to end. Used by n Task n ISP n Timer Procedure o Restart Procedure n Exit Procedure Setup AMXID taskid; int status; .. status = ajtkstp(taskid);AX DX Where taski...
AMX 86 Procedures K ADAK 325 ajtksts ajtksts Purpose Get Status of a Task Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxsbs tasksts;AMXID taskid; int status; .. status = ajtksts(taskid, &tasksts);AX DX ES:BX Where tas...
326 K ADAK AMX 86 Procedures ajtktag ajtktag Purpose Find a Task Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup char tag[4]; AMXID taskid; int status; .. status = ajtktag(&taskid, tag);AX DX= [CX:DX] see note Where &taskid is a pointer to storage for the ta...
AMX 86 Procedures K ADAK 329 ajtmcnv ajtmcnv Purpose Convert Milliseconds to System Ticks Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup unsigned long ms;long ntick; .. ntick = ajtmcnv(ms);DX:CX DX:CX Where ms is the number of milliseconds. ntick is the equivalent ...
AMX 86 Procedures K ADAK 331 ajtmdel ajtmdel Purpose Delete an Interval Timer Used by n Task o ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID timerid; .. status = ajtmdel(timerid);AX DX Where timerid is the timer id identifying the timer to be deleted. Results Interrupts are ...
332 K ADAK AMX 86 Procedures ajtmrd ajtmrd Purpose Read the Current Value of an Interval Timer Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID timerid; long tval; .. tval = ajtmrd(timerid);DX:CX DX Where timerid is the timer id identifying the timer whose valu...
AMX 86 Procedures K ADAK 333 ajtmtag ajtmtag Purpose Find an Interval Timer Used by n Task o ISP o Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID timerid; char tag[4]; int status; .. status = ajtmtag(&timerid, tag);AX DX= [DX:CX] see note Where &timerid is a pointer to stor...
AMX 86 Procedures K ADAK 335 ajtrig ajtrig Purpose Trigger a Task To request AMX to start a task without sending a message to the task. Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID taskid; int status; .. status = ajtrig(taskid);AX DX Where taskid is the tas...
336 K ADAK AMX 86 Procedures ajtslv ajtslv Purpose Change a Task's Time Slice Interval Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup AMXID taskid; unsigned int tslice;int status; .. status = ajtslv(taskid, tslice);AX DX CX Where taskid is the task id of the task w...
338 K ADAK AMX 86 Procedures ajupt ajupt Purpose Fetch Pointer to User Parameter Table Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup #include "amx831sd.h" .. struct amxupts FAR *uptp; /* User Parameter Table pointer */ .. ajupt(&uptp); Where &uptp ...
AMX 86 Procedures K ADAK 339 ajver ajver Purpose Get AMX Version Number Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup unsigned long version; .. version = ajver();DX:AX Where version is the AMX version number in the hexadecimal format 0x0086rrmm where rr is the maj...
AMX 86 Procedures K ADAK 341 ajwakc ajwakc Purpose Wake Calling Task (Acknowledge Receipt of Message) To allow the current task to wake up the task which sent the messagewhich is being processed by the current task. Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup in...
342 K ADAK AMX 86 Procedures ajwakcs ajwakcs Purpose Wake Calling Task (Acknowledge Receipt of Message with Status) To allow the current task to wake up the task which sent the messagewhich is being processed by the current task and return completion statusto that task. Used by n Task o ISP o Timer ...
344 K ADAK AMX 86 Procedures ajwapr ajwapr Purpose Reset a Pending Wake Request This call only affects the calling task. Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup ajwapr(); Results Interrupts are untouched. Note This procedure provides a simplified form of tas...
AMX 86 Procedures K ADAK 345 ajwatm ajwatm Purpose Task Delay or Timed Wait for a Wake Request Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup long tval; int status; .. status = ajwatm(tval);AX DX:CX Where tval is the required wait interval or delay period measured ...
AMX 86 Reserved Words K ADAK 347 A. AMX 86 Reserved Words ajpppppp AMX C procedure name pppppp AAPPPPPP AMX assembly language procedure name PPPPPP amxttttt AMX C structure name of type ttttt AMXID AMX object identifier (handle) cdecl Procedures use C parameter passing conventions AMssssss Reserved ...
AMX 86 Error Codes K ADAK 349 B. AMX 86 Error Codes AMX error codes are signed integers. Codes less than zero are error codes. Codesgreater than zero are warning codes. To assist you during testing, the hexadecimal valueof the least significant 16-bits of the error code is listed as it might appear ...
AMX 86 Error Codes K ADAK 351 AMX 86 Fatal Exit Codes Mnemonic Value Value Meaning (dec) (hex) AERFX1 ● 1 0x0001 Not enough memory in AMX Data Segment AERFX2 ● 2 0x0002 Divide, overflow, bound error in ISP AERFX3 ● 3 0x0003 Divide, overflow, bound error occurred:in a Restart Procedure orin a Timer P...
Generator Specifications K ADAK 353 C. Configuration Generator Specifications C.1 Introduction If you are not doing your software development on a PC or compatible runningMicrosoft ® Windows ® , then you will be unable to use the interactive Configuration Manager for Windows to create and edit your ...
354 K ADAK Generator Specifications C.2 User Parameter File Specification The User Parameter File is a text file structured as illustrated in Figure C.2-1. The fileconsists of a sequence of keywords of the form ...XXX which begin in column one. Each keyword is followed by one or more parameters whic...
Generator Specifications K ADAK 355 The example in Figure C.2-1 uses symbolic names for all of the parameters followingeach of the keywords. The symbols correspond to the screen fields described in Chapter14. You are referred to that chapter for detailed descriptions of each of the parameters. The o...
356 K ADAK Generator Specifications Each of your predefined tasks must be defined using keyword ...TDT . The order of these definitions will determine their order of creation by AMX. If you do not wish topredefine any tasks, delete the line with keyword ...TDT. The parameters in each task definition...
Generator Specifications K ADAK 357 Each of your predefined semaphores must be defined using the keyword ...SEM . The order of these definitions will determine their order of creation by AMX. If you do notwish to predefine any semaphores, delete the line with keyword ...SEM . The parameters in each ...
358 K ADAK Generator Specifications Each of your predefined message exchanges must be defined using the keyword ...MEX . The order of these definitions will determine their order of creation by AMX. If you donot wish to predefine any message exchanges, delete the line with keyword ...MEX . The param...
Generator Specifications K ADAK 359 C.3 System Configuration Template The System Configuration Template is an assembly language source file which defines aSystem Configuration Module for any system using AMX and its managers. It isrecommended that you list file AM831CG.CT and examine it carefully be...
Generator Specifications K ADAK 361 The first statement in this example is a directive defining an incremental variable named &TN . Both its initial value and increment are 1. Note that this directive begins with the assembler comment character ( ; ) and the parameter delimiter character ( ~ in ...
362 K ADAK Generator Specifications C.4 Porting the Configuration Generator The Configuration Manager uses the Configuration Generator to generate your SystemConfiguration Module. If you are not doing your development on a PC or compatible,you may wish to port the Configuration Generator to your dev...
Structure/Constant Definitions K ADAK 365 D. AMX 86 Structure and Constant Definitions D.1 AMX C Structures and Constants AMX Launch Parameter (see AAENTR ) #define AMLPTMP 1 /* Temporary launch */ /* Default is permanent launch */ #define AMLPVA 2 /* Vector table is alterable */ /* Default is non a...
366 K ADAK Structure/Constant Definitions AMX Task Status Block Structure struct amxsbs { AMXID amsbtid; /* task id */ char amsbtag1; /* task tag */ char amsbtag2; char amsbtag3; char amsbtag4; unsigned long amsbst; /* task status */ unsigned long amsbsig; /* pending signals */ long amsbtmr; /* task...
Structure/Constant Definitions K ADAK 367 AMX Extended Message Parameter Structure (passed on stack above AMX message when starting a task) struct amxmsgxs { AMXID amxmscid; /* calling task's id */ short int amxmsfn; /* AMX function code */ /* (see definitions) */ short int amxmsrsv[4]; /* reserved ...
368 K ADAK Structure/Constant Definitions AMX User Parameter Table Structure struct amxupts { void (**ampbrpl)(); /* A(Restart Procedure List) */ void (**ampbepl)(); /* A(Exit Procedure List) */ long ampbcfga; /* Configuration attributes */ short int ampbdgrp; /* user's DGROUP segment selector */ sh...
Structure/Constant Definitions K ADAK 369 Configuration Attributes (field AMPBCFGA ) #define AMCAMTK 1 /* Some Medium tasks */ #define AMCAMUP 2 /* Some Medium user procedures */ #define AMCAS24 4 /* Use 24-bit address space */ AMX Time/Date Structure struct amxtds { unsigned char amtdsec; /* second...
370 K ADAK Structure/Constant Definitions AMX List Header Structure (doubly linked lists) struct amxlhs { struct amxlhs *amlhhead; /* list head */ struct amxlhs *amlhtail; /* list tail */ unsigned int amlhoffs; /* byte offset to object node */ }; AMX List Node Structure struct amxlns { struct amxlns...
Structure/Constant Definitions K ADAK 371 AMX Register Array Structure struct amxregs { unsigned short int amxrf; /* Flags (LS byte only) */ unsigned short int amxrax; /* Register AX */ unsigned short int amxrbx; /* Register BX */ unsigned short int amxrcx; /* Register CX */ unsigned short int amxrd...
372 K ADAK Structure/Constant Definitions AMX C Jump Buffer Structure struct ajxjbuf { unsigned short int xjbretadr; /* ofs(return address) */ unsigned short int xjbcs; /* Register CS */ unsigned short int xjbsp; /* Stack pointer offset */ unsigned short int xjbss; /* Stack pointer segment */ unsign...
Structure/Constant Definitions K ADAK 373 D.2 AMX Assembler Structures and Constants AMX Launch Parameter (see AAENTR ) AMLPTMP EQU 1 ;Temporary launch ; ;Default is permanent launch ;AMLPVA EQU 2 ;Vector table is alterable ; ;Default is non alterable table ;AMLPIE EQU 4 ;Launch with interrupts enab...
AMX 86 Assembler Interface K ADAK 381 E. AMX 86 Assembler Interface This appendix summarizes the assembly language calling sequences for all AMXprocedures. The procedures are organized in functional groups. Within each group theprocedures are listed alphabetically. All procedures are called as follo...
Index K ADAK Index-1 Numerals 24-bit memory addressing 1, 125, 171 A AACLK 73 AAENTR 22AAINT 54, 55, 56, 73AAINX 55, 56, 73 ajabl 135, 205 ajatl 135, 206 ajbau 52, 119, 121, 207 ajbcre 119, 120, 174, 189, 208 ajbdel 119, 121, 210 ajbfre 52, 76, 119, 121, 211 ajbget 52, 76, 119, 121, 212 ajbgsz 119, ...
AMX Manuals
-
AMX Mio Attach
Manual
-
AMX AVS-PL-0404-615
Manual
-
AMX CSG-500
Manual
-
AMX AXB-MIDI
Manual
-
AMX NXA-UPS1500EPM
Manual
-
AMX AVS-PL-0404-844
Manual
- AMX MVP-7500/8400 Manual
-
AMX MAX-AVM
Manual
-
AMX NXC-ME260
Manual
- AMX NI-2100/3100/4100 Manual
-
AMX NXA-KLB
Manual
-
AMX MAX-MMS400
Manual
-
AMX RDA-ENC8W
Manual
-
AMX NXA-PCI80211G
Manual
- AMX NXD-700Vi Manual
-
AMX UDM-1604
Manual
-
AMX DAS-KP-LCDS-W
Manual
-
AMX TVM-1600
Manual
-
AMX RDA-ENC12B
Manual
-
AMX NXA-WAP200G
Manual