68K GAS  ....255.m68000-read.s 			page 1


   1               	* Memory address 2000 = status register of printer
   2               	* Memory address 2004 = data register of printer
   3               	* Memory address 2008 = command register of printer
   4               	
   5               	       xdef Start,Stop,End
   6               	       xdef inp
   7               	
   8               	Start:
   9 0000 21FC FFFF 	       	move.l #-1,$140C       ; Write a non-zero value in status register 
   9      FFFF 140C 
  10 0008 21FC 0000 	       	move.l #inp,$1408       ; Program the address register in DMA
  10      0000 1408 
  11 0010 21FC 0000 	       	move.l #11,$1404       ; Program the count register in DMA
  11      000B 1404 
  12 0018 21FC 0000 	       	move.l #0,$1400;      ; Issue the READ command to DMA
  12      0000 1400 
  13               	
  14               	 wait:
  15 0020 2038 140C 	       	move.l $140C,d0
  16 0024 0C80 0000 	       	cmp.l  #0,d0        ; Test if status has changed to ready
  16      0000 
  17 002a 66F4      	       	bne         wait        ; Repeat testing until status changes
  18               	
  19 002c 207C 0000 		move.l #inp,A0
  19      0000 
  20 0032 303C 0000 		move.w #0,d0
  21               	
  22 0036 1218      		move.b (A0)+,d1
  23 0038 4881      		ext.w  d1
  24 003a D081      		add.l  d1,d0
  25               	
  26 003c 1218      		move.b (A0)+,d1
  27 003e 4881      		ext.w  d1
  28 0040 D081      		add.l  d1,d0
  29               	
  30 0042 1218      		move.b (A0)+,d1
  31 0044 4881      		ext.w  d1
  32 0046 D081      		add.l  d1,d0
  33               	
  34 0048 1218      		move.b (A0)+,d1
  35 004a 4881      		ext.w  d1
  36 004c D081      		add.l  d1,d0
  37               	
  38 004e 1218      		move.b (A0)+,d1
  39 0050 4881      		ext.w  d1
  40 0052 D081      		add.l  d1,d0
  41               	
  42 0054 33C0 0000 		move.w d0,sum
  42      0000 
  43               	
  44               	Stop:
  45 005a 4E71      	       nop
  46 005c 4E71      	       nop
  47 005e 4E71      	       nop
  48               	
  49 0060 0000 0000 	sum:   ds.l  1
  50 0064 0000 0000 	inp:   ds.b  20                ; Buffer for string
68K GAS  ....255.m68000-read.s 			page 2


  50      0000 0000 
  50      0000 0000 
  50      0000 0000 
  50      0000 0000 
  51               	 
  52               	End:
  53               		end
68K GAS  ....255.m68000-read.s 			page 3


DEFINED SYMBOLS
....255.m68000-read.s:8      .text:0000000000000000 Start
....255.m68000-read.s:44     .text:000000000000005a Stop
....255.m68000-read.s:52     .text:0000000000000078 End
....255.m68000-read.s:50     .text:0000000000000064 inp
....255.m68000-read.s:14     .text:0000000000000020 wait
....255.m68000-read.s:49     .text:0000000000000060 sum

NO UNDEFINED SYMBOLS
