Skip to content

Latest commit

 

History

History
291 lines (201 loc) · 7.27 KB

api.md

File metadata and controls

291 lines (201 loc) · 7.27 KB

y_ctrl - v1.0

Create new VM registers and use them via LCTRL and SCTRL.

(c) 2022 YSI contibutors, licensed under MPL 1.1

Functions

CTRL_FoundLCTRL:

Syntax

CTRL_FoundLCTRL(scanner[])

Parameters

Name Info
scanner [172] The codescan scanner that found a matching pattern.

Remarks

This function is called for every single LCTRL in the compiled AMX, after they are found by the code scanner. It checks if the found register load is for one of the new registers and replaces LCTRL with a special CALL.

Depends on

Estimated stack usage

63 cells

CTRL_FoundSCTRL:

Syntax

CTRL_FoundSCTRL(scanner[])

Parameters

Name Info
scanner [172] The codescan scanner that found a matching pattern.

Remarks

This function is called for every single SCTRL in the compiled AMX, after they are found by the code scanner. It checks if the found register store is for one of the new registers and replaces SCTRL with a special CALL.

Depends on

Estimated stack usage

63 cells

CTRL_LCTRLStub:

Syntax

CTRL_LCTRLStub()

Remarks

For every custom readable control register we define we need a special call stub that can convert from passing the parameters in registers to passing the parameters on the stack, without clobbering alt. A lot of the code is common to all of these stubs, and this function implements that common code. The final handler and return addresses are passed to this, and the parameters are extracted from pri and alt.

Depends on

Estimated stack usage

1 cells

CTRL_SCTRLStub:

Syntax

CTRL_SCTRLStub()

Remarks

For every custom writable control register we define we need a special call stub that can convert from passing the parameters in registers to passing the parameters on the stack, without clobbering the registers. A lot of the code is common to all of these stubs, and this function implements that common code. The final handler and return addresses are passed to this, and the parameters are extracted from pri and alt.

Depends on

Estimated stack usage

1 cells

CTRL_WriteLCTRLStub:

Syntax

CTRL_WriteLCTRLStub(addr)

Parameters

Name Info
addr The address to write to.

Remarks

For every custom readable control register we define we need a special call stub that can convert from passing the parameters in registers to passing the parameters on the stack, without clobbering alt. This generates those stubs.

Depends on

Estimated stack usage

33 cells

CTRL_WriteSCTRLStub:

Syntax

CTRL_WriteSCTRLStub(addr)

Parameters

Name Info
addr The address to write to.

Remarks

For every custom writable control register we define we need a special call stub that can convert from passing the parameters in registers to passing the parameters on the stack, without clobbering the registers. This generates those stubs.

Depends on

Estimated stack usage

33 cells

Timers_OnCodeInit:

Syntax

Timers_OnCodeInit()

Remarks

Initialise the library.

Depends on

Attributes

  • public

Estimated stack usage

526 cells