home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / tdl-tool.lbr / TA-TEST.AQM / TA-TEST.ASM
Assembly Source File  |  1985-11-30  |  14KB  |  278 lines

  1. ;
  2.     page    50    ;number of lines on page
  3.  
  4.     org    100h    ;TPA BASE
  5.     jmp    0    ;just incase somebody tries to run this
  6.  
  7.     title    'TASM test program & code explanations -- Alphabetic Listing'
  8.     pa        ;page eject
  9.  
  10.     JR    addr    ;JR    addr-$        Jump relative unconditional
  11.     BIT    3,B    ;BIT    3,B        Test bit # in register r (≥ ma∙ bσ B,C¼D,E¼H,L,A,M)
  12.     CCD        ;CPD            Compare A with m(HL), decrement HL and BC
  13.     CCI        ;CPI            Compare A with m(HL), increment HL, decrement BC
  14.     DCX    X    ;DEC    IX        Decrement IX
  15.     DCX    Y    ;DEC    IY        Decrement IY
  16.     EXX        ;EXX            Exchange BC DE HL with BC    DE    HL    
  17.     IM0        ;IM0            Set interrupt mode 0
  18.     IM1        ;IM1            Set interrupt mode 1
  19.     IM2        ;IM2            Set interrupt mode 2
  20.     IND        ;IND            Input from port (C) to m(HL), decrement HL & B
  21.     INI        ;INI            Input from port (C) to m(HL), increment HL, decrement B
  22.     INP    B    ;IN    B,(C)        Input from port C to register r (≥ ma∙ bσ B,C¼D,E¼H,L,A,M)
  23.     INX    X    ;INC    IX        Increment IX
  24.     INX    Y    ;INC    IY        Increment IY
  25.     JRC    addr    ;JR    C,addr-$    Jump relative if Carry indicator true
  26.     JRZ    addr    ;JR    Z,addr-$    Jump relative if Zero indicator true
  27.     LDD            ;LDD            Move m(HL) to m(DE), decrement HL, DE, and B
  28.     LDI            ;LDI            Move m(HL) to m(DE), increment DE and HL, decrement BC
  29.     LXI    X,nnnn    ;LD    IX,nnnn        Load IX immediate (16 bits)
  30.     LXI    X,nnnn    ;LD    IY,nnnn        Load IY immediate (16 bits)
  31.     NEG            ;NEG            Negate A (two    s complement)
  32.     POP    X       ;POP    IX        Pop IX from the stack
  33.     POP    Y       ;POP    IY        Pop IY from the stack
  34.     RES    3,B     ;RES    3,B        Reset bit # in register r (≥ ma∙ bσ B,C¼D,E¼H,L,A,M)
  35.     RLD        ;RLD            Rotate left digit
  36.     RRD        ;RRD            Rotate right digit
  37.     ADCX    dd    ;ADC    (IX+dd)        Indexed add with carry
  38.     ADCY    dd    ;ADC    (IY+dd)        Indexed add with carry
  39.     ADDX    dd    ;ADD    (IX+dd)        Indexed add to A
  40.     ADDY    dd    ;ADD    (IY+dd)        Indexed add to A
  41.     ANDX    dd    ;AND    (IX+dd)        Indexed logical and
  42.     ANDY    dd    ;AND    (IY+dd)        Indexed logical and
  43.     BITX    3,dd    ;BIT    3,(IX+dd)    Test bit # in memory at m(IX+dd)
  44.     BITY    3,dd    ;BIT    3,(IY+dd)    Test bit # in memory at m(IY+dd)
  45.     CCDR        ;CPDR            Repeat CCD until BC = 0 or A = m(HL)
  46.     CCIR        ;CPIR            Repeat CCI until BC = 0 or A = m(HL)
  47.     CMPX    dd    ;CP    (IX+dd)        Indexed compare
  48.     CMPY    dd    ;CP    (IY+dd)        Indexed compare
  49.     DADC    D    ;ADC    HL,DE        Add with carry rr to HL (r≥ ma∙ bσ BC¼ DE¼ SP)
  50.     DADX    D    ;AD─    IX,DE        AdΣ r≥ t∩ IX (r≥ ma∙ bσ BC¼ DE¼ SP¼ HL)
  51.     DADY    D    ;AD─    IY,DE        AdΣ r≥ t∩ IY (r≥ ma∙ bσ BC¼ DE¼ SP¼ HL)
  52.     DCRX    dd    ;DCR    (IX+dd)        Decrement memory at m(IX+dd)
  53.     DCRY    dd    ;DCR    (IY+dd)        Decrement memory at m(IY+dd)
  54.     DJNZ    addr    ;DJNZ    addr-$        Decrement B, jump relative if non-zero
  55.     DSBC    D    ;SBC    HL,DE        Subtract with "borrow" rr from HL (rr can be B,D,SP)
  56.     EXAF        ;EX    AF,AF        Exchange 'A' & Flags with alternates
  57.     INDR        ;INDR            Repeat IND until B = 0
  58.     INIR        ;INIR            Input from port (C) to m(HL), increment HL, decrement B until <> 0
  59.     INRX    dd    ;INC    (IX+dd)        Increment memory at m(IX+dd)
  60.     INRY    dd    ;INC    (IY+dd)        Increment memory at m(IY+dd)
  61.     JRNC    addr    ;JR    NC,addr-$    Jump relative if carry indicator false
  62.     JRNZ    addr    ;JR    NZ,addr-$    Jump relative if Zero indicator false
  63.     LBCD    nnnn    ;LD    BC,(nnnn)    Load BC direct (from memory at nnnn)
  64.     LDAI        ;LD    A,I        Move I to A
  65.     LDAR        ;LD    A,R        Move R to A
  66.     LDDR        ;LDDR            Repeat LDD until BC = 0
  67.     LDED    nnnn    ;LD    DE,(nnnn)    Load DE direct
  68.     LDIR        ;LDIR            Repeat LDI until BC = 0
  69.     LDIX    B,dd    ;LD    B,(IX+dd)    Load register from indexed memory (with IX)
  70.     LDIY    B,dd    ;LD    B,(IY+dd)    Load register from indexed memory (with IY)
  71.     LIXD    nnnn    ;LD    IX,(nnnn)    Load IX direct
  72.     LIYD    nnnn    ;LD    IY,(nnnn)    Load IY direct
  73.     LSPD    nnnn    ;LD    SP,(nnnn)    Load SP direct
  74.     MVIX    nn,dd    ;LD    (IX+dd),nn    Move immediate to indexed memory (with IX)
  75.     MVIY    nn,dd    ;LD    (IY+dd),nn    Move immediate to indexed memory (with IY)
  76.     ORIX    dd    ;OR    (IX+dd)        Indexed logical or
  77.     ORIY    dd    ;OR    (IY+dd)        Indexed logical or
  78.     OTDR        ;OTDR            Repeat OUTD until B = 0
  79.     OTIR        ;OTIR            Repeat OUTI until B = 0
  80.     OUTD        ;OTD            Output from m(HL) to port (C), decrement HL 
  81.     OUTI        ;OTI            Output from m(HL) to port (C), increment HL, decrement B
  82.     OUTP    B    ;OUT    (C),B        Output from register r to port (C) (≥ ma∙ bσ B,C¼D,E¼H,L,A,M)
  83.     PCIX        ;JMP    (IX)        Jump to address in IX ie, Load PC from IX
  84.     PCIY        ;JMP    (IY)        Jump to address in IY ie, Load PC from IY
  85.     PUSH    X    ;PUSH    IX        Push IX into the stack
  86.     PUSH    Y    ;PUSH    IY        Push IY into the stack
  87.     RALR    B    ;RL    B        Rotate left arithmetic register
  88.     RALX    dd    ;RL    (IX+dd)        Rotate left arithmetic indexed memory
  89.     RALY    dd    ;RL    (IY+dd)        Rotate left arithmetic indexed memory
  90.     RARR    B    ;RR    B        Rotate right arithmetic register
  91.     RARX    dd    ;RR    (IX+dd)        Rotate right arithmetic indexed memory
  92.     RARY    dd    ;RR    (IY+dd)        Rotate right arithmetic indexed memory
  93.     RESX    3,dd    ;RES    3,(IX+dd)    Reset bit # in memory at m(IX+dd)
  94.     RESY    3,dd    ;RES    3,(IY+dd)    Reset bit # in memory at m(IY+dd)
  95.     RETI        ;RETI            Return from interrupt
  96.     RETN        ;RETN            Return from non-maskable interrupt
  97.     RLCR    B    ;RLC    B        Rotate left circular register
  98.     RLCX    dd    ;RLC    (IX+dd)        Rotate left circular indexed memory
  99.     RLCY    dd    ;RLC    (IY+dd)        Rotate left circular indexed memory
  100.     RRCR    B    ;RRC    B        Rotate right circular register
  101.     RRCX    dd    ;RRC    (IX+dd)        Rotate right circular indexed
  102.     RRCY    dd    ;RRC    (IY+dd)        Rotate right circular indexed
  103.     SBCD    nnnn    ;LD    (nnnn),BC    Store BC direct (to memory at nnnn)
  104.     SBCX    dd    ;SBC    (IX+dd)        Indexed subtract with "borrow"
  105.     SBCY    dd    ;SBC    (IY+dd)        Indexed subtract with "borrow"
  106.     SDED    nnnn    ;LD    (nnnn),DE    Store DE direct
  107.     SETB    3,B    ;SET    3,B        Set bit # in register r (≥ ma∙ bσ B,C¼D,E¼H,L,A,M)
  108.     SETX    3,dd    ;SET    3,(IX+dd)    Set bit # in memory at m(IX+d)
  109.     SETY    3,dd    ;SET    3,(IY+dd)    Set bit # in memory at m(IY+d)
  110.     SIXD    nnnn    ;LD    (nnnn),IX    Store IX direct
  111.     SIXD    nnnn    ;LD    (nnnn),IX    Store IX direct
  112.     SIYD    nnnn    ;LD    (nnnn),IY    Store IY direct
  113.     SIYD    nnnn    ;LD    (nnnn),IY    Store IY direct
  114.     SLAR    B    ;SLA    B        Shift left register
  115.     SLAX    dd    ;SLA    (IX+dd)        Shift left indexed memory
  116.     SLAY    dd    ;SLA    (IY+dd)        Shift left indexed memory
  117.     SPIX        ;LD    SP,IX        Copy IX to the SP
  118.     SPIY        ;LD    SP,IY        Copy IY to the SP
  119.     SRAR    B    ;SRA    B        Shift right arithmetic register
  120.     SRAX    dd    ;SRA    (IX+dd)        Shift right arithmetic indexed memory
  121.     SRAY    dd    ;SRA    (IY+dd)        Shift right arithmetic indexed memory
  122.     SRLR    B    ;SRL    B        Shift right logical register
  123.     SRLX    dd    ;SRL    (IX+dd)        Shift right logical indexed memory
  124.     SRLY    dd    ;SRL    (IY+dd)        Shift right logical indexed memory
  125.     SSPD    nnnn    ;LD    (nnnn),SP    Store SP direct
  126.     STAI        ;LD    I,A        Move A to I
  127.     STAR        ;LD    R,A        Move A to R
  128.     STIX    B,dd    ;LD    (IX+dd),B    Store register to indexed memory (with IX)
  129.     STIY    B,dd    ;LD    (IY+dd),B    Store register to indexed memory (with IY)
  130.     SUBX    dd    ;SUB    (IX+sd)        Indexed subtract
  131.     SUBY    dd    ;SUB    (IY+sd)        Indexed subtract
  132.     XORX    dd    ;XOR    (IX+dd)        Indexed logical exclusive or
  133.     XORY    dd    ;XOR    (IY+dd)        Indexed logical exclusive or
  134.     XTIX        ;EX    (SP),IX        Exchange IX with the top of the stack
  135.     XTIY        ;EX    (SP),IY        Exchange IY with the top of the stack
  136.  
  137.     title    'TASM test program & code explanations -- Numeric Listing'
  138.     pa        ;page eject
  139.     EXAF        ;EX    AF,AF        Exchange 'A' & Flags with alternates
  140.     DJNZ    addr    ;DJNZ    addr-$        Decrement B, jump relative if non-zero
  141.     JR    addr    ;JR    addr-$        Jump relative unconditional
  142.     JRNZ    addr    ;JR    NZ,addr-$    Jump relative if Zero indicator false
  143.     JRZ    addr    ;JR    Z,addr-$    Jump relative if Zero indicator true
  144.     JRNC    addr    ;JR    NC,addr-$    Jump relative if carry indicator false
  145.     JRC    addr    ;JR    C,addr-$    Jump relative if Carry indicator true
  146.     RLCR    B    ;RLC    B        Rotate left circular register
  147.     RRCR    B    ;RRC    B        Rotate right circular register
  148.     RALR    B    ;RL    B        Rotate left arithmetic register
  149.     RARR    B    ;RR    B        Rotate right arithmetic register
  150.     SLAR    B    ;SLA    B        Shift left register
  151.     SRAR    B    ;SRA    B        Shift right arithmetic register
  152.     SRLR    B    ;SRL    B        Shift right logical register
  153.     BIT    3,B    ;BIT    3,B        Test bit # in register r (r may be B,C,D,E,H,L,A,M)
  154.     RES    3,B     ;RES    3,B        Reset bit # in register r (r may be B,C,D,E,H,L,A,M)
  155.     SETB    3,B    ;SET    3,B        Set bit # in register r (r may be B,C,D,E,H,L,A,M)
  156.     EXX        ;EXX            Exchange BC DE HL with BC    DE    HL    
  157.     DADX    D    ;ADD    IX,DE        Add rr to IX (rr may be BC, DE, SP, HL)
  158.     LXI    X,nnnn    ;LD    IX,nnnn        Load IX immediate (16 bits)
  159.     LXI    X,nnnn    ;LD    IY,nnnn        Load IY immediate (16 bits)
  160.     SIXD    nnnn    ;LD    (nnnn),IX    Store IX direct
  161.     SIXD    nnnn    ;LD    (nnnn),IX    Store IX direct
  162.     INX    X    ;INC    IX        Increment IX
  163.     LIXD    nnnn    ;LD    IX,(nnnn)    Load IX direct
  164.     DCX    X    ;DEC    IX        Decrement IX
  165.     INRX    dd    ;INC    (IX+dd)        Increment memory at m(IX+dd)
  166.     DCRX    dd    ;DCR    (IX+dd)        Decrement memory at m(IX+dd)
  167.     MVIX    nn,dd    ;LD    (IX+dd),nn    Move immediate to indexed memory (with IX)
  168.     LDIX    B,dd    ;LD    B,(IX+dd)    Load register from indexed memory (with IX)
  169.     STIX    B,dd    ;LD    (IX+dd),B    Store register to indexed memory (with IX)
  170.     ADDX    dd    ;ADD    (IX+dd)        Indexed add to A
  171.     ADCX    dd    ;ADC    (IX+dd)        Indexed add with carry
  172.     SUBX    dd    ;SUB    (IX+sd)        Indexed subtract
  173.     SBCX    dd    ;SBC    (IX+dd)        Indexed subtract with "borrow"
  174.     ANDX    dd    ;AND    (IX+dd)        Indexed logical and
  175.     XORX    dd    ;XOR    (IX+dd)        Indexed logical exclusive or
  176.     ORIX    dd    ;OR    (IX+dd)        Indexed logical or
  177.     CMPX    dd    ;CP    (IX+dd)        Indexed compare
  178.     BITX    3,dd    ;BIT    3,(IX+dd)    Test bit # in memory at m(IX+dd)
  179.     RALX    dd    ;RL    (IX+dd)        Rotate left arithmetic indexed memory
  180.     RARX    dd    ;RR    (IX+dd)        Rotate right arithmetic indexed memory
  181.     RESX    3,dd    ;RES    3,(IX+dd)    Reset bit # in memory at m(IX+dd)
  182.     RLCX    dd    ;RLC    (IX+dd)        Rotate left circular indexed memory
  183.     RRCX    dd    ;RRC    (IX+dd)        Rotate right circular indexed
  184.     SETX    3,dd    ;SET    3,(IX+dd)    Set bit # in memory at m(IX+d)
  185.     SLAX    dd    ;SLA    (IX+dd)        Shift left indexed memory
  186.     SRAX    dd    ;SRA    (IX+dd)        Shift right arithmetic indexed memory
  187.     SRLX    dd    ;SRL    (IX+dd)        Shift right logical indexed memory
  188.     POP    X       ;POP    IX        Pop IX from the stack
  189.     XTIX        ;EX    (SP),IX        Exchange IX with the top of the stack
  190.     PUSH    X    ;PUSH    IX        Push IX into the stack
  191.     PCIX        ;JMP    (IX)        Jump to address in IX ie, Load PC from IX
  192.     SPIX        ;LD    SP,IX        Copy IX to the SP
  193.     INP    B    ;IN    B,(C)        Input from port C to register r (r may be B,C,D,E,H,L,A,M)
  194.     OUTP    B    ;OUT    (C),B        Output from register r to port (C) (r may be B,C,D,E,H,L,A,M)
  195.     SBCD    nnnn    ;LD    (nnnn),BC    Store BC direct (to memory at nnnn)
  196.     NEG            ;NEG            Negate A (two    s complement)
  197.     RETN        ;RETN            Return from non-maskable interrupt
  198.     IM0        ;IM0            Set interrupt mode 0
  199.     STAI        ;LD    I,A        Move A to I
  200.     LBCD    nnnn    ;LD    BC,(nnnn)    Load BC direct (from memory at nnnn)
  201.     RETI        ;RETI            Return from interrupt
  202.     STAR        ;LD    R,A        Move A to R
  203.     DSBC    D    ;SBC    HL,DE        Subtract with "borrow" rr from HL (rr can be B,D,SP)
  204.     SDED    nnnn    ;LD    (nnnn),DE    Store DE direct
  205.     IM1        ;IM1            Set interrupt mode 1
  206.     LDAI        ;LD    A,I        Move I to A
  207.     DADC    D    ;ADC    HL,DE        Add with carry rr to HL (rr may be BC, DE, SP)
  208.     LDED    nnnn    ;LD    DE,(nnnn)    Load DE direct
  209.     IM2        ;IM2            Set interrupt mode 2
  210.     LDAR        ;LD    A,R        Move R to A
  211.     RRD        ;RRD            Rotate right digit
  212.     RLD        ;RLD            Rotate left digit
  213.     SSPD    nnnn    ;LD    (nnnn),SP    Store SP direct
  214.     LSPD    nnnn    ;LD    SP,(nnnn)    Load SP direct
  215.     LDI            ;LDI            Move m(HL) to m(DE), increment DE and HL, decrement BC
  216.     CCI        ;CPI            Compare A with m(HL), increment HL, decrement BC
  217.     INI        ;INI            Input from port (C) to m(HL), increment HL, decrement B
  218.     OUTI        ;OTI            Output from m(HL) to port (C), increment HL, decrement B
  219.     LDD            ;LDD            Move m(HL) to m(DE), decrement HL, DE, and B
  220.     CCD        ;CPD            Compare A with m(HL), decrement HL and BC
  221.     IND        ;IND            Input from port (C) to m(HL), decrement HL & B
  222.     OUTD        ;OTD            Output from m(HL) to port (C), decrement HL 
  223.     LDIR        ;LDIR            Repeat LDI until BC = 0
  224.     CCIR        ;CPIR            Repeat CCI until BC = 0 or A = m(HL)
  225.     INIR        ;INIR            Input from port (C) to m(HL), increment HL, decrement B until <> 0
  226.     OTIR        ;OTIR            Repeat OUTI until B = 0
  227.     LDDR        ;LDDR            Repeat LDD until BC = 0
  228.     CCDR        ;CPDR            Repeat CCD until BC = 0 or A = m(HL)
  229.     INDR        ;INDR            Repeat IND until B = 0
  230.     OTDR        ;OTDR            Repeat OUTD until B = 0
  231.     DADY    D    ;ADD    IY,DE        Add rr to IY (rr may be BC, DE, SP, HL)
  232.     SIYD    nnnn    ;LD    (nnnn),IY    Store IY direct
  233.     SIYD    nnnn    ;LD    (nnnn),IY    Store IY direct
  234.     INX    Y    ;INC    IY        Increment IY
  235.     LIYD    nnnn    ;LD    IY,(nnnn)    Load IY direct
  236.     DCX    Y    ;DEC    IY        Decrement IY
  237.     INRY    dd    ;INC    (IY+dd)        Increment memory at m(IY+dd)
  238.     DCRY    dd    ;DCR    (IY+dd)        Decrement memory at m(IY+dd)
  239.     MVIY    nn,dd    ;LD    (IY+dd),nn    Move immediate to indexed memory (with IY)
  240.     LDIY    B,dd    ;LD    B,(IY+dd)    Load register from indexed memory (with IY)
  241.     STIY    B,dd    ;LD    (IY+dd),B    Store register to indexed memory (with IY)
  242.     ADDY    dd    ;ADD    (IY+dd)        Indexed add to A
  243.     ADCY    dd    ;ADC    (IY+dd)        Indexed add with carry
  244.     SUBY    dd    ;SUB    (IY+sd)        Indexed subtract
  245.     SBCY    dd    ;SBC    (IY+dd)        Indexed subtract with "borrow"
  246.     ANDY    dd    ;AND    (IY+dd)        Indexed logical and
  247.     XORY    dd    ;XOR    (IY+dd)        Indexed logical exclusive or
  248.     ORIY    dd    ;OR    (IY+dd)        Indexed logical or
  249.     CMPY    dd    ;CP    (IY+dd)        Indexed compare
  250.     SLAY    dd    ;SLA    (IY+dd)        Shift left indexed memory
  251.     RESY    3,dd    ;RES    3,(IY+dd)    Reset bit # in memory at m(IY+dd)
  252.     BITY    3,dd    ;BIT    3,(IY+dd)    Test bit # in memory at m(IY+dd)
  253.     SETY    3,dd    ;SET    3,(IY+dd)    Set bit # in memory at m(IY+d)
  254.     RARY    dd    ;RR    (IY+dd)        Rotate right arithmetic indexed memory
  255.     RRCY    dd    ;RRC    (IY+dd)        Rotate right circular indexed
  256.     RALY    dd    ;RL    (IY+dd)        Rotate left arithmetic indexed memory
  257.     SRLY    dd    ;SRL    (IY+dd)        Shift right logical indexed memory
  258.     SRAY    dd    ;SRA    (IY+dd)        Shift right arithmetic indexed memory
  259.     RLCY    dd    ;RLC    (IY+dd)        Rotate left circular indexed memory
  260.     POP    Y       ;POP    IY        Pop IY from the stack
  261.     XTIY        ;EX    (SP),IY        Exchange IY with the top of the stack
  262.     PUSH    Y    ;PUSH    IY        Push IY into the stack
  263.     PCIY        ;JMP    (IY)        Jump to address in IY ie, Load PC from IY
  264.     SPIY        ;LD    SP,IY        Copy IY to the SP
  265.  
  266.  
  267. addr:    equ    00160h    ;H is for hexidecimal 
  268. nnnn:    equ    65535d    ;D is for decimal
  269. nn:    equ    185    ;(default is also decimal)
  270. dd:    equ    077q    ;Q and O are octal
  271.  
  272. DOLLARS$ARE$NICE:    ;Dollar signs are invisible in labels..
  273. DOTS.ARE.OKAY:        ;.. so are dots...
  274. UNDER_SCORES_TOO:    ;... and underscores...
  275. U$CN.EVN.MX_UM:        ; ... you can even mix them.
  276.  
  277.     end
  278.