Changes

Geshi

790 bytes added, 12:10, 31 March 2009
<geshi lang=MAXAM>
ld de,;; A useful procedure to display a 8-bit number in binary;; .txt_output equ &4000bb5a ;;------------------------------;; DISPLAY A BYTE IN BINARY FORM ;;;; Enter:;; A = 8-bit value;;;; Exit:;; AF corrupt.;; B corrupt. ;; All other registers preserved .display_binaryld hlb,&c0008 ;number of bits to display .get_bitrlca ;rotate current top bit into carry  ;if the bit was 1, the carry is set. (i.e. carry=1) ;if the bit was 0, the carry is reset. (i.e carry=0) push afld bca,&FFFF"0" ;ASCII character for bit valueldiradc a,0 ;add carry, if carry is set A="1", otherwise A="0"call txt_output ;display character onscreenpop af djnz get_bit ;loop, until all bits have been displayed
ret
</geshi>