ZASM Language Reference/New Page

From ZCWiki
Jump to: navigation, search

This page lists all the ZASM commands available for use, along with descriptions of how they work. This page is a work in progress, as most commands are as yet undeciphered.

Some commands have two versions, one ending in V, and the other ending on R. The difference is whether they work on "values" or "references". For example, this command:

SETV D0, 1234

Will put the value "1234" into the D0 register. However,

SETR D0, 1234

Will put whatever is at address $1234 into D0 (which is not what you want).

Below, a few "dummy" values are used to indicate what are acceptable arguments to the instructions. They are:

  • <target> - This is a memory address whose value will be overwritten. Generally, you will specify a register (such as D0). You may use any register that is not specified as read-only.
  • <source> - This is a memory address whose value will be read. Usually, this will be a register (such as D0). You may specify any register that is not write-only.
  • <targetsource> - This is a memory address whose value will be read, and then overwritten. You must specify a register that is not write- or read-only
  • <value> - This is a immediate value that will not be dereferenced. Do not use a register, it will not be dereferenced.

Instructions

Basic Commands

LOOP

Dunno about loop

SETV, SETR

SETV <target>, <value>
SETR <target>, <source>

Copies the value into the target.

GOTO, GOTOR

GOTO  <target>
GOTOR <source>

Jumps execution to the target. The target is specified as "number of instructions from the beginning of the file", i.e. the line number. It can also be a label.

QUIT, WAITFRAME

QUIT

Ends execution of the script.

WAITFRAME

Pauses script execution until next frame of gameplay

PUSHV, PUSHR, POP

PUSHV <value>
PUSHR <source>

Pushes the specified value onto the stack and increments SP.

POP <target>

Pops the top value from the stack and loads it into target

LOADI, STOREI

Load/Store Indirect

LOADI  <target>, <source>
STOREI <target>, <source>

Loads the value as though 'source' were the stack pointer into 'target'

LOAD1, LOAD2, SETA1, SETA2

LOAD1 <target>, <source>
LOAD2 <target>, <source>
SETA1 <source1>, <source2>
SETA2 <source1>, <source2>

Intended for use with the 'A' registers of each ffc to allow manipulating the D registers from the other ffcs on the screen, except they don't work

Got lazy

  • COMPARER
  • COMPAREV
  • GOTOTRUE
  • GOTOFALSE
  • GOTOLESS
  • GOTOMORE

Mathematical

ADDR, ADDV, SUBR, SUBV, MULTR, MULTV, DIVR, DIVV, MODR, MODV

ADDR  <targetsource>, <source>
ADDV  <targetsource>, <value>
SUBR  <targetsource>, <source>
SUBV  <targetsource>, <value>
MULTR <targetsource>, <source>
MULTV <targetsource>, <value>
DIVR  <targetsource>, <source>
DIVV  <targetsource>, <value>
MODR  <targetsource>, <source>
MODV  <targetsource>, <value>

Performs the specified mathematical operation, with <source>/<value> as specified as the first operand and targetsource as the second operand, and stores the result in targetsource

Got lazy again

  • SINR
  • SINV
  • COSR
  • COSV
  • TANR
  • TANV
  • ABS
  • MINR
  • MINV
  • MAXR
  • MAXV
  • RNDR
  • RNDV
  • FACTORIAL
  • POWERR
  • POWERV
  • IPOWERR
  • IPOWERV
  • ARCTANR
  • ARCSINR
  • ARCSINV
  • ARCCOSR
  • ARCCOSV
  • LOG10
  • LOGE

Bitwise

  • ANDR
  • ANDV
  • ORR
  • ORV
  • XORR
  • XORV
  • NANDR
  • NANDV
  • NORR
  • NORV
  • XNORR
  • XNORV
  • NOT
  • LSHIFTR
  • LSHIFTV
  • RSHIFTR
  • RSHIFTV
  • BITNOT
  • SQROOTV
  • SQROOTR

Tracing

  • TRACER
  • TRACEV
  • TRACE3
  • TRACE2R
  • TRACE2V
  • TRACE4
  • TRACE5
  • TRACE6

Tilesheet Manipulation

  • COPYTILEVV
  • COPYTILEVR
  • COPYTILERV
  • COPYTILERR
  • SWAPTILEVV
  • SWAPTILEVR
  • SWAPTILERV
  • SWAPTILERR
  • CLEARTILEV
  • CLEARTILER
  • OVERLAYTILEVV
  • OVERLAYTILEVR
  • OVERLAYTILERV
  • OVERLAYTILERR

Not Implemented

  • ENQUEUER
  • ENQUEUEV
  • DEQUEUE
  • CHECKTRIG
  • COMPOUNDR
  • COMPOUNDV
  • FLIPROTTILEVV
  • FLIPROTTILEVR
  • FLIPROTTILERV
  • FLIPROTTILERR
  • GETTILEPIXELV
  • GETTILEPIXELR
  • SETTILEPIXELV
  • SETTILEPIXELR
  • SHIFTTILEVV
  • SHIFTTILEVR
  • SHIFTTILERV
  • SHIFTTILERR

Deprecated

  • DECLARE
  • PTROFF

Uncategorized

  • WARP
  • PLAYSOUNDR
  • PLAYSOUNDV
  • LOADLWEAPONR
  • LOADLWEAPONV
  • LOADITEMR
  • LOADITEMV
  • LOADNPCR
  • LOADNPCV
  • CREATELWEAPONR
  • CREATELWEAPONV
  • CREATEITEMR
  • CREATEITEMV
  • CREATENPCR
  • CREATENPCV
  • CREATEEWEAPONR
  • CREATEEWEAPONV
  • PITWARP
  • WARPR
  • PITWARPR
  • CLEARSPRITESR
  • CLEARSPRITESV
  • RECT
  • CIRCLE
  • ARC
  • ELLIPSE
  • LINE
  • PUTPIXEL
  • DRAWTILE
  • DRAWCOMBO
  • ELLIPSE2
  • SPLINE
  • FLOODFILL
  • MSGSTRR
  • MSGSTRV
  • ISVALIDITEM
  • ISVALIDNPC
  • PLAYMIDIR
  • PLAYMIDIV
  • ISVALIDLWPN
  • ISVALIDEWPN
  • LOADEWEAPONR
  • LOADEWEAPONV
  • ALLOCATEMEMR
  • ALLOCATEMEMV
  • DEALLOCATEMEMR
  • DEALLOCATEMEMV
  • WAITDRAW
  • LWPNUSESPRITER
  • LWPNUSESPRITEV
  • EWPNUSESPRITER
  • EWPNUSESPRITEV
  • LOADITEMDATAR
  • LOADITEMDATAV
  • ISSOLID
  • LAYERSCREEN
  • LAYERMAP
  • SECRETS
  • DRAWCHAR
  • GETSCREENFLAGS
  • QUAD
  • TRIANGLE
  • GAMEEND
  • DRAWINT
  • SETTRUE
  • SETFALSE
  • SETMORE
  • SETLESS
  • FASTTILE
  • FASTCOMBO
  • DRAWSTRING
  • SETSIDEWARP
  • SAVE
  • QUAD3D
  • TRIANGLE3D
  • SETCOLORB
  • SETDEPTHB
  • GETCOLORB
  • GETDEPTHB

Registers

FFC Related

  • REFFFC
  • FFCHEIGHT
  • FFCWIDTH
  • FFFLAGSD
  • FFINITD
  • FFINITDD
  • FFLINK
  • FFMISC
  • FFMISCD
  • FFSCRIPT
  • FFTHEIGHT
  • FFTWIDTH

Link Related

  • LINK
  • LINKACTION
  • LINKDIR
  • LINKDRUNK
  • LINKEQUIP
  • LINKHELD
  • LINKHP
  • LINKHXOFS
  • LINKHXSZ
  • LINKHYOFS
  • LINKHYSZ
  • LINKHZSZ
  • LINKINVINC
  • LINKINVIS
  • LINKITEMD
  • LINKITEMJINX
  • LINKJUMP
  • LINKLADDERX
  • LINKLADDERY
  • LINKMAXHP
  • LINKMAXMP
  • LINKMISC
  • LINKMISCD
  • LINKMP
  • LINKSWORDJINX
  • LINKTXSZ
  • LINKTYSZ
  • LINKX
  • LINKXOFS
  • LINKY
  • LINKYOFS
  • LINKZ
  • LINKZOFS

NPC Related

  • REFNPC
  • REFNPCCLASS
  • NPCX
  • NPCY
  • NPCZ
  • NPCJUMP
  • NPCDIR
  • NPCRATE
  • NPCSTEP
  • NPCFRAMERATE
  • NPCHALTRATE
  • NPCDRAWTYPE
  • NPCHP
  • NPCID
  • NPCDP
  • NPCWDP
  • NPCOTILE
  • NPCENEMY
  • NPCWEAPON
  • NPCITEMSET
  • NPCCSET
  • NPCBOSSPAL
  • NPCBGSFX
  • NPCCOUNT
  • NPCHXOFS
  • NPCHYOFS
  • NPCXOFS
  • NPCYOFS
  • NPCZOFS
  • NPCHXSZ
  • NPCHYSZ
  • NPCHZSZ
  • NPCHOMING
  • NPCDD
  • NPCD
  • NPCMISCD
  • NPCMISC
  • NPCMFLAGS
  • NPCCOLLDET
  • NPCSTUN
  • NPCDEFENSED
  • NPCEXTEND
  • NPCTILE
  • NPCTXSZ
  • NPCTYPE
  • NPCTYSZ

EWeapon Related

  • EWPNANGLE
  • EWPNANGULAR
  • EWPNASPEED
  • EWPNBEHIND
  • EWPNCOLLDET
  • EWPNCOUNT
  • EWPNCSET
  • EWPNDEAD
  • EWPNDIR
  • EWPNDRAWTYPE
  • EWPNEXTEND
  • EWPNFLASH
  • EWPNFLASHCSET
  • EWPNFLIP
  • EWPNFRAME
  • EWPNFRAMES
  • EWPNHXOFS
  • EWPNHXSZ
  • EWPNHYOFS
  • EWPNHYSZ
  • EWPNHZSZ
  • EWPNID
  • EWPNJUMP
  • EWPNMISC
  • EWPNMISCD
  • EWPNOCSET
  • EWPNOTILE
  • EWPNPOWER
  • EWPNSTEP
  • EWPNTILE
  • EWPNTXSZ
  • EWPNTYSZ
  • EWPNX
  • EWPNXOFS
  • EWPNY
  • EWPNYOFS
  • EWPNZ
  • EWPNZOFS

LWeapon Related

  • LWPNANGLE
  • LWPNANGULAR
  • LWPNASPEED
  • LWPNBEHIND
  • LWPNCOLLDET
  • LWPNCOUNT
  • LWPNCSET
  • LWPNDEAD
  • LWPNDIR
  • LWPNDRAWTYPE
  • LWPNEXTEND
  • LWPNFLASH
  • LWPNFLASHCSET
  • LWPNFLIP
  • LWPNFRAME
  • LWPNFRAMES
  • LWPNHXOFS
  • LWPNHXSZ
  • LWPNHYOFS
  • LWPNHYSZ
  • LWPNHZSZ
  • LWPNID
  • LWPNJUMP
  • LWPNMISC
  • LWPNMISCD
  • LWPNOCSET
  • LWPNOTILE
  • LWPNPOWER
  • LWPNSTEP
  • LWPNTILE
  • LWPNTXSZ
  • LWPNTYSZ
  • LWPNX
  • LWPNXOFS
  • LWPNY
  • LWPNYOFS
  • LWPNZ
  • LWPNZOFS

Item Related

  • IDATAAMOUNT
  • IDATACOUNTER
  • IDATAFAMILY
  • IDATAKEEP
  • IDATALEVEL
  • IDATAMAX
  • IDATASETMAX
  • IDATAUSESOUND
  • ITEMASPEED
  • ITEMCOUNT
  • ITEMCSET
  • ITEMDELAY
  • ITEMDRAWTYPE
  • ITEMEXTEND
  • ITEMFLASH
  • ITEMFLASHCSET
  • ITEMFLIP
  • ITEMFRAME
  • ITEMFRAMES
  • ITEMHXOFS
  • ITEMHXSZ
  • ITEMHYOFS
  • ITEMHYSZ
  • ITEMHZSZ
  • ITEMID
  • ITEMJUMP
  • ITEMMISC
  • ITEMMISCD
  • ITEMOTILE
  • ITEMPICKUP
  • ITEMTILE
  • ITEMTXSZ
  • ITEMTYSZ
  • ITEMX
  • ITEMXOFS
  • ITEMY
  • ITEMYOFS
  • ITEMZ
  • ITEMZOFS

Input Related

  • INPUTA
  • INPUTAXISDOWN
  • INPUTAXISLEFT
  • INPUTAXISRIGHT
  • INPUTAXISUP
  • INPUTB
  • INPUTDOWN
  • INPUTEX1
  • INPUTEX2
  • INPUTEX3
  • INPUTEX4
  • INPUTL
  • INPUTLEFT
  • INPUTMAP
  • INPUTMOUSEB
  • INPUTMOUSEX
  • INPUTMOUSEY
  • INPUTMOUSEZ
  • INPUTPRESSA
  • INPUTPRESSB
  • INPUTPRESSDOWN
  • INPUTPRESSEX1
  • INPUTPRESSEX2
  • INPUTPRESSEX3
  • INPUTPRESSEX4
  • INPUTPRESSL
  • INPUTPRESSLEFT
  • INPUTPRESSR
  • INPUTPRESSRIGHT
  • INPUTPRESSSTART
  • INPUTPRESSUP
  • INPUTR
  • INPUTRIGHT
  • INPUTSTART
  • INPUTUP
  • PRESSAXISDOWN
  • PRESSAXISLEFT
  • PRESSAXISRIGHT
  • PRESSAXISUP

Misc

Uncategorized

  • A
  • COMBOC
  • COMBOCD
  • COMBOCDM
  • COMBOD
  • COMBODD
  • COMBODDM
  • COMBOF
  • COMBOFD
  • COMBOFDM
  • COMBOID
  • COMBOIDM
  • COMBOSD
  • COMBOSDM
  • COMBOTD
  • COMBOTDM
  • CSET
  • CURDMAP
  • CURDSCR
  • CURLEVEL
  • CURMAP
  • CURSCR
  • D
  • DATA
  • DELAY
  • DMAPFLAGSD
  • FLAG
  • GAMECHEAT
  • GAMECONTDMAP
  • GAMECONTSCR
  • GAMECOUNTER
  • GAMECOUNTERD
  • GAMEDCOUNTER
  • GAMEDCOUNTERD
  • GAMEDEATHS
  • GAMEGENERIC
  • GAMEGENERICD
  • GAMEGUYCOUNT
  • GAMEGUYCOUNTD
  • GAMEHASPLAYED
  • GAMEITEMS
  • GAMEITEMSD
  • GAMELITEMS
  • GAMELITEMSD
  • GAMELKEYS
  • GAMELKEYSD
  • GAMEMCOUNTER
  • GAMEMCOUNTERD
  • GAMETIME
  • GAMETIMEVALID
  • GD
  • GDD
  • GETMIDI
  • GLOBALRAM
  • GLOBALRAMD
  • GS
  • HEIGHT
  • LIT
  • QUAKE
  • REFEWPN
  • REFEWPNCLASS
  • REFITEM
  • REFITEMCLASS
  • REFLWPN
  • REFLWPNCLASS
  • SAVERAM
  • SCRDOOR
  • SCRDOORD
  • SCREENEFLAGS
  • SCREENEFLAGSD
  • SCREENFLAGS
  • SCREENFLAGSD
  • SCREENSTATE
  • SCREENSTATED
  • SCREENSTATEDD
  • SCRIPTRAM
  • SCRIPTRAMD
  • SD
  • SDD
  • SDDD
  • SDDDD
  • SP
  • WAVY
  • WIDTH
  • X
  • XD
  • XD2
  • Y
  • YD
  • YD