OpenCores
URL https://opencores.org/ocsvn/a-z80/a-z80/trunk

Subversion Repositories a-z80

[/] [a-z80/] [trunk/] [tools/] [zmac/] [zexdoc.asm] - Blame information for rev 17

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gdevic
        title   'Z80 instruction set exerciser'
2
 
3
; zexdoc.src - Z80 documented instruction set exerciser
4
; Original Copyright (C) 1994  Frank D. Cringle
5
; Changes at 03-Nov-2002 Copyright (C) 2002 J.G.Harston
6
; + Source syntax tweeked to assemble with ZMAC Z80 Macro Assembler
7
;   and MAXAM Assembler, marked in the source with 'jgh:'
8
; + labels on equates mustn't have trailing colon
9
; + macros don't understand <...> sequence, so parameters are passed
10
;   explicitly
11
; + ds n,c not supported, so strings are set to full explicity length
12
;
13
; This program is free software; you can redistribute it and/or
14
; modify it under the terms of the GNU General Public License
15
; as published by the Free Software Foundation; either version 2
16
; of the License, or (at your option) any later version.
17
;
18
; This program is distributed in the hope that it will be useful,
19
; but WITHOUT ANY WARRANTY; without even the implied warranty of
20
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
; GNU General Public License for more details.
22
;
23
; You should have received a copy of the GNU General Public License
24
; along with this program; if not, write to the Free Software
25
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
 
27
        aseg
28
 
29
;
30
; Boot code for the A-Z80 CPU FPGA implementation
31
;
32
    org 0
33
start:
34
    jmp boot
35
 
36
    ; BDOS entry point for various functions
37
    ; We implement subfunctions:
38
    ;  C=2  Print a character given in E
39
    ;  C=9  Print a string pointed to by DE; string ends with '$'
40
    org 5
41
    ld  a,c
42
    cp  a,2
43
    jz  bdos_ascii
44
    cp  a,9
45
    jz  bdos_msg
46
    ret
47
 
48
bdos_ascii:
49
    ld  bc,10*256   ; Port to check for busy
50
    in  a,(c)       ; Poll until the port is not busy
51
    bit 0,a
52
    jnz bdos_ascii
53
    ld  bc,8*256    ; Port to write a character out
54
    out (c),e
55
    ret
56
 
57
bdos_msg:
58
    push de
59
    pop hl
60
lp0:
61
    ld  e,(hl)
62
    ld  a,e
63
    cp  a,'$'
64
    ret z
65
    call bdos_ascii
66
    inc hl
67
    jmp lp0
68
 
69
;---------------------------------------------------------------------
70
; RST38 (also INT M0)  handler
71
;---------------------------------------------------------------------
72
    org 038h
73
    push de
74
    ld  de,int_msg
75
int_common:
76
    push af
77
    push bc
78
    push hl
79
    ld  c,9
80
    call 5
81
    pop hl
82
    pop bc
83
    pop af
84
    pop de
85
    ei
86
    reti
87
int_msg:
88
    db  "_INT_",'$'
89
 
90
;---------------------------------------------------------------------
91
; NMI handler
92
;---------------------------------------------------------------------
93
    org 066h
94
    push af
95
    push bc
96
    push de
97
    push hl
98
    ld  de,nmi_msg
99
    ld  c,9
100
    call 5
101
    pop hl
102
    pop de
103
    pop bc
104
    pop af
105
    retn
106
nmi_msg:
107
    db  "_NMI_",'$'
108
 
109
;---------------------------------------------------------------------
110
; IM2 vector address and the handler (to push 0x80 by the IORQ)
111
;---------------------------------------------------------------------
112
    org 080h
113
    dw  im2_handler
114
im2_handler:
115
    push de
116
    ld  de,int_im2_msg
117
    jmp int_common
118
int_im2_msg:
119
    db  "_IM2_",'$'
120
 
121
boot:
122
    ; Set the stack pointer
123
    ld  sp, 16384   ; 16 Kb of RAM
124
    ; Jump into the executable at 100h
125
    jmp 100h
126
 
127
        org     100h
128
 
129
        jp      start100
130
 
131
; machine state before test (needs to be at predictably constant address)
132
msbt:   ds      14
133
spbt:   ds      2
134
msbthi  equ     msbt / 0100h
135
msbtlo  equ     msbt & 0ffh
136
 
137
 
138
; For the purposes of this test program, the machine state consists of:
139
;       a 2 byte memory operand, followed by
140
;       the registers iy,ix,hl,de,bc,af,sp
141
; for a total of 16 bytes.
142
 
143
; The program tests instructions (or groups of similar instructions)
144
; by cycling through a sequence of machine states, executing the test
145
; instruction for each one and running a 32-bit crc over the resulting
146
; machine states.  At the end of the sequence the crc is compared to
147
; an expected value that was found empirically on a real Z80.
148
 
149
; A test case is defined by a descriptor which consists of:
150
;       a flag mask byte,
151
;       the base case,
152
;       the incement vector,
153
;       the shift vector,
154
;       the expected crc,
155
;       a short descriptive message.
156
;
157
; The flag mask byte is used to prevent undefined flag bits from
158
; influencing the results.  Documented flags are as per Mostek Z80
159
; Technical Manual.
160
;
161
; The next three parts of the descriptor are 20 byte vectors
162
; corresponding to a 4 byte instruction and a 16 byte machine state.
163
; The first part is the base case, which is the first test case of
164
; the sequence.  This base is then modified according to the next 2
165
; vectors.  Each 1 bit in the increment vector specifies a bit to be
166
; cycled in the form of a binary counter.  For instance, if the byte
167
; corresponding to the accumulator is set to 0ffh in the increment
168
; vector, the test will be repeated for all 256 values of the
169
; accumulator.  Note that 1 bits don't have to be contiguous.  The
170
; number of test cases 'caused' by the increment vector is equal to
171
; 2^(number of 1 bits).  The shift vector is similar, but specifies a
172
; set of bits in the test case that are to be successively inverted.
173
; Thus the shift vector 'causes' a number of test cases equal to the
174
; number of 1 bits in it.
175
 
176
; The total number of test cases is the product of those caused by the
177
; counter and shift vectors and can easily become unweildy.  Each
178
; individual test case can take a few milliseconds to execute, due to
179
; the overhead of test setup and crc calculation, so test design is a
180
; compromise between coverage and execution time.
181
 
182
; This program is designed to detect differences between
183
; implementations and is not ideal for diagnosing the causes of any
184
; discrepancies.  However, provided a reference implementation (or
185
; real system) is available, a failing test case can be isolated by
186
; hand using a binary search of the test space.
187
 
188
 
189
start100:       ld      hl,(6)
190
        ;ld     sp,hl
191
        ld      de,msg1
192
        ld      c,9
193
        call    bdos
194
 
195
        ld      hl,tests        ; first test case
196
loop:   ld      a,(hl)          ; end of list ?
197
        inc     hl
198
        or      (hl)
199
        jp      z,done
200
        dec     hl
201
        call    stt
202
        jp      loop
203
 
204
done:   ld      de,msg2
205
        ld      c,9
206
        call    bdos
207
die: jr die
208
        jp      0                ; warm boot
209
 
210
tests:
211
        dw      adc16
212
        dw      add16
213
        dw      add16x
214
        dw      add16y
215
        dw      alu8i
216
;       dw      alu8r   ; takes _very_long_ time, but it passes!
217
        dw      alu8rx
218
        dw      alu8x
219
        dw      bitx
220
        dw      bitz80
221
        dw      cpd1
222
        dw      cpi1
223
        dw      daaop   ; can't use opcode as label
224
        dw      inca
225
        dw      incb
226
        dw      incbc
227
        dw      incc
228
        dw      incd
229
        dw      incde
230
        dw      ince
231
        dw      inch
232
        dw      inchl
233
        dw      incix
234
        dw      inciy
235
        dw      incl
236
        dw      incm
237
        dw      incsp
238
        dw      incx
239
        dw      incxh
240
        dw      incxl
241
        dw      incyh
242
        dw      incyl
243
        dw      ld161
244
        dw      ld162
245
        dw      ld163
246
        dw      ld164
247
        dw      ld165
248
        dw      ld166
249
        dw      ld167
250
        dw      ld168
251
        dw      ld16im
252
        dw      ld16ix
253
        dw      ld8bd
254
        dw      ld8im
255
        dw      ld8imx
256
        dw      ld8ix1
257
        dw      ld8ix2
258
        dw      ld8ix3
259
        dw      ld8ixy
260
        dw      ld8rr
261
        dw      ld8rrx
262
        dw      lda
263
        dw      ldd1
264
        dw      ldd2
265
        dw      ldi1
266
        dw      ldi2
267
        dw      negop   ; jgh: can't use opcode as label
268
        dw      rldop   ; jgh: can't use opcode as label
269
        dw      rot8080
270
        dw      rotxy
271
        dw      rotz80
272
        dw      srz80
273
        dw      srzx
274
        dw      st8ix1
275
        dw      st8ix2
276
        dw      st8ix3
277
        dw      stabd
278
        dw      0
279
 
280
; jgh: macro syntax changed for ZMAC and MAXAM
281
;       can't use opcodes as labels
282
;       ZMAC allows &nn as hex, so & removed from local labels
283
;
284
tstr    macro   insn1,insn2,insn3,insn4,memop,riy,rix,rhl,rde,rbc,flags,acc,rsp,?lab
285
?lab:   db      insn1,insn2,insn3,insn4
286
        dw      memop,riy,rix,rhl,rde,rbc
287
        db      flags
288
        db      acc
289
        dw      rsp
290
        if      $-?lab ne 20
291
        error   'missing parameter'
292
        endif
293
        endm
294
 
295
tmsg    macro   msg,?lab
296
?lab:   db      'msg'
297
        if      $ ge ?lab+31
298
        error   'message too long'
299
        else
300
;       ds      ?lab+30-$,'.'   ; jgh: ZMAC/MAXAM don't have char parameter
301
        endif
302
        db      '$'
303
        endm
304
 
305
; jgh: ZMAC/MAXAM don't recognise  syntax for macros, so full parameters given
306
; jgh: each tmsg has full string, as ZMAC/MAXAM don't have ds n,c pseudo-op
307
 
308
;  hl, (38,912 cycles)
309
adc16:  db      0c7h            ; flag mask
310
        tstr    0edh,042h,0,0,0832ch,04f88h,0f22bh,0b339h,07e1fh,01563h,0d3h,089h,0465eh
311
        tstr    0,038h,0,0,0,0,0,0f821h,0,0,0,0,0       ; (1024 cycles)
312
        tstr    0,0,0,0,0,0,0,-1,-1,-1,0d7h,0,-1        ; (38 cycles)
313
        db      0f8h,0b4h,0eah,0a9h                     ; expected crc
314
        tmsg    ' hl,....'
315
 
316
; add hl, (19,456 cycles)
317
add16:  db      0c7h            ; flag mask
318
        tstr    9,0,0,0,0c4a5h,0c4c7h,0d226h,0a050h,058eah,08566h,0c6h,0deh,09bc9h
319
        tstr    030h,0,0,0,0,0,0,0f821h,0,0,0,0,0       ; (512 cycles)
320
        tstr    0,0,0,0,0,0,0,-1,-1,-1,0d7h,0,-1        ; (38 cycles)
321
        db      089h,0fdh,0b6h,035h                     ; expected crc
322
        tmsg    'add hl,..........'
323
 
324
; add ix, (19,456 cycles)
325
add16x: db      0c7h            ; flag mask
326
        tstr    0ddh,9,0,0,0ddach,0c294h,0635bh,033d3h,06a76h,0fa20h,094h,068h,036f5h
327
        tstr    0,030h,0,0,0,0,0f821h,0,0,0,0,0,0       ; (512 cycles)
328
        tstr    0,0,0,0,0,0,-1,0,-1,-1,0d7h,0,-1        ; (38 cycles)
329
        db      0c1h,033h,079h,00bh                     ; expected crc
330
        tmsg    'add ix,..........'
331
 
332
; add iy, (19,456 cycles)
333
add16y: db      0c7h            ; flag mask
334
        tstr    0fdh,9,0,0,0c7c2h,0f407h,051c1h,03e96h,00bf4h,0510fh,092h,01eh,071eah
335
        tstr    0,030h,0,0,0,0f821h,0,0,0,0,0,0,0       ; (512 cycles)
336
        tstr    0,0,0,0,0,-1,0,0,-1,-1,0d7h,0,-1                ; (38 cycles)
337
        db      0e8h,081h,07bh,09eh                     ; expected crc
338
        tmsg    'add iy,..........'
339
 
340
; aluop a,nn (28,672 cycles)
341
alu8i:  db      0d7h            ; flag mask
342
        tstr    0c6h,0,0,0,009140h,07e3ch,07a67h,0df6dh,05b61h,00b29h,010h,066h,085b2h
343
        tstr    038h,0,0,0,0,0,0,0,0,0,0,-1,0           ; (2048 cycles)
344
        tstr    0,-1,0,0,0,0,0,0,0,0,0d7h,0,0           ; (14 cycles)
345
        db      048h,079h,093h,060h                     ; expected crc
346
        tmsg    'aluop a,nn....................'
347
 
348
; aluop a, (753,664 cycles)
349
alu8r:  db      0d7h            ; flag mask
350
        tstr    080h,0,0,0,0c53eh,0573ah,04c4dh,msbt,0e309h,0a666h,0d0h,03bh,0adbbh
351
        tstr    03fh,0,0,0,0,0,0,0,0,0,0,-1,0           ; (16,384 cycles)
352
        tstr    0,0,0,0,0ffh,0,0,0,-1,-1,0d7h,0,0       ; (46 cycles)
353
        db      0feh,043h,0b0h,016h                     ; expected crc
354
        tmsg    'aluop a,..'
355
 
356
; aluop a, (376,832 cycles)
357
alu8rx: db      0d7h            ; flag mask
358
        tstr    0ddh,084h,0,0,0d6f7h,0c76eh,0accfh,02847h,022ddh,0c035h,0c5h,038h,0234bh
359
        tstr    020h,039h,0,0,0,0,0,0,0,0,0,-1,0        ; (8,192 cycles)
360
        tstr    0,0,0,0,0ffh,0,0,0,-1,-1,0d7h,0,0       ; (46 cycles)
361
        db      0a4h,002h,06dh,05ah                     ; expected crc
362
        tmsg    'aluop a,.....'
363
 
364
; aluop a,(+1) (229,376 cycles)
365
alu8x:  db      0d7h            ; flag mask
366
        tstr    0ddh,086h,1,0,090b7h,msbt-1,msbt-1,032fdh,0406eh,0c1dch,045h,06eh,0e5fah
367
        tstr    020h,038h,0,0,0,1,1,0,0,0,0,-1,0        ; (16,384 cycles)
368
        tstr    0,0,0,0,0ffh,0,0,0,0,0,0d7h,0,0         ; (14 cycles)
369
        db      0e8h,049h,067h,06eh                     ; expected crc
370
        tmsg    'aluop a,(+1)...........'
371
 
372
; bit n,(+1) (2048 cycles)
373
bitx:   db      053h            ; flag mask
374
        tstr    0ddh,0cbh,1,046h,02075h,msbt-1,msbt-1,03cfch,0a79ah,03d74h,051h,027h,0ca14h
375
        tstr    020h,0,0,038h,0,0,0,0,0,0,053h,0,0      ; (256 cycles)
376
        tstr    0,0,0,0,0ffh,0,0,0,0,0,0,0,0            ; (8 cycles)
377
        db      0a8h,0eeh,008h,067h                     ; expected crc
378
        tmsg    'bit n,(+1).............'
379
 
380
; bit n, (49,152 cycles)
381
bitz80: db      053h            ; flag mask
382
        tstr    0cbh,040h,0,0,03ef1h,09dfch,07acch,msbt,0be61h,07a86h,050h,024h,01998h
383
        tstr    0,03fh,0,0,0,0,0,0,0,0,053h,0,0         ; (1024 cycles)
384
        tstr    0,0,0,0,0ffh,0,0,0,-1,-1,0,-1,0         ; (48 cycles)
385
        db      07bh,055h,0e6h,0c8h                     ; expected crc
386
        tmsg    'bit n,....'
387
 
388
; cpd (1) (6144 cycles)
389
cpd1:   db      0d7h            ; flag mask
390
        tstr    0edh,0a9h,0,0,0c7b6h,072b4h,018f6h,msbt+17,08dbdh,1,0c0h,030h,094a3h
391
        tstr    0,010h,0,0,0,0,0,0,0,010,0,-1,0         ; (1024 cycles)
392
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
393
        db      0a8h,07eh,06ch,0fah                     ; expected crc
394
        tmsg    'cpd........................'
395
 
396
; cpi (1) (6144 cycles)
397
cpi1:   db      0d7h            ; flag mask
398
        tstr    0edh,0a1h,0,0,04d48h,0af4ah,0906bh,msbt,04e71h,1,093h,06ah,0907ch
399
        tstr    0,010h,0,0,0,0,0,0,0,010,0,-1,0         ; (1024 cycles)
400
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
401
        db      006h,0deh,0b3h,056h                     ; expected crc
402
        tmsg    'cpi........................'
403
 
404
; 
405
daaop:  db      0d7h            ; flag mask
406
        tstr    027h,0,0,0,02141h,009fah,01d60h,0a559h,08d5bh,09079h,004h,08eh,0299dh
407
        tstr    018h,0,0,0,0,0,0,0,0,0,0d7h,-1,0        ; (65,536 cycles)
408
        tstr    0,0,0,0,0,0,0,0,0,0,0,0,0               ; (1 cycle)
409
        db      09bh,04bh,0a6h,075h                     ; expected crc
410
        tmsg    '.............'
411
 
412
;  a (3072 cycles)
413
inca:   db      0d7h            ; flag mask
414
        tstr    03ch,0,0,0,04adfh,0d5d8h,0e598h,08a2bh,0a7b0h,0431bh,044h,05ah,0d030h
415
        tstr    001h,0,0,0,0,0,0,0,0,0,0,-1,0           ; (512 cycles)
416
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
417
        db      0d1h,088h,015h,0a4h                     ; expected crc
418
        tmsg    ' a...................'
419
 
420
;  b (3072 cycles)
421
incb:   db      0d7h            ; flag mask
422
        tstr    004h,0,0,0,0d623h,0432dh,07a61h,08180h,05a86h,01e85h,086h,058h,09bbbh
423
        tstr    001h,0,0,0,0,0,0,0,0,0ff00h,0,0,0       ; (512 cycles)
424
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
425
        db      05fh,068h,022h,064h                     ; expected crc
426
        tmsg    ' b...................'
427
 
428
;  bc (1536 cycles)
429
incbc:  db      0d7h            ; flag mask
430
        tstr    003h,0,0,0,0cd97h,044abh,08dc9h,0e3e3h,011cch,0e8a4h,002h,049h,02a4dh
431
        tstr    008h,0,0,0,0,0,0,0,0,0f821h,0,0,0       ; (256 cycles)
432
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
433
        db      0d2h,0aeh,03bh,0ech                     ; expected crc
434
        tmsg    ' bc..................'
435
 
436
;  c (3072 cycles)
437
incc:   db      0d7h            ; flag mask
438
        tstr    00ch,0,0,0,0d789h,00935h,0055bh,09f85h,08b27h,0d208h,095h,005h,00660h
439
        tstr    001h,0,0,0,0,0,0,0,0,0ffh,0,0,0         ; (512 cycles)
440
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
441
        db      0c2h,084h,055h,04ch                     ; expected crc
442
        tmsg    ' c...................'
443
 
444
;  d (3072 cycles)
445
incd:   db      0d7h            ; flag mask
446
        tstr    014h,0,0,0,0a0eah,05fbah,065fbh,0981ch,038cch,0debch,043h,05ch,003bdh
447
        tstr    001h,0,0,0,0,0,0,0,0ff00h,0,0,0,0       ; (512 cycles)
448
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
449
        db      045h,023h,0deh,010h                     ; expected crc
450
        tmsg    ' d...................'
451
 
452
;  de (1536 cycles)
453
incde:  db      0d7h            ; flag mask
454
        tstr    013h,0,0,0,0342eh,0131dh,028c9h,00acah,09967h,03a2eh,092h,0f6h,09d54h
455
        tstr    008h,0,0,0,0,0,0,0,0f821h,0,0,0,0       ; (256 cycles)
456
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
457
        db      0aeh,0c6h,0d4h,02ch                     ; expected crc
458
        tmsg    ' de..................'
459
 
460
;  e (3072 cycles)
461
ince:   db      0d7h            ; flag mask
462
        tstr    01ch,0,0,0,0602fh,04c0dh,02402h,0e2f5h,0a0f4h,0a10ah,013h,032h,05925h
463
        tstr    001h,0,0,0,0,0,0,0,0ffh,0,0,0,0         ; (512 cycles)
464
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
465
        db      0e1h,075h,0afh,0cch                     ; expected crc
466
        tmsg    ' e...................'
467
 
468
;  h (3072 cycles)
469
inch:   db      0d7h            ; flag mask
470
        tstr    024h,0,0,0,01506h,0f2ebh,0e8ddh,0262bh,011a6h,0bc1ah,017h,006h,02818h
471
        tstr    001h,0,0,0,0,0,0,0ff00h,0,0,0,0,0       ; (512 cycles)
472
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
473
        db      01ch,0edh,084h,07dh                     ; expected crc
474
        tmsg    ' h...................'
475
 
476
;  hl (1536 cycles)
477
inchl:  db      0d7h            ; flag mask
478
        tstr    023h,0,0,0,0c3f4h,007a5h,01b6dh,04f04h,0e2c2h,0822ah,057h,0e0h,0c3e1h
479
        tstr    008h,0,0,0,0,0,0,0f821h,0,0,0,0,0       ; (256 cycles)
480
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
481
        db      0fch,00dh,06dh,04ah                     ; expected crc
482
        tmsg    ' hl..................'
483
 
484
;  ix (1536 cycles)
485
incix:  db      0d7h            ; flag mask
486
        tstr    0ddh,023h,0,0,0bc3ch,00d9bh,0e081h,0adfdh,09a7fh,096e5h,013h,085h,00be2h
487
        tstr    0,8,0,0,0,0,0f821h,0,0,0,0,0,0          ; (256 cycles)
488
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
489
        db      0a5h,04dh,0beh,031h                     ; expected crc
490
        tmsg    ' ix..................'
491
 
492
;  iy (1536 cycles)
493
inciy:  db      0d7h            ; flag mask
494
        tstr    0fdh,023h,0,0,09402h,0637ah,03182h,0c65ah,0b2e9h,0abb4h,016h,0f2h,06d05h
495
        tstr    0,8,0,0,0,0f821h,0,0,0,0,0,0,0          ; (256 cycles)
496
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
497
        db      050h,05dh,051h,0a3h                     ; expected crc
498
        tmsg    ' iy..................'
499
 
500
;  l (3072 cycles)
501
incl:   db      0d7h            ; flag mask
502
        tstr    02ch,0,0,0,08031h,0a520h,04356h,0b409h,0f4c1h,0dfa2h,0d1h,03ch,03ea2h
503
        tstr    001h,0,0,0,0,0,0,0ffh,0,0,0,0,0         ; (512 cycles)
504
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
505
        db      056h,0cdh,006h,0f3h                     ; expected crc
506
        tmsg    ' l...................'
507
 
508
;  (hl) (3072 cycles)
509
incm:   db      0d7h            ; flag mask
510
        tstr    034h,0,0,0,0b856h,00c7ch,0e53eh,msbt,0877eh,0da58h,015h,05ch,01f37h
511
        tstr    001h,0,0,0,0ffh,0,0,0,0,0,0,0,0         ; (512 cycles)
512
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
513
        db      0b8h,03ah,0dch,0efh                     ; expected crc
514
        tmsg    ' (hl)................'
515
 
516
;  sp (1536 cycles)
517
incsp:  db      0d7h            ; flag mask
518
        tstr    033h,0,0,0,0346fh,0d482h,0d169h,0deb6h,0a494h,0f476h,053h,002h,0855bh
519
        tstr    008h,0,0,0,0,0,0,0,0,0,0,0,0f821h       ; (256 cycles)
520
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
521
        db      05dh,0ach,0d5h,027h                     ; expected crc
522
        tmsg    ' sp..................'
523
 
524
;  (+1) (6144 cycles)
525
incx:   db      0d7h            ; flag mask
526
        tstr    0ddh,034h,1,0,0fa6eh,msbt-1,msbt-1,02c28h,08894h,05057h,016h,033h,0286fh
527
        tstr    020h,1,0,0,0ffh,0,0,0,0,0,0,0,0         ; (1024 cycles)
528
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
529
        db      020h,058h,014h,070h                     ; expected crc
530
        tmsg    ' (+1).........'
531
 
532
;  ixh (3072 cycles)
533
incxh:  db      0d7h            ; flag mask
534
        tstr    0ddh,024h,0,0,0b838h,0316ch,0c6d4h,03e01h,08358h,015b4h,081h,0deh,04259h
535
        tstr    0,1,0,0,0,0ff00h,0,0,0,0,0,0,0          ; (512 cycles)
536
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
537
        db      06fh,046h,036h,062h                     ; expected crc
538
        tmsg    ' ixh.................'
539
 
540
;  ixl (3072 cycles)
541
incxl:  db      0d7h            ; flag mask
542
        tstr    0ddh,02ch,0,0,04d14h,07460h,076d4h,006e7h,032a2h,0213ch,0d6h,0d7h,099a5h
543
        tstr    0,1,0,0,0,0ffh,0,0,0,0,0,0,0            ; (512 cycles)
544
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
545
        db      002h,07bh,0efh,02ch                     ; expected crc
546
        tmsg    ' ixl.................'
547
 
548
;  iyh (3072 cycles)
549
incyh:  db      0d7h            ; flag mask
550
        tstr    0ddh,024h,0,0,02836h,09f6fh,09116h,061b9h,082cbh,0e219h,092h,073h,0a98ch
551
        tstr    0,1,0,0,0ff00h,0,0,0,0,0,0,0,0          ; (512 cycles)
552
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
553
        db      02dh,096h,06ch,0f3h                     ; expected crc
554
        tmsg    ' iyh.................'
555
 
556
;  iyl (3072 cycles)
557
incyl:  db      0d7h            ; flag mask
558
        tstr    0ddh,02ch,0,0,0d7c6h,062d5h,0a09eh,07039h,03e7eh,09f12h,090h,0d9h,0220fh
559
        tstr    0,1,0,0,0ffh,0,0,0,0,0,0,0,0            ; (512 cycles)
560
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
561
        db      0fbh,0cbh,0bah,095h                     ; expected crc
562
        tmsg    ' iyl.................'
563
 
564
; ld ,(nnnn) (32 cycles)
565
ld161:  db      0d7h            ; flag mask
566
        tstr    0edh,04bh,msbtlo,msbthi,0f9a8h,0f559h,093a4h,0f5edh,06f96h,0d968h,086h,0e6h,04bd8h
567
        tstr    0,010h,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
568
        tstr    0,0,0,0,-1,0,0,0,0,0,0,0,0              ; (16 cycles)
569
        db      04dh,045h,0a9h,0ach                     ; expected crc
570
        tmsg    'ld ,(nnnn).............'
571
 
572
; ld hl,(nnnn) (16 cycles)
573
ld162:  db      0d7h            ; flag mask
574
        tstr    02ah,msbtlo,msbthi,0,09863h,07830h,02077h,0b1feh,0b9fah,0abb8h,004h,006h,06015h
575
        tstr    0,0,0,0,0,0,0,0,0,0,0,0,0               ; (1 cycle)
576
        tstr    0,0,0,0,-1,0,0,0,0,0,0,0,0              ; (16 cycles)
577
        db      05fh,097h,024h,087h                     ; expected crc
578
        tmsg    'ld hl,(nnnn)..................'
579
 
580
; ld sp,(nnnn) (16 cycles)
581
ld163:  db      0d7h            ; flag mask
582
        tstr    0edh,07bh,msbtlo,msbthi,08dfch,057d7h,02161h,0ca18h,0c185h,027dah,083h,01eh,0f460h
583
        tstr    0,0,0,0,0,0,0,0,0,0,0,0,0               ; (1 cycles)
584
        tstr    0,0,0,0,-1,0,0,0,0,0,0,0,0              ; (16 cycles)
585
        db      07ah,0ceh,0a1h,01bh                     ; expected crc
586
        tmsg    'ld sp,(nnnn)..................'
587
 
588
; ld ,(nnnn) (32 cycles)
589
ld164:  db      0d7h            ; flag mask
590
        tstr    0ddh,02ah,msbtlo,msbthi,0ded7h,0a6fah,0f780h,0244ch,087deh,0bcc2h,016h,063h,04c96h
591
        tstr    020h,0,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
592
        tstr    0,0,0,0,-1,0,0,0,0,0,0,0,0              ; (16 cycles)
593
        db      085h,08bh,0f1h,06dh                     ; expected crc
594
        tmsg    'ld ,(nnnn).............'
595
 
596
; ld (nnnn), (64 cycles)
597
ld165:  db      0d7h            ; flag mask
598
        tstr    0edh,043h,msbtlo,msbthi,01f98h,0844dh,0e8ach,0c9edh,0c95dh,08f61h,080h,03fh,0c7bfh
599
        tstr    0,010h,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
600
        tstr    0,0,0,0,0,0,0,0,-1,-1,0,0,0             ; (32 cycles)
601
        db      064h,01eh,087h,015h                     ; expected crc
602
        tmsg    'ld (nnnn),.............'
603
 
604
; ld (nnnn),hl (16 cycles)
605
ld166:  db      0d7h            ; flag mask
606
        tstr    022h,msbtlo,msbthi,0,0d003h,07772h,07f53h,03f72h,064eah,0e180h,010h,02dh,035e9h
607
        tstr    0,0,0,0,0,0,0,0,0,0,0,0,0               ; (1 cycle)
608
        tstr    0,0,0,0,0,0,0,-1,0,0,0,0,0              ; (16 cycles)
609
        db      0a3h,060h,08bh,047h                     ; expected crc
610
        tmsg    'ld (nnnn),hl..................'
611
 
612
; ld (nnnn),sp (16 cycles)
613
ld167:  db      0d7h            ; flag mask
614
        tstr    0edh,073h,msbtlo,msbthi,0c0dch,0d1d6h,0ed5ah,0f356h,0afdah,06ca7h,044h,09fh,03f0ah
615
        tstr    0,0,0,0,0,0,0,0,0,0,0,0,0               ; (1 cycle)
616
        tstr    0,0,0,0,0,0,0,0,0,0,0,0,-1              ; (16 cycles)
617
        db      016h,058h,05fh,0d7h                     ; expected crc
618
        tmsg    'ld (nnnn),sp..................'
619
 
620
; ld (nnnn), (64 cycles)
621
ld168:  db      0d7h            ; flag mask
622
        tstr    0ddh,022h,msbtlo,msbthi,06cc3h,00d91h,06900h,08ef8h,0e3d6h,0c3f7h,0c6h,0d9h,0c2dfh
623
        tstr    020h,0,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
624
        tstr    0,0,0,0,0,-1,-1,0,0,0,0,0,0             ; (32 cycles)
625
        db      0bah,010h,02ah,06bh                     ; expected crc
626
        tmsg    'ld (nnnn),.............'
627
 
628
; ld ,nnnn (64 cycles)
629
ld16im: db      0d7h            ; flag mask
630
        tstr    1,0,0,0,05c1ch,02d46h,08eb9h,06078h,074b1h,0b30eh,046h,0d1h,030cch
631
        tstr    030h,0,0,0,0,0,0,0,0,0,0,0,0            ; (4 cycles)
632
        tstr    0,0ffh,0ffh,0,0,0,0,0,0,0,0,0,0         ; (16 cycles)
633
        db      0deh,039h,019h,069h                     ; expected crc
634
        tmsg    'ld ,nnnn.........'
635
 
636
; ld ,nnnn (32 cycles)
637
ld16ix: db      0d7h            ; flag mask
638
        tstr    0ddh,021h,0,0,087e8h,02006h,0bd12h,0b69bh,07253h,0a1e5h,051h,013h,0f1bdh
639
        tstr    020h,0,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
640
        tstr    0,0,0ffh,0ffh,0,0,0,0,0,0,0,0,0         ; (16 cycles)
641
        db      022h,07dh,0d5h,025h                     ; expected crc
642
        tmsg    'ld ,nnnn...............'
643
 
644
; ld a,<(bc),(de)> (44 cycles)
645
ld8bd:  db      0d7h            ; flag mask
646
        tstr    00ah,0,0,0,0b3a8h,01d2ah,07f8eh,042ach,msbt,msbt,0c6h,0b1h,0ef8eh
647
        tstr    010h,0,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
648
        tstr    0,0,0,0,0ffh,0,0,0,0,0,0d7h,-1,0        ; (22 cycles)
649
        db      0b0h,081h,089h,035h                     ; expected crc
650
        tmsg    'ld a,<(bc),(de)>..............'
651
 
652
; ld ,nn (64 cycles)
653
ld8im:  db      0d7h            ; flag mask
654
        tstr    6,0,0,0,0c407h,0f49dh,0d13dh,00339h,0de89h,07455h,053h,0c0h,05509h
655
        tstr    038h,0,0,0,0,0,0,0,0,0,0,0,0            ; (8 cycles)
656
        tstr    0,0,0,0,0,0,0,0,0,0,0,-1,0              ; (8 cycles)
657
        db      0f1h,0dah,0b5h,056h                     ; expected crc
658
        tmsg    'ld ,nn....'
659
 
660
; ld (+1),nn (32 cycles)
661
ld8imx: db      0d7h            ; flag mask
662
        tstr    0ddh,036h,1,0,01b45h,msbt-1,msbt-1,0d5c1h,061c7h,0bdc4h,0c0h,085h,0cd16h
663
        tstr    020h,0,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
664
        tstr    0,0,0,-1,0,0,0,0,0,0,0,-1,0             ; (16 cycles)
665
        db      026h,0dbh,047h,07eh                     ; expected crc
666
        tmsg    'ld (+1),nn.............'
667
 
668
; ld ,(+1) (512 cycles)
669
ld8ix1: db      0d7h            ; flag mask
670
        tstr    0ddh,046h,1,0,0d016h,msbt-1,msbt-1,04260h,07f39h,00404h,097h,04ah,0d085h
671
        tstr    020h,018h,0,0,0,1,1,0,0,0,0,0,0         ; (32 cycles)
672
        tstr    0,0,0,0,-1,0,0,0,0,0,0,0,0              ; (16 cycles)
673
        db      0cch,011h,006h,0a8h                     ; expected crc
674
        tmsg    'ld ,(+1)......'
675
 
676
; ld ,(+1) (256 cycles)
677
ld8ix2: db      0d7h            ; flag mask
678
        tstr    0ddh,066h,1,0,084e0h,msbt-1,msbt-1,09c52h,0a799h,049b6h,093h,000h,0eeadh
679
        tstr    020h,008h,0,0,0,1,1,0,0,0,0,0,0         ; (16 cycles)
680
        tstr    0,0,0,0,-1,0,0,0,0,0,0,0,0              ; (16 cycles)
681
        db      0fah,02ah,04dh,003h                     ; expected crc
682
        tmsg    'ld ,(+1)..........'
683
 
684
; ld a,(+1) (128 cycles)
685
ld8ix3: db      0d7h            ; flag mask
686
        tstr    0ddh,07eh,1,0,0d8b6h,msbt-1,msbt-1,0c612h,0df07h,09cd0h,043h,0a6h,0a0e5h
687
        tstr    020h,0,0,0,0,1,1,0,0,0,0,0,0            ; (8 cycles)
688
        tstr    0,0,0,0,-1,0,0,0,0,0,0,0,0              ; (16 cycles)
689
        db      0a5h,0e9h,0ach,064h                     ; expected crc
690
        tmsg    'ld a,(+1)..............'
691
 
692
; ld ,nn (32 cycles)
693
ld8ixy: db      0d7h            ; flag mask
694
        tstr    0ddh,026h,0,0,03c53h,04640h,0e179h,07711h,0c107h,01afah,081h,0adh,05d9bh
695
        tstr    020h,8,0,0,0,0,0,0,0,0,0,0,0            ; (4 cycles)
696
        tstr    0,0,0,0,0,0,0,0,0,0,0,-1,0              ; (8 cycles)
697
        db      024h,0e8h,082h,08bh                     ; expected crc
698
        tmsg    'ld ,nn.......'
699
 
700
; ld , (3456 cycles)
701
ld8rr:  db      0d7h            ; flag mask
702
        tstr    040h,0,0,0,072a4h,0a024h,061ach,msbt,082c7h,0718fh,097h,08fh,0ef8eh
703
        tstr    03fh,0,0,0,0,0,0,0,0,0,0,0,0            ; (64 cycles)
704
        tstr    0,0,0,0,0ffh,0,0,0,-1,-1,0d7h,-1,0      ; (54 cycles)
705
        db      074h,04bh,001h,018h                     ; expected crc
706
        tmsg    'ld ,........'
707
 
708
; ld , (6912 cycles)
709
ld8rrx: db      0d7h            ; flag mask
710
        tstr    0ddh,040h,0,0,0bcc5h,msbt,msbt,msbt,02fc2h,098c0h,083h,01fh,03bcdh
711
        tstr    020h,03fh,0,0,0,0,0,0,0,0,0,0,0         ; (128 cycles)
712
        tstr    0,0,0,0,0ffh,0,0,0,-1,-1,0d7h,-1,0      ; (54 cycles)
713
        db      047h,08bh,0a3h,06bh                     ; expected crc
714
        tmsg    'ld ,........'
715
 
716
; ld a,(nnnn) / ld (nnnn),a (44 cycles)
717
lda:    db      0d7h            ; flag mask
718
        tstr    032h,msbtlo,msbthi,0,0fd68h,0f4ech,044a0h,0b543h,00653h,0cdbah,0d2h,04fh,01fd8h
719
        tstr    008h,0,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycle)
720
        tstr    0,0,0,0,0ffh,0,0,0,0,0,0d7h,-1,0        ; (22 cycles)
721
        db      0c9h,026h,02dh,0e5h                     ; expected crc
722
        tmsg    'ld a,(nnnn) / ld (nnnn),a.....'
723
 
724
; ldd (1) (44 cycles)
725
ldd1:   db      0d7h            ; flag mask
726
        tstr    0edh,0a8h,0,0,09852h,068fah,066a1h,msbt+3,msbt+1,1,0c1h,068h,020b7h
727
        tstr    0,010h,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
728
        tstr    0,0,0,0,-1,0,0,0,0,0,0d7h,0,0           ; (22 cycles)
729
        db      094h,0f4h,027h,069h                     ; expected crc
730
        tmsg    'ldd (1)....................'
731
 
732
; ldd (2) (44 cycles)
733
ldd2:   db      0d7h            ; flag mask
734
        tstr    0edh,0a8h,0,0,0f12eh,0eb2ah,0d5bah,msbt+3,msbt+1,2,047h,0ffh,0fbe4h
735
        tstr    0,010h,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
736
        tstr    0,0,0,0,-1,0,0,0,0,0,0d7h,0,0           ; (22 cycles)
737
        db      05ah,090h,07eh,0d4h                     ; expected crc
738
        tmsg    'ldd (2)....................'
739
 
740
; ldi (1) (44 cycles)
741
ldi1:   db      0d7h            ; flag mask
742
        tstr    0edh,0a0h,0,0,0fe30h,003cdh,06058h,msbt+2,msbt,1,004h,060h,02688h
743
        tstr    0,010h,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
744
        tstr    0,0,0,0,-1,0,0,0,0,0,0d7h,0,0           ; (22 cycles)
745
        db      09ah,0bdh,0f6h,0b5h                     ; expected crc
746
        tmsg    'ldi (1)....................'
747
 
748
; ldi (2) (44 cycles)
749
ldi2:   db      0d7h            ; flag mask
750
        tstr    0edh,0a0h,0,0,04aceh,0c26eh,0b188h,msbt+2,msbt,2,014h,02dh,0a39fh
751
        tstr    0,010h,0,0,0,0,0,0,0,0,0,0,0            ; (2 cycles)
752
        tstr    0,0,0,0,-1,0,0,0,0,0,0d7h,0,0           ; (22 cycles)
753
        db      0ebh,059h,089h,01bh                     ; expected crc
754
        tmsg    'ldi (2)....................'
755
 
756
; neg (16,384 cycles)
757
negop:  db      0d7h            ; flag mask
758
        tstr    0edh,044h,0,0,038a2h,05f6bh,0d934h,057e4h,0d2d6h,04642h,043h,05ah,009cch
759
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,-1,0           ; (16,384 cycles)
760
        tstr    0,0,0,0,0,0,0,0,0,0,0,0,0               ; (1 cycle)
761
        db      06ah,03ch,03bh,0bdh                     ; expected crc
762
        tmsg    'neg...........................'
763
 
764
;  (7168 cycles)
765
rldop:  db      0d7h            ; flag mask
766
        tstr    0edh,067h,0,0,091cbh,0c48bh,0fa62h,msbt,0e720h,0b479h,040h,006h,08ae2h
767
        tstr    0,8,0,0,0ffh,0,0,0,0,0,0,0,0            ; (512 cycles)
768
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,-1,0           ; (14 cycles)
769
        db      095h,05bh,0a3h,026h                     ; expected crc
770
        tmsg    '.....................'
771
 
772
;  (6144 cycles)
773
rot8080: db     0d7h            ; flag mask
774
        tstr    7,0,0,0,0cb92h,06d43h,00a90h,0c284h,00c53h,0f50eh,091h,0ebh,040fch
775
        tstr    018h,0,0,0,0,0,0,0,0,0,0,-1,0           ; (1024 cycles)
776
        tstr    0,0,0,0,0,0,0,0,0,0,0d7h,0,0            ; (6 cycles)
777
        db      025h,013h,030h,0aeh                     ; expected crc
778
        tmsg    '...........'
779
 
780
; shift/rotate (+1) (416 cycles)
781
rotxy:  db      0d7h            ; flag mask
782
        tstr    0ddh,0cbh,1,6,0ddafh,msbt-1,msbt-1,0ff3ch,0dbf6h,094f4h,082h,080h,061d9h
783
        tstr    020h,0,0,038h,0,0,0,0,0,0,080h,0,0      ; (32 cycles)
784
        tstr    0,0,0,0,0ffh,0,0,0,0,0,057h,0,0         ; (13 cycles)
785
        db      071h,03ah,0cdh,081h                     ; expected crc
786
        tmsg    'shf/rot (+1)...........'
787
 
788
; shift/rotate  (6784 cycles)
789
rotz80: db      0d7h            ; flag mask
790
        tstr    0cbh,0,0,0,0ccebh,05d4ah,0e007h,msbt,01395h,030eeh,043h,078h,03dadh
791
        tstr    0,03fh,0,0,0,0,0,0,0,0,080h,0,0         ; (128 cycles)
792
        tstr    0,0,0,0,0ffh,0,0,0,-1,-1,057h,-1,0      ; (53 cycles)
793
        db      0ebh,060h,04dh,058h                     ; expected crc
794
        tmsg    'shf/rot ..'
795
 
796
;  n, (7936 cycles)
797
srz80:  db      0d7h            ; flag mask
798
        tstr    0cbh,080h,0,0,02cd5h,097abh,039ffh,msbt,0d14bh,06ab2h,053h,027h,0b538h
799
        tstr    0,07fh,0,0,0,0,0,0,0,0,0,0,0            ; (128 cycles)
800
        tstr    0,0,0,0,0ffh,0,0,0,-1,-1,0d7h,-1,0      ; (62 cycles)
801
        db      08bh,057h,0f0h,008h                     ; expected crc
802
        tmsg    ' n,.....'
803
 
804
;  n,(+1) (1792 cycles)
805
srzx:   db      0d7h            ; flag mask
806
        tstr    0ddh,0cbh,1,086h,0fb44h,msbt-1,msbt-1,0ba09h,068beh,032d8h,010h,05eh,0a867h
807
        tstr    020h,0,0,078h,0,0,0,0,0,0,0,0,0 ; (128 cycles)
808
        tstr    0,0,0,0,0ffh,0,0,0,0,0,0d7h,0,0         ;(14 cycles)
809
        db      0cch,063h,0f9h,08ah                     ; expected crc
810
        tmsg    ' n,(+1).......'
811
 
812
; ld (+1), (1024 cycles)
813
st8ix1: db      0d7h            ; flag mask
814
        tstr    0ddh,070h,1,0,0270dh,msbt-1,msbt-1,0b73ah,0887bh,099eeh,086h,070h,0ca07h
815
        tstr    020h,003h,0,0,0,1,1,0,0,0,0,0,0         ; (32 cycles)
816
        tstr    0,0,0,0,0,0,0,0,-1,-1,0,0,0             ; (32 cycles)
817
        db      004h,062h,06ah,0bfh                     ; expected crc
818
        tmsg    'ld (+1),......'
819
 
820
; ld (+1), (256 cycles)
821
st8ix2: db      0d7h            ; flag mask
822
        tstr    0ddh,074h,1,0,0b664h,msbt-1,msbt-1,0e8ach,0b5f5h,0aafeh,012h,010h,09566h
823
        tstr    020h,001h,0,0,0,1,1,0,0,0,0,0,0         ; (16 cycles)
824
        tstr    0,0,0,0,0,0,0,-1,0,0,0,0,0              ; (32 cycles)
825
        db      06ah,01ah,088h,031h                     ; expected crc
826
        tmsg    'ld (+1),..........'
827
 
828
; ld (+1),a (64 cycles)
829
st8ix3: db      0d7h            ; flag mask
830
        tstr    0ddh,077h,1,0,067afh,msbt-1,msbt-1,04f13h,00644h,0bcd7h,050h,0ach,05fafh
831
        tstr    020h,0,0,0,0,1,1,0,0,0,0,0,0            ; (8 cycles)
832
        tstr    0,0,0,0,0,0,0,0,0,0,0,-1,0              ; (8 cycles)
833
        db      0cch,0beh,05ah,096h                     ; expected crc
834
        tmsg    'ld (+1),a..............'
835
 
836
; ld (),a (96 cycles)
837
stabd:  db      0d7h            ; flag mask
838
        tstr    2,0,0,0,00c3bh,0b592h,06cffh,0959eh,msbt,msbt+1,0c1h,021h,0bde7h
839
        tstr    018h,0,0,0,0,0,0,0,0,0,0,0,0            ; (4 cycles)
840
        tstr    0,0,0,0,-1,0,0,0,0,0,0,-1,0             ; (24 cycles)
841
        db      07ah,04ch,011h,04fh                     ; expected crc
842
        tmsg    'ld (),a................'
843
 
844
; start test pointed to by (hl)
845
stt:    push    hl
846
        ld      a,(hl)          ; get pointer to test
847
        inc     hl
848
        ld      h,(hl)
849
        ld      l,a
850
        ld      a,(hl)          ; flag mask
851
        ld      (flgmsk+1),a
852
        inc     hl
853
        push    hl
854
        ld      de,20
855
        add     hl,de           ; point to incmask
856
        ld      de,counter
857
        call    initmask
858
        pop     hl
859
        push    hl
860
        ld      de,20+20
861
        add     hl,de           ; point to scanmask
862
        ld      de,shifter
863
        call    initmask
864
        ld      hl,shifter
865
        ld      (hl),1          ; first bit
866
        pop     hl
867
        push    hl
868
        ld      de,iut          ; copy initial instruction under test
869
        ld      bc,4
870
        ldir
871
        ld      de,msbt         ; copy initial machine state
872
        ld      bc,16
873
        ldir
874
        ld      de,20+20+4      ; skip incmask, scanmask and expcrc
875
        add     hl,de
876
        ex      de,hl
877
        ld      c,9
878
        call    bdos            ; show test name
879
        call    initcrc         ; initialise crc
880
; test loop
881
tlp:    ld      a,(iut)
882
        cp      076h            ; pragmatically avoid halt intructions
883
        jp      z,tlp2
884
        and     a,0dfh
885
        cp      0ddh
886
        jp      nz,tlp1
887
        ld      a,(iut+1)
888
        cp      076h
889
tlp1:   call    nz,test         ; execute the test instruction
890
tlp2:   call    count           ; increment the counter
891
        call    nz,shift        ; shift the scan bit
892
        pop     hl              ; pointer to test case
893
        jp      z,tlp3          ; done if shift returned NZ
894
        ld      de,20+20+20
895
        add     hl,de           ; point to expected crc
896
        call    cmpcrc
897
        ld      de,okmsg
898
        jp      z,tlpok
899
        ld      de,ermsg1
900
        ld      c,9
901
        call    bdos
902
        call    phex8
903
        ld      de,ermsg2
904
        ld      c,9
905
        call    bdos
906
        ld      hl,crcval
907
        call    phex8
908
        ld      de,crlf
909
tlpok:  ld      c,9
910
        call    bdos
911
        pop     hl
912
        inc     hl
913
        inc     hl
914
        ret
915
 
916
tlp3:   push    hl
917
        ld      a,1             ; initialise count and shift scanners
918
        ld      (cntbit),a
919
        ld      (shfbit),a
920
        ld      hl,counter
921
        ld      (cntbyt),hl
922
        ld      hl,shifter
923
        ld      (shfbyt),hl
924
 
925
        ld      b,4             ; bytes in iut field
926
        pop     hl              ; pointer to test case
927
        push    hl
928
        ld      de,iut
929
        call    setup           ; setup iut
930
        ld      b,16            ; bytes in machine state
931
        ld      de,msbt
932
        call    setup           ; setup machine state
933
        jp      tlp
934
 
935
; setup a field of the test case
936
; b  = number of bytes
937
; hl = pointer to base case
938
; de = destination
939
setup:  call    subyte
940
        inc     hl
941
        dec     b
942
        jp      nz,setup
943
        ret
944
 
945
subyte: push    bc
946
        push    de
947
        push    hl
948
        ld      c,(hl)          ; get base byte
949
        ld      de,20
950
        add     hl,de           ; point to incmask
951
        ld      a,(hl)
952
        cp      0
953
        jp      z,subshf
954
        ld      b,8             ; 8 bits
955
subclp: rrca
956
        push    af
957
        ld      a,0
958
        call    c,nxtcbit       ; get next counter bit if mask bit was set
959
        xor     c               ; flip bit if counter bit was set
960
        rrca
961
        ld      c,a
962
        pop     af
963
        dec     b
964
        jp      nz,subclp
965
        ld      b,8
966
subshf: ld      de,20
967
        add     hl,de           ; point to shift mask
968
        ld      a,(hl)
969
        cp      0
970
        jp      z,substr
971
        ld      b,8             ; 8 bits
972
sbshf1: rrca
973
        push    af
974
        ld      a,0
975
        call    c,nxtsbit       ; get next shifter bit if mask bit was set
976
        xor     c               ; flip bit if shifter bit was set
977
        rrca
978
        ld      c,a
979
        pop     af
980
        dec     b
981
        jp      nz,sbshf1
982
substr: pop     hl
983
        pop     de
984
        ld      a,c
985
        ld      (de),a          ; mangled byte to destination
986
        inc     de
987
        pop     bc
988
        ret
989
 
990
; get next counter bit in low bit of a
991
cntbit: ds      1
992
cntbyt: ds      2
993
 
994
nxtcbit: push   bc
995
        push    hl
996
        ld      hl,(cntbyt)
997
        ld      b,(hl)
998
        ld      hl,cntbit
999
        ld      a,(hl)
1000
        ld      c,a
1001
        rlca
1002
        ld      (hl),a
1003
        cp      a,1
1004
        jp      nz,ncb1
1005
        ld      hl,(cntbyt)
1006
        inc     hl
1007
        ld      (cntbyt),hl
1008
ncb1:   ld      a,b
1009
        and     c
1010
        pop     hl
1011
        pop     bc
1012
        ret     z
1013
        ld      a,1
1014
        ret
1015
 
1016
; get next shifter bit in low bit of a
1017
shfbit: ds      1
1018
shfbyt: ds      2
1019
 
1020
nxtsbit: push   bc
1021
        push    hl
1022
        ld      hl,(shfbyt)
1023
        ld      b,(hl)
1024
        ld      hl,shfbit
1025
        ld      a,(hl)
1026
        ld      c,a
1027
        rlca
1028
        ld      (hl),a
1029
        cp      a,1
1030
        jp      nz,nsb1
1031
        ld      hl,(shfbyt)
1032
        inc     hl
1033
        ld      (shfbyt),hl
1034
nsb1:   ld      a,b
1035
        and     c
1036
        pop     hl
1037
        pop     bc
1038
        ret     z
1039
        ld      a,1
1040
        ret
1041
 
1042
 
1043
; clear memory at hl, bc bytes
1044
clrmem: push    af
1045
        push    bc
1046
        push    de
1047
        push    hl
1048
        ld      (hl),0
1049
        ld      d,h
1050
        ld      e,l
1051
        inc     de
1052
        dec     bc
1053
        ldir
1054
        pop     hl
1055
        pop     de
1056
        pop     bc
1057
        pop     af
1058
        ret
1059
 
1060
; initialise counter or shifter
1061
; de = pointer to work area for counter or shifter
1062
; hl = pointer to mask
1063
initmask:
1064
        push    de
1065
        ex      de,hl
1066
        ld      bc,20+20
1067
        call    clrmem          ; clear work area
1068
        ex      de,hl
1069
        ld      b,20            ; byte counter
1070
        ld      c,1             ; first bit
1071
        ld      d,0             ; bit counter
1072
imlp:   ld      e,(hl)
1073
imlp1:  ld      a,e
1074
        and     a,c
1075
        jp      z,imlp2
1076
        inc     d
1077
imlp2:  ld      a,c
1078
        rlca
1079
        ld      c,a
1080
        cp      a,1
1081
        jp      nz,imlp1
1082
        inc     hl
1083
        dec     b
1084
        jp      nz,imlp
1085
; got number of 1-bits in mask in reg d
1086
        ld      a,d
1087
        and     0f8h
1088
        rrca
1089
        rrca
1090
        rrca                    ; divide by 8 (get byte offset)
1091
        ld      l,a
1092
        ld      h,0
1093
        ld      a,d
1094
        and     a,7             ; bit offset
1095
        inc     a
1096
        ld      b,a
1097
        ld      a,080h
1098
imlp3:  rlca
1099
        dec     b
1100
        jp      nz,imlp3
1101
        pop     de
1102
        add     hl,de
1103
        ld      de,20
1104
        add     hl,de
1105
        ld      (hl),a
1106
        ret
1107
 
1108
; multi-byte counter
1109
count:  push    bc
1110
        push    de
1111
        push    hl
1112
        ld      hl,counter      ; 20 byte counter starts here
1113
        ld      de,20           ; somewhere in here is the stop bit
1114
        ex      de,hl
1115
        add     hl,de
1116
        ex      de,hl
1117
cntlp:  inc     (hl)
1118
        ld      a,(hl)
1119
        cp      0
1120
        jp      z,cntlp1        ; overflow to next byte
1121
        ld      b,a
1122
        ld      a,(de)
1123
        and     a,b             ; test for terminal value
1124
        jp      z,cntend
1125
        ld      (hl),0          ; reset to zero
1126
cntend: pop     bc
1127
        pop     de
1128
        pop     hl
1129
        ret
1130
 
1131
cntlp1: inc     hl
1132
        inc     de
1133
        jp      cntlp
1134
 
1135
 
1136
; multi-byte shifter
1137
shift:  push    bc
1138
        push    de
1139
        push    hl
1140
        ld      hl,shifter      ; 20 byte shift register starts here
1141
        ld      de,20           ; somewhere in here is the stop bit
1142
        ex      de,hl
1143
        add     hl,de
1144
        ex      de,hl
1145
shflp:  ld      a,(hl)
1146
        or      a
1147
        jp      z,shflp1
1148
        ld      b,a
1149
        ld      a,(de)
1150
        and     b
1151
        jp      nz,shlpe
1152
        ld      a,b
1153
        rlca
1154
        cp      a,1
1155
        jp      nz,shflp2
1156
        ld      (hl),0
1157
        inc     hl
1158
        inc     de
1159
shflp2: ld      (hl),a
1160
        xor     a               ; set Z
1161
shlpe:  pop     hl
1162
        pop     de
1163
        pop     bc
1164
        ret
1165
shflp1: inc     hl
1166
        inc     de
1167
        jp      shflp
1168
 
1169
counter: ds     2*20
1170
shifter: ds     2*20
1171
 
1172
; test harness
1173
test:   push    af
1174
        push    bc
1175
        push    de
1176
        push    hl
1177
      if        0
1178
        ld      de,crlf
1179
        ld      c,9
1180
        call    bdos
1181
        ld      hl,iut
1182
        ld      b,4
1183
        call    hexstr
1184
        ld      e,' '
1185
        ld      c,2
1186
        call    bdos
1187
        ld      b,16
1188
        ld      hl,msbt
1189
        call    hexstr
1190
      endif
1191
        di                      ; disable interrupts
1192
        ld      (spsav),sp      ; save stack pointer
1193
        ld      sp,msbt+2       ; point to test-case machine state
1194
        pop     iy              ; and load all regs
1195
        pop     ix
1196
        pop     hl
1197
        pop     de
1198
        pop     bc
1199
        pop     af
1200
        ld      sp,(spbt)
1201
iut:    ds      4               ; max 4 byte instruction under test
1202
        ld      (spat),sp       ; save stack pointer
1203
        ld      sp,spat
1204
        push    af              ; save other registers
1205
        push    bc
1206
        push    de
1207
        push    hl
1208
        push    ix
1209
        push    iy
1210
        ld      sp,(spsav)      ; restore stack pointer
1211
        ei                      ; enable interrupts
1212
        ld      hl,(msbt)       ; copy memory operand
1213
        ld      (msat),hl
1214
        ld      hl,flgsat       ; flags after test
1215
        ld      a,(hl)
1216
flgmsk: and     a,0d7h          ; mask-out irrelevant bits (self-modified code!)
1217
        ld      (hl),a
1218
        ld      b,16            ; total of 16 bytes of state
1219
        ld      de,msat
1220
        ld      hl,crcval
1221
tcrc:   ld      a,(de)
1222
        inc     de
1223
        call    updcrc          ; accumulate crc of this test case
1224
        dec     b
1225
        jp      nz,tcrc
1226
      if        0
1227
        ld      e,' '
1228
        ld      c,2
1229
        call    bdos
1230
        ld      hl,crcval
1231
        call    phex8
1232
        ld      de,crlf
1233
        ld      c,9
1234
        call    bdos
1235
        ld      hl,msat
1236
        ld      b,16
1237
        call    hexstr
1238
        ld      de,crlf
1239
        ld      c,9
1240
        call    bdos
1241
      endif
1242
        pop     hl
1243
        pop     de
1244
        pop     bc
1245
        pop     af
1246
        ret
1247
 
1248
; machine state after test
1249
msat:   ds      14      ; memop,iy,ix,hl,de,bc,af
1250
spat:   ds      2       ; stack pointer after test
1251
; ZMAC/MAXAM doesn't like ':' after label with EQUs
1252
flgsat  equ     spat-2  ; flags
1253
 
1254
spsav:  ds      2       ; saved stack pointer
1255
 
1256
; display hex string (pointer in hl, byte count in b)
1257
hexstr: ld      a,(hl)
1258
        call    phex2
1259
        inc     hl
1260
        dec     b
1261
        jp      nz,hexstr
1262
        ret
1263
 
1264
; display hex
1265
; display the big-endian 32-bit value pointed to by hl
1266
phex8:  push    af
1267
        push    bc
1268
        push    hl
1269
        ld      b,4
1270
ph8lp:  ld      a,(hl)
1271
        call    phex2
1272
        inc     hl
1273
        dec     b
1274
        jp      nz,ph8lp
1275
        pop     hl
1276
        pop     bc
1277
        pop     af
1278
        ret
1279
 
1280
; display byte in a
1281
phex2:  push    af
1282
        rrca
1283
        rrca
1284
        rrca
1285
        rrca
1286
        call    phex1
1287
        pop     af
1288
; fall through
1289
 
1290
; display low nibble in a
1291
phex1:  push    af
1292
        push    bc
1293
        push    de
1294
        push    hl
1295
        and     a,0fh
1296
        cp      a,10
1297
        jp      c,ph11
1298
        add     a,'a'-'9'-1
1299
ph11:   add     a,'0'
1300
        ld      e,a
1301
        ld      c,2
1302
        call    bdos
1303
        pop     hl
1304
        pop     de
1305
        pop     bc
1306
        pop     af
1307
        ret
1308
 
1309
bdos    push    af
1310
        push    bc
1311
        push    de
1312
        push    hl
1313
        call    5
1314
        pop     hl
1315
        pop     de
1316
        pop     bc
1317
        pop     af
1318
        ret
1319
 
1320
msg1:   db      10,13,10,13,'Z80doc instruction exerciser',10,13,'$'
1321
msg2:   db      'Tests complete$'
1322
okmsg:  db      '  OK',10,13,'$'
1323
ermsg1: db      '  ERROR **** crc expected:$'
1324
ermsg2: db      ' found:$'
1325
crlf:   db      10,13,'$'
1326
 
1327
; compare crc
1328
; hl points to value to compare to crcval
1329
cmpcrc: push    bc
1330
        push    de
1331
        push    hl
1332
        ld      de,crcval
1333
        ld      b,4
1334
cclp:   ld      a,(de)
1335
        cp      a,(hl)
1336
        jp      nz,cce
1337
        inc     hl
1338
        inc     de
1339
        dec     b
1340
        jp      nz,cclp
1341
cce:    pop     hl
1342
        pop     de
1343
        pop     bc
1344
        ret
1345
 
1346
; 32-bit crc routine
1347
; entry: a contains next byte, hl points to crc
1348
; exit:  crc updated
1349
updcrc: push    af
1350
        push    bc
1351
        push    de
1352
        push    hl
1353
        push    hl
1354
        ld      de,3
1355
        add     hl,de   ; point to low byte of old crc
1356
        xor     a,(hl)  ; xor with new byte
1357
        ld      l,a
1358
        ld      h,0
1359
        add     hl,hl   ; use result as index into table of 4 byte entries
1360
        add     hl,hl
1361
        ex      de,hl
1362
        ld      hl,crctab
1363
        add     hl,de   ; point to selected entry in crctab
1364
        ex      de,hl
1365
        pop     hl
1366
        ld      bc,4    ; c = byte count, b = accumulator
1367
crclp:  ld      a,(de)
1368
        xor     a,b
1369
        ld      b,(hl)
1370
        ld      (hl),a
1371
        inc     de
1372
        inc     hl
1373
        dec     c
1374
        jp      nz,crclp
1375
      if        0
1376
        ld      hl,crcval
1377
        call    phex8
1378
        ld      de,crlf
1379
        ld      c,9
1380
        call    bdos
1381
      endif
1382
        pop     hl
1383
        pop     de
1384
        pop     bc
1385
        pop     af
1386
        ret
1387
 
1388
initcrc:push    af
1389
        push    bc
1390
        push    hl
1391
        ld      hl,crcval
1392
        ld      a,0ffh
1393
        ld      b,4
1394
icrclp: ld      (hl),a
1395
        inc     hl
1396
        dec     b
1397
        jp      nz,icrclp
1398
        pop     hl
1399
        pop     bc
1400
        pop     af
1401
        ret
1402
 
1403
crcval  ds      4
1404
 
1405
crctab: db      000h,000h,000h,000h
1406
        db      077h,007h,030h,096h
1407
        db      0eeh,00eh,061h,02ch
1408
        db      099h,009h,051h,0bah
1409
        db      007h,06dh,0c4h,019h
1410
        db      070h,06ah,0f4h,08fh
1411
        db      0e9h,063h,0a5h,035h
1412
        db      09eh,064h,095h,0a3h
1413
        db      00eh,0dbh,088h,032h
1414
        db      079h,0dch,0b8h,0a4h
1415
        db      0e0h,0d5h,0e9h,01eh
1416
        db      097h,0d2h,0d9h,088h
1417
        db      009h,0b6h,04ch,02bh
1418
        db      07eh,0b1h,07ch,0bdh
1419
        db      0e7h,0b8h,02dh,007h
1420
        db      090h,0bfh,01dh,091h
1421
        db      01dh,0b7h,010h,064h
1422
        db      06ah,0b0h,020h,0f2h
1423
        db      0f3h,0b9h,071h,048h
1424
        db      084h,0beh,041h,0deh
1425
        db      01ah,0dah,0d4h,07dh
1426
        db      06dh,0ddh,0e4h,0ebh
1427
        db      0f4h,0d4h,0b5h,051h
1428
        db      083h,0d3h,085h,0c7h
1429
        db      013h,06ch,098h,056h
1430
        db      064h,06bh,0a8h,0c0h
1431
        db      0fdh,062h,0f9h,07ah
1432
        db      08ah,065h,0c9h,0ech
1433
        db      014h,001h,05ch,04fh
1434
        db      063h,006h,06ch,0d9h
1435
        db      0fah,00fh,03dh,063h
1436
        db      08dh,008h,00dh,0f5h
1437
        db      03bh,06eh,020h,0c8h
1438
        db      04ch,069h,010h,05eh
1439
        db      0d5h,060h,041h,0e4h
1440
        db      0a2h,067h,071h,072h
1441
        db      03ch,003h,0e4h,0d1h
1442
        db      04bh,004h,0d4h,047h
1443
        db      0d2h,00dh,085h,0fdh
1444
        db      0a5h,00ah,0b5h,06bh
1445
        db      035h,0b5h,0a8h,0fah
1446
        db      042h,0b2h,098h,06ch
1447
        db      0dbh,0bbh,0c9h,0d6h
1448
        db      0ach,0bch,0f9h,040h
1449
        db      032h,0d8h,06ch,0e3h
1450
        db      045h,0dfh,05ch,075h
1451
        db      0dch,0d6h,00dh,0cfh
1452
        db      0abh,0d1h,03dh,059h
1453
        db      026h,0d9h,030h,0ach
1454
        db      051h,0deh,000h,03ah
1455
        db      0c8h,0d7h,051h,080h
1456
        db      0bfh,0d0h,061h,016h
1457
        db      021h,0b4h,0f4h,0b5h
1458
        db      056h,0b3h,0c4h,023h
1459
        db      0cfh,0bah,095h,099h
1460
        db      0b8h,0bdh,0a5h,00fh
1461
        db      028h,002h,0b8h,09eh
1462
        db      05fh,005h,088h,008h
1463
        db      0c6h,00ch,0d9h,0b2h
1464
        db      0b1h,00bh,0e9h,024h
1465
        db      02fh,06fh,07ch,087h
1466
        db      058h,068h,04ch,011h
1467
        db      0c1h,061h,01dh,0abh
1468
        db      0b6h,066h,02dh,03dh
1469
        db      076h,0dch,041h,090h
1470
        db      001h,0dbh,071h,006h
1471
        db      098h,0d2h,020h,0bch
1472
        db      0efh,0d5h,010h,02ah
1473
        db      071h,0b1h,085h,089h
1474
        db      006h,0b6h,0b5h,01fh
1475
        db      09fh,0bfh,0e4h,0a5h
1476
        db      0e8h,0b8h,0d4h,033h
1477
        db      078h,007h,0c9h,0a2h
1478
        db      00fh,000h,0f9h,034h
1479
        db      096h,009h,0a8h,08eh
1480
        db      0e1h,00eh,098h,018h
1481
        db      07fh,06ah,00dh,0bbh
1482
        db      008h,06dh,03dh,02dh
1483
        db      091h,064h,06ch,097h
1484
        db      0e6h,063h,05ch,001h
1485
        db      06bh,06bh,051h,0f4h
1486
        db      01ch,06ch,061h,062h
1487
        db      085h,065h,030h,0d8h
1488
        db      0f2h,062h,000h,04eh
1489
        db      06ch,006h,095h,0edh
1490
        db      01bh,001h,0a5h,07bh
1491
        db      082h,008h,0f4h,0c1h
1492
        db      0f5h,00fh,0c4h,057h
1493
        db      065h,0b0h,0d9h,0c6h
1494
        db      012h,0b7h,0e9h,050h
1495
        db      08bh,0beh,0b8h,0eah
1496
        db      0fch,0b9h,088h,07ch
1497
        db      062h,0ddh,01dh,0dfh
1498
        db      015h,0dah,02dh,049h
1499
        db      08ch,0d3h,07ch,0f3h
1500
        db      0fbh,0d4h,04ch,065h
1501
        db      04dh,0b2h,061h,058h
1502
        db      03ah,0b5h,051h,0ceh
1503
        db      0a3h,0bch,000h,074h
1504
        db      0d4h,0bbh,030h,0e2h
1505
        db      04ah,0dfh,0a5h,041h
1506
        db      03dh,0d8h,095h,0d7h
1507
        db      0a4h,0d1h,0c4h,06dh
1508
        db      0d3h,0d6h,0f4h,0fbh
1509
        db      043h,069h,0e9h,06ah
1510
        db      034h,06eh,0d9h,0fch
1511
        db      0adh,067h,088h,046h
1512
        db      0dah,060h,0b8h,0d0h
1513
        db      044h,004h,02dh,073h
1514
        db      033h,003h,01dh,0e5h
1515
        db      0aah,00ah,04ch,05fh
1516
        db      0ddh,00dh,07ch,0c9h
1517
        db      050h,005h,071h,03ch
1518
        db      027h,002h,041h,0aah
1519
        db      0beh,00bh,010h,010h
1520
        db      0c9h,00ch,020h,086h
1521
        db      057h,068h,0b5h,025h
1522
        db      020h,06fh,085h,0b3h
1523
        db      0b9h,066h,0d4h,009h
1524
        db      0ceh,061h,0e4h,09fh
1525
        db      05eh,0deh,0f9h,00eh
1526
        db      029h,0d9h,0c9h,098h
1527
        db      0b0h,0d0h,098h,022h
1528
        db      0c7h,0d7h,0a8h,0b4h
1529
        db      059h,0b3h,03dh,017h
1530
        db      02eh,0b4h,00dh,081h
1531
        db      0b7h,0bdh,05ch,03bh
1532
        db      0c0h,0bah,06ch,0adh
1533
        db      0edh,0b8h,083h,020h
1534
        db      09ah,0bfh,0b3h,0b6h
1535
        db      003h,0b6h,0e2h,00ch
1536
        db      074h,0b1h,0d2h,09ah
1537
        db      0eah,0d5h,047h,039h
1538
        db      09dh,0d2h,077h,0afh
1539
        db      004h,0dbh,026h,015h
1540
        db      073h,0dch,016h,083h
1541
        db      0e3h,063h,00bh,012h
1542
        db      094h,064h,03bh,084h
1543
        db      00dh,06dh,06ah,03eh
1544
        db      07ah,06ah,05ah,0a8h
1545
        db      0e4h,00eh,0cfh,00bh
1546
        db      093h,009h,0ffh,09dh
1547
        db      00ah,000h,0aeh,027h
1548
        db      07dh,007h,09eh,0b1h
1549
        db      0f0h,00fh,093h,044h
1550
        db      087h,008h,0a3h,0d2h
1551
        db      01eh,001h,0f2h,068h
1552
        db      069h,006h,0c2h,0feh
1553
        db      0f7h,062h,057h,05dh
1554
        db      080h,065h,067h,0cbh
1555
        db      019h,06ch,036h,071h
1556
        db      06eh,06bh,006h,0e7h
1557
        db      0feh,0d4h,01bh,076h
1558
        db      089h,0d3h,02bh,0e0h
1559
        db      010h,0dah,07ah,05ah
1560
        db      067h,0ddh,04ah,0cch
1561
        db      0f9h,0b9h,0dfh,06fh
1562
        db      08eh,0beh,0efh,0f9h
1563
        db      017h,0b7h,0beh,043h
1564
        db      060h,0b0h,08eh,0d5h
1565
        db      0d6h,0d6h,0a3h,0e8h
1566
        db      0a1h,0d1h,093h,07eh
1567
        db      038h,0d8h,0c2h,0c4h
1568
        db      04fh,0dfh,0f2h,052h
1569
        db      0d1h,0bbh,067h,0f1h
1570
        db      0a6h,0bch,057h,067h
1571
        db      03fh,0b5h,006h,0ddh
1572
        db      048h,0b2h,036h,04bh
1573
        db      0d8h,00dh,02bh,0dah
1574
        db      0afh,00ah,01bh,04ch
1575
        db      036h,003h,04ah,0f6h
1576
        db      041h,004h,07ah,060h
1577
        db      0dfh,060h,0efh,0c3h
1578
        db      0a8h,067h,0dfh,055h
1579
        db      031h,06eh,08eh,0efh
1580
        db      046h,069h,0beh,079h
1581
        db      0cbh,061h,0b3h,08ch
1582
        db      0bch,066h,083h,01ah
1583
        db      025h,06fh,0d2h,0a0h
1584
        db      052h,068h,0e2h,036h
1585
        db      0cch,00ch,077h,095h
1586
        db      0bbh,00bh,047h,003h
1587
        db      022h,002h,016h,0b9h
1588
        db      055h,005h,026h,02fh
1589
        db      0c5h,0bah,03bh,0beh
1590
        db      0b2h,0bdh,00bh,028h
1591
        db      02bh,0b4h,05ah,092h
1592
        db      05ch,0b3h,06ah,004h
1593
        db      0c2h,0d7h,0ffh,0a7h
1594
        db      0b5h,0d0h,0cfh,031h
1595
        db      02ch,0d9h,09eh,08bh
1596
        db      05bh,0deh,0aeh,01dh
1597
        db      09bh,064h,0c2h,0b0h
1598
        db      0ech,063h,0f2h,026h
1599
        db      075h,06ah,0a3h,09ch
1600
        db      002h,06dh,093h,00ah
1601
        db      09ch,009h,006h,0a9h
1602
        db      0ebh,00eh,036h,03fh
1603
        db      072h,007h,067h,085h
1604
        db      005h,000h,057h,013h
1605
        db      095h,0bfh,04ah,082h
1606
        db      0e2h,0b8h,07ah,014h
1607
        db      07bh,0b1h,02bh,0aeh
1608
        db      00ch,0b6h,01bh,038h
1609
        db      092h,0d2h,08eh,09bh
1610
        db      0e5h,0d5h,0beh,00dh
1611
        db      07ch,0dch,0efh,0b7h
1612
        db      00bh,0dbh,0dfh,021h
1613
        db      086h,0d3h,0d2h,0d4h
1614
        db      0f1h,0d4h,0e2h,042h
1615
        db      068h,0ddh,0b3h,0f8h
1616
        db      01fh,0dah,083h,06eh
1617
        db      081h,0beh,016h,0cdh
1618
        db      0f6h,0b9h,026h,05bh
1619
        db      06fh,0b0h,077h,0e1h
1620
        db      018h,0b7h,047h,077h
1621
        db      088h,008h,05ah,0e6h
1622
        db      0ffh,00fh,06ah,070h
1623
        db      066h,006h,03bh,0cah
1624
        db      011h,001h,00bh,05ch
1625
        db      08fh,065h,09eh,0ffh
1626
        db      0f8h,062h,0aeh,069h
1627
        db      061h,06bh,0ffh,0d3h
1628
        db      016h,06ch,0cfh,045h
1629
        db      0a0h,00ah,0e2h,078h
1630
        db      0d7h,00dh,0d2h,0eeh
1631
        db      04eh,004h,083h,054h
1632
        db      039h,003h,0b3h,0c2h
1633
        db      0a7h,067h,026h,061h
1634
        db      0d0h,060h,016h,0f7h
1635
        db      049h,069h,047h,04dh
1636
        db      03eh,06eh,077h,0dbh
1637
        db      0aeh,0d1h,06ah,04ah
1638
        db      0d9h,0d6h,05ah,0dch
1639
        db      040h,0dfh,00bh,066h
1640
        db      037h,0d8h,03bh,0f0h
1641
        db      0a9h,0bch,0aeh,053h
1642
        db      0deh,0bbh,09eh,0c5h
1643
        db      047h,0b2h,0cfh,07fh
1644
        db      030h,0b5h,0ffh,0e9h
1645
        db      0bdh,0bdh,0f2h,01ch
1646
        db      0cah,0bah,0c2h,08ah
1647
        db      053h,0b3h,093h,030h
1648
        db      024h,0b4h,0a3h,0a6h
1649
        db      0bah,0d0h,036h,005h
1650
        db      0cdh,0d7h,006h,093h
1651
        db      054h,0deh,057h,029h
1652
        db      023h,0d9h,067h,0bfh
1653
        db      0b3h,066h,07ah,02eh
1654
        db      0c4h,061h,04ah,0b8h
1655
        db      05dh,068h,01bh,002h
1656
        db      02ah,06fh,02bh,094h
1657
        db      0b4h,00bh,0beh,037h
1658
        db      0c3h,00ch,08eh,0a1h
1659
        db      05ah,005h,0dfh,01bh
1660
        db      02dh,002h,0efh,08dh
1661
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.