1 ; Print and Debug functions
3 ; Copyright (C) 2010 Leo C.
5 ; This file is part of avrcpm.
7 ; avrcpm is free software: you can redistribute it and/or modify it
8 ; under the terms of the GNU General Public License as published by
9 ; the Free Software Foundation, either version 3 of the License, or
10 ; (at your option) any later version.
12 ; avrcpm is distributed in the hope that it will be useful,
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ; GNU General Public License for more details.
17 ; You should have received a copy of the GNU General Public License
18 ; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
27 ;Print a unsigned lonng value to the uart
28 ; temp4:temp3:temp2:temp = value
39 clr yl ;yl = stack level
41 ultoa1: ldi z_flags, 32 ;yh = temp4:temp % 10
42 clr yh ;temp4:temp /= 10
54 cpi yh, 10 ;yh is a numeral digit '0'-'9'
58 cp temp,_0 ;Repeat until temp4:temp gets zero
65 ultoa5: cpi yl,3 ; at least 3 digits (ms)
71 ultoa6: pop temp ;Flush stacked digits
86 ;Prints temp2:temp in hex to the uart
94 ;Prints temp in hex to the uart
101 ;Prints the lower nibble
114 ;Prints the zero-terminated string following the call statement.
154 ; --------------- Debugging stuff ---------------
155 ; Print a line with the Z80 main registers
167 ldiw z,zflags_to_ch*2
173 cpi temp,' ' ; Test if no flag
176 ldi temp,' ' ; Flag not set
222 ; vim:set ts=8 noet nowrap