1 ;;STRUC--Stucture Macro Library
2 ;;Optimizing Version 2.30 03/31/87
30 $OtherwiseType equ $ElseType
32 $StrucError macro text
33 Structure error -- text
41 $BuildJump macro j1,j2
48 irp x,<<jeq,je>,<jlt,jl>,<jgt,jg>,<jneq,jne>,<jnlt,jnl>,<jngt,jng>,<jnpe,jpo>,<jnpo,jpe>>
51 irp x,<<jzero,jz>,<jnzero,jnz>,<jnonzero,jnz>,<jnnonzero,jz>,<jand,jnz>,<jnand,jz>,<jnnand,jnz>>
54 irp x,<a,ae,b,be,c,e,g,ge,l,le,o,p,s,z,cxz>
59 if $Dist eq $NearToShort
87 irp x,<short,SHORT,near,NEAR>
117 $StrucError <open structure>
121 $EquateLabel macro last,this
122 if $LastLabelOrg eq $
128 $TraceLabel macro n,a,b
133 $TraceLabel n,%$ll&a,%$ll&b
139 $EquateLabel %$LastLabel,n
155 $CondJump macro l,tf,c
158 $EquateLabel %$LastLabel,l
165 $TraceLabel l,l,%$ll&l
167 $CondJump2 %$ll&l,tf,c
170 $CondJump2 macro l,tf,c
184 if (($ - $l&l) le 126) and (($l&l - $) le 129)
236 if (($ - $l&l) le 126) and (($l&l - $) le 129)
255 $Test macro tgt,a1,a2,a3,a4,x
257 $StrucError <invalid condition>
267 $StrucError <invalid condition>
283 $StrucError <invalid condition>
290 $StrucError <invalid condition>
298 $TopTest macro args,n,c,p4,p5
319 ;;*****************************************************************************
322 if $Temp eq $ConjIfType
333 $TopTest <t>,$IfType,$ConjIfType,p2,p3
335 ;;*****************************************************************************
339 if $Temp ne $WhenType
340 $StrucError <then without if or when>
344 ;;*****************************************************************************
345 .elseif macro t,p2,p3
348 $StrucError <elseif without if>
361 $TopTest <t>,$IfType,$ConjIfType,p2,p3
363 ;;*****************************************************************************
367 if $Temp ne $WhenType
368 if $Temp ne $SelectType
369 $StrucError <else without if, when or select>
375 if $Temp eq $SelectType
387 ;;*****************************************************************************
391 if $Temp ne $ElseType
392 $StrucError <endif without if>
401 ;;*****************************************************************************
408 ;;*****************************************************************************
409 .when macro tst,p2,p3
411 if $Temp ne $SelectType
412 if $Temp ne $WhenType
413 if $Temp ne $ConjWhenType
414 $StrucError <when without select>
419 if $Temp ne $ConjWhenType
422 if $Temp eq $WhenType
433 $TopTest <tst>,$WhenType,$ConjWhenType,p2,p3
435 ;;*****************************************************************************
436 .otherwise macro dist
438 if $Temp ne $WhenType
439 if $Temp ne $SelectType
441 $StrucError <otherwise without if, when or select>
447 if $Temp eq $SelectType
459 ;;*****************************************************************************
462 if $Temp ne $WhenType
463 if $Temp ne $OtherwiseType
464 if $Temp ne $SelectType
465 $StrucError <endselect without select>
471 if $Temp ne $SelectType
477 ;;*****************************************************************************
480 if $Temp eq $ConjWhileType
492 $TopTest <t>,$WhileType,$ConjWhileType,p2,p3
494 ;;*****************************************************************************
497 if $Temp ne $WhileType
498 $StrucError <endwhile without while>
503 $CondJump %$Temp,NoFold
507 ;;*****************************************************************************
519 ;;*****************************************************************************
523 $until2 macro p2,p3,a1,a2,a3,a4,x
525 if $Temp ne $RepeatType
526 if $Temp ne $ConjUntilType
527 $StrucError <until without repeat>
541 $CondJump %$Temp,NoFold
543 $Test <$Temp,f>,<a1>,<a2>,<a3>,<a4>,<x>
545 if $OrFound or $LeaveFound
553 $Test <$Temp,f>,<a1>,<a2>,<a3>,<a4>,<x>
556 $Test <$Temp+1,t>,<a1>,<a2>,<a3>,<a4>,<x>
561 ;;*****************************************************************************
564 if $Temp ne $RepeatType
565 $StrucError <loop without repeat>
569 $CondLoop %$Temp,cond
576 ;;*****************************************************************************
577 .for macro index,equals,start,to,stop,by,step,dist
602 ;;*****************************************************************************
603 .next macro index,dist
606 $StrucError <next without for>
621 $CondJump %$Temp,NoFold
625 ;;*****************************************************************************
629 $leave2 macro p2,p3,a1,a2,a3,a4,x
631 $StrucError <leave outside a loop>
636 if $Temp eq $ConjLeaveType
655 $CondJump %$LoopEnd,t
657 $Test <$LoopEnd,t>,<a1>,<a2>,<a3>,<a4>,<x>
665 $Test <$sn,f>,<a1>,<a2>,<a3>,<a4>,<x>
667 $Test <$LoopEnd,t>,<a1>,<a2>,<a3>,<a4>,<x>
673 ;;*****************************************************************************
676 ;;if $Temp ne $NoType
678 $StrucError <open structure(s)>
680 .xcref $NoConj,$And,$Or,$Short,$Near,$NearToShort,$AndOr,$Temp,$Temp2,$Dist
681 .xcref $NoType,$ConjIfType,$IfType,$ElseType,$WhileType,$ConjWhileType
682 .xcref $RepeatType,$ConjUntilType,$ForType,$ConjLeaveType,jncxz
683 .xcref $SelectType,$WhenType,$OtherwiseType,$ConjWhenType
684 .xcref jeq,jgt,jlt,jneq,jngt,jnlt,jnna,jnnae,jnnb,jnnbe,jnnc,jnncxz
685 .xcref jnne,jnng,jnnge,jnnl,jnnle,jnno,jnnp,jnns,jnnz,jnpe,jnpo,$BuildJump
686 .xcref $GetConj,$GetDist,$Poke,$Peek,$Push,$Pop,$Label,$CondJump,$CondLoop,$Test
687 .xcref $TopTest,$leave2,$until2,$StrucError,j,jn,jand,jnand,jnnand
688 .xcref jnnonzero,jnonzero,jnzero,jzero
689 .xcref $st,$sn,$OrFound,$LoopEnd,$LeaveFound,$DefDist
690 .xcref $LastLabel,$LastLabelOrg,$EquateLabel,$TraceLabel,$CondJump2,$ncxz