Difference between revisions of "AGI/Specifications/Resources"

Jump to navigation Jump to search
→‎How the interpreter handles the code: -- fix syntax highlighting
(→‎Logic resource format: -- Table wikification)
(→‎How the interpreter handles the code: -- fix syntax highlighting)
 
(4 intermediate revisions by the same user not shown)
Line 52: Line 52:


<span id="test-commands"></span>
<span id="test-commands"></span>
{| border="1"
{| border="1"  cellspacing="0" cellpadding="5"
|+ '''Table 6-1: Test commands'''
|+ '''Table 6-1: Test commands'''
|-  
|-  
Line 229: Line 229:
<span id="action-commands"></span>
<span id="action-commands"></span>


{|  border="1"
{|  border="1"  cellspacing="0" cellpadding="5"
|+ '''Table 6-2: Action Commands'''
|+ '''Table 6-2: Action Commands'''
|-  
|-  
Line 2,267: Line 2,267:
discussed at a later stage.
discussed at a later stage.


{| border="1"
{| border="1"  cellspacing="0" cellpadding="5"
|-  
|-  
! Offset
! Offset
Line 2,301: Line 2,301:
between one and seven arguments inclusive. This is discussed later on.
between one and seven arguments inclusive. This is discussed later on.
The first set of codes is the AGI commands themselves listed in
The first set of codes is the AGI commands themselves listed in
<xref linkend="tab-action-commands">, and they have the range 0x00--0xB6.
[[AGI/Specifications/Resources#action-commands|  Table 6-2]], and they have the range 0x00--0xB6.


The second set of codes is as follows:
The second set of codes is as follows:


{| border="1"
{| border="1" cellspacing="0" cellpadding="5"
|-
! Code
! Code
! Command
! Command
Line 2,343: Line 2,342:
which tests whether flag number 5 is set. The 0xFF effectively switches
which tests whether flag number 5 is set. The 0xFF effectively switches
the interpreter into a condition checking mode which leads us to the
the interpreter into a condition checking mode which leads us to the
set of codes listed in <xref linkend="tab-test-commands">
set of codes listed in [[AGI/Specifications/Resources#test-commands|  Table 6-1]]


  0x00 - 0x12    Condition codes.
  0x00 - 0x12    Condition codes.
Line 2,446: Line 2,445:
follows:
follows:


{| border="1"
{| border="1"  cellspacing="0" cellpadding="5"
|-  
|-  
! Offset
! Offset
Line 2,497: Line 2,496:
The format of the message section is as follows:
The format of the message section is as follows:


{| border="1"
{| border="1"  cellspacing="0" cellpadding="5"
|-  
|-  
! Offset
! Offset
Line 2,526: Line 2,525:
Example: MH2, equaln.
Example: MH2, equaln.


<syntax type="ASM (x86)">
<syntax type="ASM">
;equaln  (eg.  if (work = 3)  )
;equaln  (eg.  if (work = 3)  )
0D71 AC            LODSB                      ;get variable number
0D71 AC            LODSB                      ;get variable number
Line 2,541: Line 2,540:
Example: MH2, equalv.
Example: MH2, equalv.


<syntax type="ASM (x86)">
<syntax type="ASM">
;equalv  (eg.  if (work = maxwork)  )
;equalv  (eg.  if (work = maxwork)  )
0D82 AC            LODSB                      ;get first var number
0D82 AC            LODSB                      ;get first var number
Line 2,569: Line 2,568:
on, I'll explain the interpretation in steps after the code block.
on, I'll explain the interpretation in steps after the code block.


<syntax type="ASM (x86)">
<syntax type="ASM">
;Decoding a LOGIC file.
;Decoding a LOGIC file.
1E6C:2EF2 56            PUSH  SI
1E6C:2EF2 56            PUSH  SI
Line 2,694: Line 2,693:
treating each test separately and calling the relevant test command
treating each test separately and calling the relevant test command
routines using the jump table in the <tt>agidata.ovl</tt> file.
routines using the jump table in the <tt>agidata.ovl</tt> file.
Each test command routine will return a value in <literal/AL/ which
Each test command routine will return a value in <tt>AL</tt> which
says whether it is true or not. Depending on the NOTs and ORs, the
says whether it is true or not. Depending on the NOTs and ORs, the
whole expression is evaluated. If at any stage during the evaluation
whole expression is evaluated. If at any stage during the evaluation

Navigation menu