home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / GENASM / JNZTEST.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  2KB  |  64 lines

  1. ;
  2. ; Test of alleged bug in DCON and DDT 
  3. ; where JZ and JNZ supposedly trace
  4. ; incorrectly.    Result: no bug found.
  5. ;   05/28/82 and 05/29/82  (Ron Fowler)
  6. ;    |       |
  7. ;    |       |
  8. ;    |        ---> lowercase
  9. ;     --------------> uppercase
  10. ;
  11.     ORG    100H
  12. ;
  13. ;
  14. ;        TEST                   |     RESULT
  15. ;        ----                   |     ------
  16. ;                           |
  17. LOOP:    ORI    1        ;RESET Z       |
  18.     JNZ    NOZ1        ;TEST JNZ--------->| went to noz1, as expected
  19.     JZ    YESZ1        ;TEST JZ---------->| never got here
  20. ;                           |
  21. ; CAN'T GET HERE FROM UP THERE                     |
  22. ; (from noz1 or yesz1 only)               |
  23. ;                           |
  24. STEP2:    XRA    A        ;SET Z           |
  25.     JNZ    NOZ2        ;TEST JNZ--------->| didn't jump, as expected
  26.     JZ    YESZ2        ;----------------->| went to yesz2, expected
  27. ;                           |
  28. ; CAN'T GET HERE FROM UP THERE                     |
  29. ;                           |
  30. step3:    mvi    b,8        ;do a subtraction  |
  31.     mvi    a,8        ;that =0       |
  32.     sub    b        ;           |
  33.     jnz    noz3        ;----------------->| didn't jump here, expected
  34.     jz    yesz3        ;----------------->| jumped here as expected
  35. ;                           |
  36. ; ditto here from there                |
  37. ;                           |
  38. step4:    mvi    b,8        ;do subtraction    |
  39.     mvi    a,9        ;  that's nz       |
  40.     sub    b        ;           |
  41.     jnz    noz4        ;----------------->| jumped here, as expected
  42.     jz    yesz4        ;----------------->| never got here, expected
  43.  
  44. ;
  45. ; can't be here
  46. ;
  47.     jmp    loop        ;but do something anyway
  48. ;
  49. ; Turnaround here, and proceed to next step
  50. ;
  51. NOZ1:    JMP    STEP2
  52. YESZ1:    JMP    STEP2
  53. ;
  54. NOZ2:    JMP    step3        ;new further testing
  55. YESZ2:    JMP    step3
  56. ;
  57. noz3:    jmp    step4        ;one more test
  58. yesz3:    jmp    step4
  59. ;
  60. noz4:    jmp    loop        ;repeat entire test
  61. yesz4:    jmp    loop
  62. ;
  63.     end
  64.