testcall.wb 694 B

1234567891011121314151617181920
  1. 100 ' test machine language call
  2. 110 A=varptr(@(0))
  3. 115 gosub 1000
  4. 120 ax=1:bx=2:cx=3:dx=4:si=-1:di=-2
  5. 130 call A
  6. 140 if ax <> 2 then debug "axの値が期待と違います":end
  7. 150 if bx <> 3 then debug "bxの値が期待と違います":end
  8. 160 if cx <> 4 then debug "cxの値が期待と違います":end
  9. 170 if dx <> 5 then debug "dxの値が期待と違います":end
  10. 180 if si <> 0 then debug "siの値が期待と違います":end
  11. 190 if di <> -1 then debug "diの値が期待と違います":end
  12. 900 debug "正常終了":end
  13. 1000 poke A+0,0x40 'inc ax
  14. 1010 poke A+1,0x43 'inc bx
  15. 1020 poke A+2,0x41 'inc cx
  16. 1030 poke A+3,0x42 'inc dx
  17. 1040 poke A+4,0x46 'inc si
  18. 1050 poke A+5,0x47 'inc di
  19. 1060 poke A+6,0xCB 'ret (FAR)
  20. 1090 return