home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / apps / misc / zx_sp207 / source / zxs.s < prev    next >
Text File  |  1993-07-18  |  2KB  |  45 lines

  1.           OPT A+      ; use (PC)-relativ adressing
  2.           OPT O3+     ; use short-word addressing
  3.           OPT O4+     ; use MOVEQ
  4.           OPT O5+     ; use ADDQ / SUBQ
  5.  
  6. ;####################################################################
  7. ;#         Externes Programm für ZX-SPECTRUM EMULATOR 2.0
  8. ;#
  9. ;#  Schaltet zwischen den Emulator-Sets 1..4 um.
  10. ;#  Einzubinden im Config-Dialog des Setup-Programmes (siehe Doku)
  11. ;####################################################################
  12.  
  13. sw_set:   move.l   4(a7),a5             ; BASEPAGE
  14.           lea      128(a5),a5           ; Adresse der Kommandozeile
  15.           cmpi.b   #'©',1(a5)           ; Aufruf vom Emulator?
  16.           bne.s    sws_exi              ; Exit, wenn vom Desktop
  17.           
  18.           lea      2+4*8(a5),a0         ; Adresse für Return-Wert
  19.           bsr      asc2hex
  20.           move.l   d0,a4                ; nach a4
  21.           lea      2+5*8(a5),a0         ; Kommandozeile Nr. akt. Set
  22.           bsr      asc2hex
  23.  
  24.           addq.w   #1,d0                ; nächstes Set
  25.           andi.w   #3,d0                ; 0...3...0
  26.  
  27.           move.w   #10,(a4)             ; Return=Einstellen neues Set
  28.           move.w   d0,2(a4)             ; Set.Nr
  29.  
  30. sws_exi: 
  31.           clr.w    -(sp)                ; fertig
  32.           trap     #1
  33.  
  34. asc2hex:  moveq     #0,d0
  35.           moveq     #8-1,d1
  36. a2h_05:   move.b    (a0)+,d2
  37.           cmpi.b    #'9'+1,d2
  38.           bcs.s     a2h_10
  39.           subq.b    #7,d2
  40. a2h_10:   subi.b    #'0',d2
  41.           lsl.l     #4,d0
  42.           or.b      d2,d0
  43.           dbf       d1,a2h_05
  44.           rts
  45.