A86: recalling x and y variables into asm program to draw lines


[Prev][Next][Index][Thread]

A86: recalling x and y variables into asm program to draw lines



l have written an asm program which is supposed to draw a mouse cursor (like
for a GUl) and l'm having some trouble with it.  for one thing even if x and
y are nonzero digits the program will still only draw a pixel in the middle
of the graph screen (if l'm lucky).  sometimes (especially when being run
from another program) it will give a divide by zero error.  

here's the code:

0004   D748             .org _asm_exec_ram
0005   D748             
0006   D748             ProgStart:
0007   D748             
0008   D748 CD E3 4C       call _RCLX
0009   D74B CD 77 55       call _CONVOP1
0010   D74E 43             ld b, e
0011   D74F 53             ld d,e
0012   D750             
0013   D750 CD DF 4C       call _RCLY
0014   D753 CD 77 55       call _CONVOP1
0015   D756 4B             ld c, e
0016   D757             
0017   D757 1D             dec e
0018   D758 1D             dec e
0019   D759             
0020   D759 CD E9 51       call _CLine
0021   D75C 26 02          ld h, 2
0022   D75E             
0023   D75E 1D             dec e
0024   D75F 14             inc d
0025   D760 14             inc d
0026   D761 14             inc d
0027   D762             
0028   D762 CD E9 51       call _CLine
0029   D765 26 02          ld h, 2
0030   D767             
0031   D767 15             dec d
0032   D768 1C             inc e
0033   D769 1C             inc e
0034   D76A 1C             inc e
0035   D76B             
0036   D76B CD E9 51       call _CLine
0037   D76E 26 02          ld h, 2
0038   D770             
0039   D770 C9             ret
0040   D771             
0041   D771
            ;-----------------------------------------------------
0042   D771             ; End of program
0043   D771
            ;-----------------------------------------------------
0044   D771             .end
tasm: Number of errors = 0