Page 158 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 158
PROBLEMS 135
19. Write a shortest macro MARK that uses symbolic names given in Problem 11,
which writes the characters in its parameter if DEBUG is TRUE. The macro expansion
should put the character string argument inside the macro expansion and branch around it.
A character is printed by calling subroutine DUTCH with the character in Accumulator
A. Comment on the use of both conditional expressions and macros in debugging.
2 0. Write the assembly-language directives needed to print macro and conditional
expansions in the listing. Consult HiWare documentation for the directive formats.
21. Write macros LISTON and LISTOFF that use a symbolic name LISTLEVEL,
initially zero, as a count. LISTON increments this level, LISTOFF decrements this
level, and if the level changes from 1 to 0, the assembler listing is turned off, while if
the level changes from 0 to 1, the assembler listing is turned on.