Search the web
Sign In
New User? Sign Up
vmu-dev · The VMU Development list
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: [vmu] Some questions...   Message List  
Reply | Forward Message #783 of 1156 |
.cnop (was: Some questions...)

At 3/6/01 01:34 PM , john maushammer wrote:
>
> developer@... wrote:
>
> > 1-What is .cnop? (pad to an even number of blocks? What is it?)
>
> Yep - the .cnop instruction pads out to an even number of blocks. The
> first argument is the byte to pad it with, and the second argument is
> the multiple of bytes to pad to (i.e. $200= pad to $200, $400, $600,
> etc.)

Well, actually the value of the emitted byte is always zero (ie: a NOP
instruction). The first parameter is for emitting an arbitrary number of
bytes (NOP's) up to but less than the second parameter. The second
parameter is, of course, for specifying a byte boundary to pad too, but it
must be a power of two. Thus, $600 wouldn't work.

I can't say I understand the rationale behind '.cnop' but that seems to be
it's modus operandi. ;-)

BTW, here is the actual code that is called in the assembler. I looked
this up when I was trying to understand it myself:

void smach_cnop (numtype offs, numtype modulo)
{
if (modulo <= 0 || (modulo & (modulo - 1)) != 0)
errormsg ("second argument to cnop must be a positive power of two");
else if (offs < 0 || offs >= modulo)
errormsg ("first argument to cnop out of range");
else {
emit_prefix (modulo | offs);
EMIT (OP_CNOP);
}
}




Wed Mar 7, 2001 7:49 pm

bchapman@...
Send Email Send Email

Forward
Message #783 of 1156 |
Expand Messages Author Sort by Date

... Heh. I dont think I'm the youngest anymore. I'm only 14. ... I dont think anyone actually minds, because you can do alot with 20MB of space. ... I think...
Paul Kratt
sblur@...
Send Email
Nov 8, 2000
12:30 am

... Yep - the .cnop instruction pads out to an even number of blocks. The first argument is the byte to pad it with, and the second argument is the multiple of...
john maushammer
john@...
Send Email
Mar 6, 2001
7:03 pm

Thank you very much!...
developer@...
Send Email
Mar 6, 2001
10:28 pm

... Well, actually the value of the emitted byte is always zero (ie: a NOP instruction). The first parameter is for emitting an arbitrary number of bytes...
Brian Chapman
bchapman@...
Send Email
Mar 7, 2001
9:26 pm

(Sorry for my poor english:) Well... thanx but I dont think u r right... The first parameter does something like: if (length of all the bin until now)>(1st...
developer@...
Send Email
Mar 10, 2001
12:05 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help