Search found 29 matches

by Darrel Taylor
Fri Feb 02, 2007 12:42 am
Forum: Compiler
Topic: Constants and ASM
Replies: 1
Views: 2332

Constants and ASM

I like the way Swordfish locates the variables and constants used in the asm and creates VARIABLE's that correspond with them. But I'm having problems with the constants. For instance... Const Aconst As Word = 500 ASM movlw High(Aconst) End ASM Results in ... VARIABLE ACONST = 244 MOVLW HIGH(ACONST)...
by Darrel Taylor
Fri Jan 19, 2007 3:32 am
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

MOST of the instructions only use 1 word, but there are a few that take 2.

CALL
GOTO
LFSR
MOVFF

You can see it in the Instruction Set section of the datasheet, where it lists both WORDs and Cycles for each opcode.
by Darrel Taylor
Fri Jan 19, 2007 12:12 am
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

I'm sure those would work, but it doesn't reduce the code size. MOVFF is a 2-word instruction ORG 0 CLRF TRISB ; 1 MOVFF CMCON, EECON1 ; 2 MOVFF EEDATA,LATB ; 2 INCF EEADR,1 ; 1 ;---- ; 6 words = 12 bytes Thought ya had me there for a minuite. :P
by Darrel Taylor
Wed Jan 17, 2007 10:08 am
Forum: Compiler
Topic: can we use absolute keyword ? USB support ???
Replies: 6
Views: 5065

:P The damage is already done mister_e.

But it's good to know I won't need to write a Swordfish USB module for my new program. :D

One less thing to worry about.
Although, in an odd sort of way, I was looking forward to it.
by Darrel Taylor
Wed Jan 03, 2007 4:38 am
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

Ha! There you go. :idea: Now it's the smallest 100% Swordfish program to do the job. And since you mentioned you were doing it on another forum too, and I assume that's a different language. Let me just continue the Sillyness with this 100% ASM program that I think would be the smallest, for any lan...
by Darrel Taylor
Mon Jan 01, 2007 5:51 am
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

Thanks xor, But the "Good" part is debatable, as I'm sitting here on New Years Eve, still trying to come up with a better way. :oops: I wasn't satisfied with the last version at 35 bytes, because it relied on the bootloader for the timing, so in effect it really needed more code space than what Swor...
by Darrel Taylor
Sun Dec 31, 2006 9:42 am
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

Dude! You're a hard man to beat. But here goes... 35 bytes. Device = 18F452 Clock = 20 Config WDT = OFF, STVR = OFF EEPROM = (1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1, 1...
by Darrel Taylor
Wed Dec 27, 2006 9:08 pm
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

Hi Bruce , Indeed it does. Nice catch. I don't think I turned the power off the whole time I was playing with it. But sure enough, it only works some of the time when you do. It doesn't add much, weighs in at 39 bytes now. XOR , That works, although it runs a little bit slower. Possibly from the pow...
by Darrel Taylor
Wed Dec 27, 2006 1:02 am
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

Tim, Thanks, I got lucky with that, since I had actually given up trying to beat your example. But after Bruce came up with something better, I figured maybe I quit too soon. :? XOR, Thought you had it! But after trying it, I found that Swordfish automatically puts ... SBGLB2 CLRWDT SLEEP BRA SBGLB...
by Darrel Taylor
Tue Dec 26, 2006 4:39 am
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

Yeah, you're right. It's not exactly symmetrical . I was paying more attention to the challenge, than the look. So, here's a symmetrical data sequence. EEPROM = (1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1, 1,2,4,8,1...
by Darrel Taylor
Mon Dec 25, 2006 9:11 am
Forum: Compiler
Topic: CHRISTMAS LITES OPTIMIZATION
Replies: 24
Views: 14163

Here's 37 bytes. Assuming we're only talking Program space. Device = 18F452 Clock = 20 Config WDT = ON, WDTPS = 4 EEPROM = (1,2,4,8,16,32,64,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128,64,32,16,8,4,2,1, 1,2,4,8,16,32,64,128...
by Darrel Taylor
Tue Dec 12, 2006 12:46 pm
Forum: User Modules
Topic: Temperature Coversion Module
Replies: 9
Views: 8062

Hi Michael, That's great. Glad to know you can make some use of it. And I just happen to have a use for a Pressure units Converter too. But I'll leave that one up to you this time. :) I'm also going to need a Flow converter (GPM, GPH, GPD, LPM, LPH, LPD, etc). And of course there are so many other l...
by Darrel Taylor
Sun Nov 19, 2006 7:25 pm
Forum: Compiler
Topic: ADC to PWM Demonstration
Replies: 3
Views: 3765

Thanks for the info Warren,

I've always known LATB was there, but never saw anyone use it before, and never really thought much about what it was there for.

And, "roger that" on the "learning tool".
by Darrel Taylor
Sun Nov 19, 2006 1:06 am
Forum: Compiler
Topic: ADC to PWM Demonstration
Replies: 3
Views: 3765

Hi Warren,

Just curious if there's some advantage to using LATB, instead of PORTB in your program?

Is it to overcome the Read/Modify/Write problem of the port?

Why the PWM output on all 8 pins of PORTB?

And, why not use the CCP module, since the PIC is now stuck doing a single task.
by Darrel Taylor
Mon Nov 06, 2006 9:59 am
Forum: Compiler
Topic: November 6th, Already?
Replies: 3
Views: 3565

Excellent!

Thanks David.

My order's in.