;;mocro programming standard
macroname macro par1,par2,par3,parn
endm
bgnmac name par1,par2,par3,par4
dfltlbls name_bgn,name_end,name_ov,name_strt
labels name_a,name_b,name_c,name_d
variables v1,v2,v3,v4
registers bx,cx,dx,xi,ix,all
name_strt:
name_ov:
endmac name
name arg1,arg2,arg3,argn ;; // macro calling
...............................................................................
macro name(par1,par2,par3,parn)
{
exitm;
}
name(arg1,arg2,arg3,argn);;
...............................................................................
The fifth advantage of new macro programming?
Extending the macro facilities using a preprocessor to allow expressions.
ax = datavar;
datavar = bx;
ax = (bx * cx - dx);
This feature is not a new feature but available in some companies but not being used widely by the developers.
;;---------------------------------------------------------------------------------
macroname macro par1,par2,par3,parn
endm
bgnmac name par1,par2,par3,par4
dfltlbls name_bgn,name_end,name_ov,name_strt
labels name_a,name_b,name_c,name_d
variables v1,v2,v3,v4
registers bx,cx,dx,xi,ix,all
name_strt:
name_ov:
endmac name
name arg1,arg2,arg3,argn ;; // macro calling
...............................................................................
macro name(par1,par2,par3,parn)
{
exitm;
}
name(arg1,arg2,arg3,argn);;
...............................................................................
what is the advantage of new macro programming?
already macros are being used in every assembler and it is being implemented as #defines in c and an extension as templates in c++. So the question raises in the minds of programmers what additioan l value is there using new macros. A little. That is flavoring c or pascal type of function appera nce. This gives a fealing of macros are similar to functions but not functions known to every one.
you can delcare labels but the names are a little standardised. This standardisation makes the
user to declare same variables in every macro, so it is ease of programming.
explain all the default macros
next we are going use standard labels for all the other controls also using a suffix and alphabet.
;;---------------------------------------------------------------------------------
What is the next major advantage in macro programming?
You can use all 4 types of commenting. Like ; // COMMENT /* */ compatible with legacy
what is the 3rd advatange of usng new macro programming?
You can extend the instruction set of the CPU with macros as pseudo instructions. You can group a few instructions as a single instruction that gives meaningful pseudo instruction. For example you want to push all ?x registers then you can create pushx instruction that do the job of pushing 3 variables that names like bx,cx,dx. So a new instruction that is equally meaningful as if it is implemented in the CPU. This is one type of instruction set extention.
There is another way of extending the instructions set by creating variable dependant instructions rather register dependant instructions. Take an example of loop that works with a cx register. But many times in the programming we need to depend concurrently multiple level looping here we can't use the same cx register or we need to swap the values of the variable into the cx and use this loop instruction. But it is very discomfort for the programming and finallyit is dependng on a variable instead a register. So we can create a new instruction like loopvcntr means loop variable counter so we pass a variable as an operand to the loopvcntr additionally to handle this looping. There is a great advantage of using this type of variable dependant instruction set.
Using this type of pseudo instructions we can we increase the power of CPU and the capability of the CPU from the programming perspective. It reduces the programming instrtuctions to use for doing a task.
What is the over all advantage of using new macro progrmaming?
The instruction set available on the Hard ware of a CPU is n we can make it mn instruction set. Just it is not increasing the number of macros to support pseudo instructions, we are able to generate the instructions while using them with good naming convention like push pushx pushi these instructions are easy to memorise and use. That is very much important in extending instructions, otherwise it would be a big overhead on thedeveloper to learn more instructions, the developer should generate or extend instructions what are available and not learn to use. No learning overhead should be there in new macros.
Extending instruction set of the existing chip. Second extending instruction set to work variables rather with registers. Some of the instruction set works with a register or depend on a register value, but here we can create new instructions that canwork using a variable as register. Take a simple example of using a loop it depends on cx register but we can make a new instruction loopvcntr loop vcntr means loop variable counter using a variable as a parameter to this instruction. We can design pseduo instructions that are more helpful for comprehensive and legible instruction set.
Only thisfeature enhances your CPU power with more instructions which will use more number of cycles but they do your job with the same CPU. Final advantage is increasing the power of CPU is done using pseudo instructions.
The fifth advantage of new macro programming?
Extending the macro facilities using a preprocessor to allow expressions.
ax = datavar;
datavar = bx;
ax = (bx * cx - dx);
This feature is not a new feature but available in some companies but not being used widely by the developers.
No comments:
Post a Comment