Utility:

    

    To round off the week that's in it once again, how about a simple but useful routine to display the contents of work register R12?

The Utility routine is almost the same as the Hello World routine previously discussed and, as usual, we'll concentrate our attention 

on the differences only. After initialising the registers and ports, we then send the string " Register R12 " out to the Lcd  in 

StartUp.inc (156-166) and the work register R12 is then loaded with the value "0x12345678" (168). This 32-bit value is then sent to

the Lcd via the subroutine Word to Lcd, LcdWrd. This routine in turn is almost identical to the A2DUart routine already presented,

the only difference being, that the Lcd is used as the destination and not the Serial TTY device! Work register R12 can contain any

data or register/memory location, which you wish to display and this can be a great boon when debugging tricky or stubborn programs.

Hope you like it?

"O Lord, won't you buy me a Mercedez Benz. My friends have all Porsches, I must make amends."

Download