GHGAEEM@cc1.kuleuven.ac.be (02/08/91)
In the article "Assembly lang Help" <J56QC@CUNYVM.BITNET> asks what the purpose of the CNOP directive might be ... Since nobody seems to answer this programmer, I'll just have to do it. CNOP is used in a lot of assemblers to make your code align at a certain address. This means that a CNOP 4,0 will fill up bytes with the value 0 until it reaches an address that's dividable (sorry if this is not the right english word) by 4, i.e. long-aligned. Other assembler (like MasterSeka) use some other directives like EVEN (instead of CNOP 2,0) or ALIGN.x (to align with word or long addresses). I hope you've understood my little explenation, even though my english is not to good. Stay on programming for the Amiga. There's no other computer to do it on |
cg@ami-cg.UUCP (Chris Gray) (02/08/91)
In article <91038.170132GHGAEEM@cc1.kuleuven.ac.be> GHGAEEM@cc1.kuleuven.ac.be >In the article "Assembly lang Help" <J56QC@CUNYVM.BITNET> asks what the >purpose of the CNOP directive might be ... Since nobody seems to answer this >programmer, I'll just have to do it. CNOP is used in a lot of assemblers to >make your code align at a certain address. This means that a CNOP 4,0 will >fill up bytes with the value 0 until it reaches an address that's dividable >(sorry if this is not the right english word) by 4, i.e. long-aligned. Other >assembler (like MasterSeka) use some other directives like EVEN (instead of >CNOP 2,0) or ALIGN.x (to align with word or long addresses). > >I hope you've understood my little explenation, even though my english is not >to good. Your English is fine, but your explanation might be a bit wrong. The key is that the pseudo-op is CNOP, which is short for Conditional No OPeration. It normally is used for aligning code, not data, so it doesn't generate 0 bytes, but NOP instructions. Otherwise, I believe you are correct. (I've never used the CAPE assembler - I'm going on what the directive means in the other assemblers I've used, mostly the IBM 360/370 one.) -- Chris Gray usenet: alberta!ami-cg!cg CIS: 74007,1165