2003-04-29 09:55 PM
ST7 Assembler: function/label with parameter
2003-04-10 12:34 AM
Hello,
how can you pass an argument with ST7 assembler? LED DS.B $a7,$01,$9B,.... (array in rom) .. call function(LED) .. function (LED) Is this possible and how ? tia2003-04-22 12:06 AM
Hi,
One way is that you can pass arguments using X,Y registers. Other way is push the arguments on to the stack before calling the function and then in the function you can first pop PCH (program counter higher byte) then Program counter lower byte PCL , save them and then poping your arguments. Before executing ret instruction again push the PCH & PCL values.2003-04-29 09:55 PM
You can also use macros. Macros enable to have parameters.
The syntax is the following one: macro_name MACRO [parameter_1] [, parameter_2...] [LOCAL label_name] [Body_of_the_macro] MEND But take care that each time you invoke a macro to do a particular job, the whole macro assembly code is inserted into your source code. A macro is a faster way to execute code: there is no stacking for return addresses (less stack activity)