(Solved) Using MOVI for modifying instruction - potential trap
pems
Posts: 70
EDIT: not a problem - read my post below. I didn't realize MOVI only modifies 9bits
Hi
Bringing to everyone attention something that has taken about 2hrs of my life which i won't get back
tried using MOVI like so
and it doesn't work!!!
i did find what was wrong, and the following code does work as expected
seems like MOVI wants it's dest to be indirect, which is inconsistent with the way MOVS and MOVD work
trap?
Post Edited (pems) : 10/6/2008 1:10:06 AM GMT
Hi
Bringing to everyone attention something that has taken about 2hrs of my life which i won't get back
tried using MOVI like so
movi store, store_instr movd store, <blah> movs store, <bleh> ... ... store wrlong, 0-0, 0-0 ' wrlong here doesn't really matter, can be anything really ... ... store_instr LONG $20f ' correct value for wrlong instruction with indirect source
and it doesn't work!!!
i did find what was wrong, and the following code does work as expected
mov temp, #store movi temp, store_instr movd store, <blah> movs store, <bleh> ... ... store wrlong, 0-0, 0-0 ... ... store_instr LONG $20f temp LONG $0
seems like MOVI wants it's dest to be indirect, which is inconsistent with the way MOVS and MOVD work
trap?
Post Edited (pems) : 10/6/2008 1:10:06 AM GMT
Comments
The problem is that the instruction field (6 bits) plus the flags field (3 bits) does not include the indirect bit. It includes only the ZCR bits.
The MOVI instruction deals only with the most significant 9 bits of the destination.
Indeed, as i've just discovered searching the forum, the MOVI only modifies most significant 9 bits, and not 14 as i have assumed
oh and forget about the indirection working (as shown in my last post), it was simply modifying different location and not the 'store' itself, so the store was using the wrlong that was there to begin with, so everything still worked.