home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / CROSSASM / Z80.ZIP / MNEMTEST.ASM < prev    next >
Encoding:
Assembly Source File  |  1987-01-04  |  10.1 KB  |  482 lines

  1.          .org 0               ;z80 mnemonics test
  2.          adc a,h'00
  3.          adc a,h'ff
  4.          adc a,a
  5.          adc a,b
  6.          adc a,c
  7.          adc a,d
  8.          adc a,e
  9.          adc a,h
  10.          adc a,l
  11.          adc a,(hl)
  12.          adc a,(ix+-128)
  13.          adc a,(iy+127)
  14.          adc hl,bc
  15.          adc hl,de
  16.          adc hl,hl
  17.          adc hl,sp
  18.          add a,h'00
  19.          add a,h'ff
  20.          add a,a
  21.          add a,l
  22.          add a,(hl)
  23.          add a,(ix+-128)
  24.          add a,(iy+127)
  25.          add hl,bc
  26.          add hl,de
  27.          add hl,hl
  28.          add hl,sp
  29.          add ix,bc
  30.          add ix,de
  31.          add ix,hl
  32.          add ix,sp
  33.          add iy,bc
  34.          add iy,de
  35.          add iy,hl
  36.          add iy,sp
  37.          and h'00
  38.          and h'ff
  39.          and a
  40.          and l
  41.          and (hl)
  42.          and (ix+-128)
  43.          and (iy+127)
  44.          bit 0,a
  45.          bit 0,l
  46.          bit 0,(hl)
  47.          bit 0,(ix+-128)
  48.          bit 0,(iy+127)
  49.          bit 7,a
  50.          bit 7,l
  51.          bit 7,(hl)
  52.          bit 7,(ix+-128)
  53.          bit 7,(iy+127)
  54.          call h'00
  55.          call h'ff
  56.          call longtest
  57.          call nz,h'00
  58.          call z,h'ff
  59.          call nc,longtest
  60.          call c,longtest
  61.          call po,h'00
  62.          call pe,1000
  63.          call p,128
  64.          call m,0
  65.          ccf
  66.          cp h'00
  67.          cp h'ff
  68.          cp a
  69.          cp l
  70.          cp (hl)
  71.          cp (ix+-128)
  72.          cp (iy+127)
  73.          cpd
  74.          cpdr
  75.          cpi
  76.          cpir
  77.          cpl
  78.          daa
  79.          dec a
  80.          dec l
  81.          dec (hl)
  82.          dec (ix+-128)
  83.          dec (iy+127)
  84.          dec bc
  85.          dec de
  86.          dec hl
  87.          dec sp
  88.          dec ix
  89.          dec iy
  90.          di
  91.          djnz rtest
  92.          ei
  93.          ex af,af'
  94.          ex de,hl
  95.          ex (sp),hl
  96.          ex (sp),ix
  97.          ex (sp),iy
  98.          exx
  99.          halt
  100.          im 0
  101.          im 1
  102.          im 2
  103.          in a,(h'00)
  104.          in a,(h'ff)
  105.          inc a
  106.          inc l
  107.          inc (hl)
  108.          inc (ix+-128)
  109.          inc (iy+127)
  110.          inc bc
  111.          inc de
  112.          inc hl
  113.          inc sp
  114.          inc ix
  115.          inc iy
  116.          ind
  117.          indr
  118.          ini
  119.          inir
  120.          in a,(c)
  121.          in c,(c)
  122.          in l,(c)
  123.          jp h'00
  124.          jp h'ff
  125.          jp longtest
  126.          jp nz,h'00
  127.          jp z,h'ff
  128.          jp nc,longtest
  129.          jp c,longtest
  130.          jp po,h'00
  131.          jp pe,1000
  132.          jp p,128
  133.          jp m,0
  134.          jp (hl)
  135.          jp (ix)
  136.          jp (iy)
  137.          jr c,rtest
  138. rtest:   jr rtest
  139.          jr nc,rtest
  140.          jr nz,rtest
  141.          jr z,rtest
  142.          ld a,i
  143.          ld a,r
  144.          ld a,(longtest)
  145.          ld a,(h'00)
  146.          ld a,(h'ff)
  147.          ld a,(hl)
  148.          ld a,(bc)
  149.          ld a,(de)
  150.          ld a,l
  151.          ld l,a
  152.          ld l,h
  153.          ld hl,(h'00)
  154.          ld hl,(longtest)
  155.          ld bc,(h'00)
  156.          ld de,(longtest)
  157.          ld sp,(h'ff)
  158.          ld ix,(h'00)
  159.          ld iy,(h'ff)
  160.          ld ix,(longtest)
  161.          ld i,a
  162.          ld r,a
  163.          ld a,h'00
  164.          ld l,h'ff
  165.          ld bc,h'00
  166.          ld de,h'ff
  167.          ld sp,h'ff
  168.          ld hl,longtest
  169.          ld hl,1000
  170.          ld ix,1000
  171.          ld iy,longtest
  172.          ld a,(hl)
  173.          ld l,(hl)
  174.          ld a,(ix+127)
  175.          ld l,(iy+-128)
  176.          ld sp,hl
  177.          ld sp,ix
  178.          ld sp,iy
  179.          ld (1000),a
  180.          ld (longtest),a
  181.          ld (1000),hl
  182.          ld (longtest),hl
  183.          ld (1000),bc
  184.          ld (longtest),bc
  185.          ld (1000),de
  186.          ld (longtest),de
  187.          ld (1000),sp
  188.          ld (longtest),sp
  189.          ld (1000),ix
  190.          ld (longtest),iy
  191.          ld (hl),h'00
  192.          ld (hl),h'ff
  193.          ld (ix+127),h'00
  194.          ld (ix+-128),h'ff
  195.          ld (hl),a
  196.          ld (hl),l
  197.          ld (ix+127),a
  198.          ld (iy+-128),l
  199.          ld (bc),a
  200.          ld (de),a
  201.          ld (hl),a
  202.          ldd
  203.          lddr
  204.          ldi
  205.          ldir
  206.          neg
  207.          nop
  208.          or h'00
  209.          or h'ff
  210.          or a
  211.          or l
  212.          or (hl)
  213.          or (ix+-128)
  214.          or (iy+127)
  215.          out (c),a
  216.          out (c),l
  217.          outd
  218.          otdr
  219.          outi
  220.          otir
  221.          out (h'00),a
  222.          out (h'ff),a
  223.          pop bc
  224.          pop de
  225.          pop hl
  226.          pop af
  227.          pop ix
  228.          pop iy
  229.          push bc
  230.          push de
  231.          push hl
  232.          push af
  233.          push ix
  234.          push iy
  235.          res 0,a
  236.          res 0,l
  237.          res 0,(hl)
  238.          res 0,(ix+-128)
  239.          res 0,(iy+127)
  240.          res 7,a
  241.          res 7,l
  242.          res 7,(hl)
  243.          res 7,(ix+-128)
  244.          res 7,(iy+127)
  245.          ret
  246.          ret nz
  247.          ret z
  248.          ret nc
  249.          ret c
  250.          ret po
  251.          ret pe
  252.          ret p
  253.          ret m
  254.          reti
  255.          retn
  256.          rl a
  257.          rl l
  258.          rl (hl)
  259.          rl (ix+-128)
  260.          rl (iy+127)
  261.          rla
  262.          rlc a
  263.          rlc l
  264.          rlc (hl)
  265.          rlc (ix+-128)
  266.          rlc (iy+127)
  267.          rlca
  268.          rld
  269.          rr a
  270.          rr l
  271.          rr (hl)
  272.          rr (ix+-128)
  273.          rr (iy+127)
  274.          rra
  275.          rrc a
  276.          rrc l
  277.          rrc (hl)
  278.          rrc (ix+-128)
  279.          rrc (iy+127)
  280.          rrca
  281.          rrd
  282.          rst h'00
  283.          rst h'20
  284.          rst h'38
  285.          sbc a,h'00
  286.          sbc a,h'ff
  287.          sbc a,a
  288.          sbc a,l
  289.          sbc a,(hl)
  290.          sbc a,(ix+-128)
  291.          sbc a,(iy+127)
  292.          sbc hl,bc
  293.          sbc hl,de
  294.          sbc hl,hl
  295.          sbc hl,sp
  296.          scf
  297.          set 0,a
  298.          set 0,l
  299.          set 0,(hl)
  300.          set 0,(ix+-128)
  301.          set 0,(iy+127)
  302.          set 7,a
  303.          set 7,l
  304.          set 7,(hl)
  305.          set 7,(ix+-128)
  306.          set 7,(iy+127)
  307.          sla a
  308.          sla l
  309.          sla (hl)
  310.          sla (ix+-128)
  311.          sla (iy+127)
  312.          sra a
  313.          sra l
  314.          sra (hl)
  315.          sra (ix+-128)
  316.          sra (iy+127)
  317.          srl a
  318.          srl l
  319.          srl (hl)
  320.          srl (ix+-128)
  321.          srl (iy+127)
  322.          sub h'00
  323.          sub h'ff
  324.          sub a
  325.          sub l
  326.          sub (hl)
  327.          sub (ix+-128)
  328.          sub (iy+127)
  329.          xor h'00
  330.          xor h'ff
  331.          xor a
  332.          xor l
  333.          xor (hl)
  334.          xor (ix+-128)
  335.          xor (iy+127)
  336.  
  337. synctst1:
  338.          adc a,forward2
  339.          adc a,forward1
  340.          adc a,(ix+forward3)
  341.          adc a,(iy+forward4)
  342.          add a,forward2
  343.          add a,forward1
  344.          add a,(ix+forward3)
  345.          add a,(iy+forward4)
  346.          and forward2
  347.          and forward1
  348.          and (ix+forward3)
  349.          and (iy+forward4)
  350.          bit bit0,a
  351.          bit bit0,l
  352.          bit bit0,(hl)
  353.          bit bit0,(ix+forward3)
  354.          bit bit0,(iy+forward4)
  355.          bit bit7,a
  356.          bit bit7,l
  357.          bit bit7,(hl)
  358.          bit bit7,(ix+forward3)
  359.          bit bit7,(iy+forward4)
  360.          call forward2
  361.          call forward1
  362.          call longtest
  363.          call nz,forward2
  364.          call z,forward1
  365.          call nc,longtest
  366.          call c,longtest
  367.          call po,forward2
  368.          call pe,1000
  369.          call p,128
  370.          call m,0
  371.          cp forward2
  372.          cp forward1
  373.          cp (ix+forward3)
  374.          cp (iy+forward4)
  375.          dec (ix+forward3)
  376.          dec (iy+forward4)
  377.          in a,(forward2)
  378.          in a,(forward1)
  379.          inc (ix+forward3)
  380.          inc (iy+forward4)
  381.          jp forward2
  382.          jp forward1
  383.          jp longtest
  384.          jp nz,forward2
  385.          jp z,forward1
  386.          jp nc,longtest
  387.          jp c,longtest
  388.          jp po,forward2
  389.          jp pe,1000
  390.          jp p,128
  391.          jp m,0
  392.          ld a,(longtest)
  393.          ld a,(forward2)
  394.          ld a,(forward1)
  395.          ld ix,(forward2)
  396.          ld iy,(forward1)
  397.          ld ix,(longtest)
  398.          ld a,forward2
  399.          ld bc,forward2
  400.          ld sp,forward1
  401.          ld hl,longtest
  402.          ld hl,1000
  403.          ld ix,1000
  404.          ld iy,longtest
  405.          ld a,(ix+forward4)
  406.          ld l,(iy+forward3)
  407.          ld (1000),a
  408.          ld (longtest),a
  409.          ld (1000),hl
  410.          ld (longtest),hl
  411.          ld (1000),bc
  412.          ld (longtest),bc
  413.          ld (1000),ix
  414.          ld (longtest),iy
  415.          ld (hl),forward2
  416.          ld (hl),forward1
  417.          ld (ix+forward4),forward2
  418.          ld (ix+forward3),forward1
  419.          ld (ix+forward4),a
  420.          ld (iy+forward3),l
  421.          or forward2
  422.          or forward1
  423.          or (ix+forward3)
  424.          or (iy+forward4)
  425.          out (forward2),a
  426.          out (forward1),a
  427.          res bit0,a
  428.          res bit0,l
  429.          res bit0,(hl)
  430.          res bit0,(ix+forward3)
  431.          res bit0,(iy+forward4)
  432.          res bit7,a
  433.          res bit7,l
  434.          res bit7,(hl)
  435.          res bit7,(ix+forward3)
  436.          res bit7,(iy+forward4)
  437.          rl (ix+forward3)
  438.          rl (iy+forward4)
  439.          rlc (ix+forward3)
  440.          rlc (iy+forward4)
  441.          rr (ix+forward3)
  442.          rr (iy+forward4)
  443.          rrc (ix+forward3)
  444.          rrc (iy+forward4)
  445.          sbc a,forward2
  446.          sbc a,forward1
  447.          sbc a,(ix+forward3)
  448.          sbc a,(iy+forward4)
  449.          set bit0,a
  450.          set bit0,l
  451.          set bit0,(hl)
  452.          set bit0,(ix+forward3)
  453.          set bit0,(iy+forward4)
  454.          set bit7,a
  455.          set bit7,l
  456.          set bit7,(hl)
  457.          set bit7,(ix+forward3)
  458.          set bit7,(iy+forward4)
  459.          sla (ix+forward3)
  460.          sla (iy+forward4)
  461.          sra (ix+forward3)
  462.          sra (iy+forward4)
  463.          srl (ix+forward3)
  464.          srl (iy+forward4)
  465.          sub forward2
  466.          sub forward1
  467.          sub (ix+forward3)
  468.          sub (iy+forward4)
  469.          xor forward2
  470.          xor forward1
  471.          xor (ix+forward3)
  472.          xor (iy+forward4)
  473.  
  474. synctst2:
  475. longtest:.equ forward1,h'ff
  476.          .equ forward2,h'00
  477.          .equ forward3,-128
  478.          .equ forward4,127
  479.          .equ bit0,0
  480.          .equ bit7,7
  481.          .end
  482.