* Memory address 2000 = status register of printer * Memory address 2004 = data register of printer * Memory address 2008 = command register of printer xdef Start, Stop, End xdef inp Start: move.l #-1, $140C ; Write a non-zero value in status register move.l #inp,$1408 ; Program the address register in DMA move.l #11, $1404 ; Program the count register in DMA move.l #0, $1400; ; Issue the READ command to DMA wait: move.l $140C, d0 cmp.l #0, d0 ; Test if status has changed to ready bne wait ; Repeat testing until status changes move.l #inp,A0 move.w #0, d0 move.b (A0)+,d1 ext.w d1 add.l d1, d0 move.b (A0)+,d1 ext.w d1 add.l d1, d0 move.b (A0)+,d1 ext.w d1 add.l d1, d0 move.b (A0)+,d1 ext.w d1 add.l d1, d0 move.b (A0)+,d1 ext.w d1 add.l d1, d0 move.w d0, sum Stop: nop nop nop sum: ds.l 1 inp: ds.b 20 ; Buffer for string End: end