Advertisement
ZoriaRPG

ZASM Example

Jun 17th, 2017
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. WAIT WAITFRAME : Dynamic Tile Overlay FFC, overtile.txt
  2.  PUSHR d0 : Push the <D0> arg and allow it.
  3.  PUSHR d1 : Push the <D1> arg and allow it.
  4.  PUSHR d2 : Push the <D2> arg and allow it.
  5.  PUSHR d3 : Push the <D3> arg and allow it.
  6.  PUSHR d4 : Push the <D4> arg and allow it.
  7.  PUSHR d5 : Push the <D5> arg and allow it.
  8.  PUSHR d6 : Push the <D6> arg and allow it.
  9.  PUSHR d7 : Push the <D7> arg and allow it.
  10.  SETV d2,0
  11.  SETR d3,REFFFC : Set the ffc pointer, 'this'
  12.  PUSHR d3
  13.  SETR d4,SP
  14.  SETR d6,d4
  15.  ADDV d6,8
  16.  LOADI d2,d6
  17.  PUSHR d2
  18.  SETR d6,d4
  19.  ADDV d6,7
  20.  LOADI d2,d6
  21.  POP d3
  22.  COMPAREV d2,0 : An if statement, checking against 0. (If a tile is assigned.)
  23.  SETFALSE d2
  24.  COMPAREV d3,0
  25.  SETFALSE d3
  26.  ADDR d2,d3
  27.  COMPAREV d2,0.0002
  28.  SETMORE d2 : if > 0
  29.  COMPAREV d2,0
  30.  GOTOTRUE 44 : if true, set.
  31.  PUSHR d4
  32.  SETV d2,42
  33.  PUSHR d2
  34.  SETR d6,d4
  35.  ADDV d6,8
  36.  LOADI d2,d6
  37.  PUSHR d2
  38.  SETR d6,d4
  39.  ADDV d6,7
  40.  LOADI d2,d6
  41.  PUSHR d2
  42.  GOTO OVERJUMP : jump to pops and do the overlay.
  43.  POP d4
  44.  SETV d2,0
  45.  SETR d6,d4
  46.  ADDV d6,6
  47.  LOADI d2,d6
  48.  PUSHR d2
  49.  SETR d6,d4
  50.  ADDV d6,5
  51.  LOADI d2,d6
  52.  POP d3
  53.  COMPAREV d2,0
  54.  SETFALSE d2
  55.  COMPAREV d3,0
  56.  SETFALSE d3
  57.  ADDR d2,d3
  58.  COMPAREV d2,0.0002
  59.  SETMORE d2
  60.  COMPAREV d2,0
  61.  GOTOTRUE 75 : if the statement is true, jump to calcs and compares.
  62.  PUSHR d4
  63.  SETV d2,73
  64.  PUSHR d2
  65.  SETR d6,d4
  66.  ADDV d6,6
  67.  LOADI d2,d6
  68.  PUSHR d2
  69.  SETR d6,d4
  70.  ADDV d6,5
  71.  LOADI d2,d6
  72.  PUSHR d2
  73.  GOTO OVERJUMP
  74.  POP d4
  75.  SETV d2,0
  76.  SETR d6,d4
  77.  ADDV d6,4
  78.  LOADI d2,d6
  79.  PUSHR d2
  80.  SETR d6,d4
  81.  ADDV d6,3
  82.  LOADI d2,d6
  83.  POP d3
  84.  COMPAREV d2,0
  85.  SETFALSE d2
  86.  COMPAREV d3,0
  87.  SETFALSE d3
  88.  ADDR d2,d3
  89.  COMPAREV d2,0.0002
  90.  SETMORE d2
  91.  COMPAREV d2,0
  92.  GOTOTRUE 106 : if this evaluates true, jump
  93.  PUSHR d4
  94.  SETV d2,104
  95.  PUSHR d2
  96.  SETR d6,d4
  97.  ADDV d6,4
  98.  LOADI d2,d6
  99.  PUSHR d2
  100.  SETR d6,d4
  101.  ADDV d6,3
  102.  LOADI d2,d6
  103.  PUSHR d2
  104.  GOTO OVERJUMP : jump to pops and do overlay.
  105.  POP d4
  106.  SETV d2,0
  107.  SETR d6,d4
  108.  ADDV d6,2
  109.  LOADI d2,d6
  110.  PUSHR d2
  111.  SETR d6,d4
  112.  ADDV d6,1
  113.  LOADI d2,d6
  114.  POP d3
  115.  COMPAREV d2,0
  116.  SETFALSE d2
  117.  COMPAREV d3,0
  118.  SETFALSE d3 : false flag
  119.  ADDR d2,d3
  120.  COMPAREV d2,0.0002
  121.  SETMORE d2
  122.  COMPAREV d2,0
  123.  GOTOTRUE SETJ : jump only if this evaluates
  124.  PUSHR d4
  125.  SETV d2,135
  126.  PUSHR d2
  127.  SETR d6,d4
  128.  ADDV d6,2
  129.  LOADI d2,d6
  130.  PUSHR d2
  131.  SETR d6,d4
  132.  ADDV d6,1
  133.  LOADI d2,d6
  134.  PUSHR d2
  135.  GOTO OVERJUMP : jump to pops and overlay the tile.
  136.  POP d4
  137. SETJ SETV d2,0
  138.  PUSHR d4
  139.  SETV d2,141
  140.  PUSHR d2
  141.  GOTO POPQUIT
  142.  POP d4
  143.  SETV d3,0
  144.  POP d3
  145.  POP d3
  146.  POP d3
  147.  POP d3
  148.  POP d3
  149.  POP d3
  150.  POP d3
  151.  POP d3
  152.  QUIT
  153. POPQUIT POP d3
  154.  QUIT
  155. OVERJUMP POP d3
  156.  POP d2
  157.  OVERLAYTILERR d2,d3 : overlay the tile
  158.  POP d3
  159.  GOTOR d3 : for loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement