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...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

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
[vmu] Please COMMENT your stuff...   Message List  
Reply | Forward Message #53 of 1156 |
[vmu] Re: Please COMMENT your stuff...

tyr-@... (alessandro sanasi) wrote:
original article:http://www.egroups.com/group/vmu-dev/?start=51
> MOV #$80,ACC ; move value $80 into ACC register
> ST 2 ; store it in memory address 2

Those kind of comments are in IMO worse than no comments at all. If
someone doesn't know what the ST instruction does, it's easy enough to
look it up. A comment should tell you about the _purpose_ of the
instruction, not the _function_. For example:

MOV #3,lvs ; start with three lives

not

MOV #3,lvs ; move the number three into address lvs


> fwcall .macro
> mov #<$0123,0
> push 0
> mov #>$0123,0
> push 0
> not1 ext,0
> jmpf \1
> .endm
>
> bios_rflash:
> fwcall $e027
>
> How does macro definition work in the VMU assembler, and how are
those
> macros used? What does stuff like "mov #<$0123,0" or "jmpf \1" do
> exactly? What's the "\1" for in the latter? What's a "fwcall"?

The .macro definition just stores the next lines (up to .endm) into a
macro called "fwcall". The "fwcall $e027" line below will invoke the
macro, which simply means that the lines stored previously are
substituted for the macro call. In the process, all \n where n is a
number are substituted for the nth positional argument to the macro.
So \1 will be replaced with the first argument to the macro, namely
$e027.

As for "mov #<$0123,0", well it moves the low byte of the constant
$0123 into address 0. It's a perfectly normal mov instruction.

Btw, the firmware call macro uses a dirty trick. You are not required
or expected to understand how it works. :-)


> And here:
>
> clr1 ie,7
> mov #$81,ocr
> mov #2,xbnk
> push xram+4
> set1 xram+4,0
> mov #0,$7c
> callf bios_wflash
> callf bios_vflash
> pop xram+4
> pop xbnk
>
> Why is xram+4 pushed on the stack?

Because the "flash access" icon on the LCD should be restored to its
previous state when we're done writing. The 'normal' FLASH write
function (at $100) handles the display of this icon for us, but here we
have to get our hands dirty outselves. (Or simply ignore the icon.
But I think it's nice. :)


> Wouldn't that be the data at address
> $184 or what?

Yes.

> Or why is xbnk set to #2?

Because there's where the icons live.


// Marcus






Tue Mar 7, 2000 2:14 pm

marcus@...
Send Email Send Email

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

Hello. Just wanted to mention it... when anyone of you posts source code, even if it's only a small part, PLEASE COMMENT IT, preferably EVERY SINGLE LINE! ...
Alessandro Sanasi
tyro@...
Send Email
Mar 7, 2000
2:25 am

tyr-@... (alessandro sanasi) wrote: original article:http://www.egroups.com/group/vmu-dev/?start=51 ... Those kind of comments are in IMO worse...
Marcus Comstedt
marcus@...
Send Email
Mar 7, 2000
2:14 pm

... Agreed. Of course it's better to actually write what purpose an instruction has instead of just explaining the function. But I also think that when the...
Alessandro Sanasi
tyro@...
Send Email
Mar 19, 2000
10:23 pm

tyr-@... (alessandro sanasi) wrote: original article:http://www.egroups.com/group/vmu-dev/?start=83 ... stack ... that ... code to ... address ... ...
Marcus Comstedt
marcus@...
Send Email
Mar 26, 2000
11:41 pm

... Uh... guess I simply read your code wrong, then. At first glance it looked to me as if you were pushing the contents of Rom location $0123 and $0124 onto...
tyro@...
Send Email
Apr 6, 2000
2:54 am
Advanced

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