10 April 2014, 19:09 | #1 |
Posts: n/a
|
SAS/C 6.3 and Assembler
Hello, I'm new here and was hoping a SAS/C expert could help me.
A bit of background: I am following the YouTube ScoopexUs tutorials on hardware programming. I am using a WinUAE emulated A1200 (KS3.0/WB3.0) and A500 (KS1.3/WB1.2) with SAS/C 6.3. I stopped doing the tutorials on the A1200 because they didn't seem to work properly. The exact same code on the emulated A500 works fine. I'm posting for a different reason, however. I am using the SAS/C 6.3 compiler and assembler to write and build the code, and I am calling the ScoopexUs assembly language routine - which has a few modifications - from main(). The problem is that the assembler doesn't seem to understand "dc.w %0000000000000000", which, in tutorial 9, is used to define the shape of a sprite. The assembler replies with "syntax error" for these lines of code. The assembler will understand something like "dc.w $2cb8", but not binary representations. I don't know if this is also of any help, but earlier in the tutorials, I found that the SAS/C assembler also didn't understand the directive "DCB" for defining screen memory and replied with "unknown opcode" or something similar. I AllocMem()ed the memory for the screen to get around this particular problem, and is probably better that way anyway. The SAS/C paper manual, which I have, shows "DCB" as a valid directive (although I have found no source code examples in the documentation of how it is used) and the '%' sign as the character to prefix binary numbers. What am I doing wrong? I have included a couple of screen shots and the drawer with the Tutorial 9 SAS/C project. Thanks for any help. Justin. |
10 April 2014, 19:27 | #2 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
As for your problem with the binary dc.w statements, maybe the SAS/C assembler needs a special sign in front of the binary numbers (i.e. something else then %)? |
|
10 April 2014, 20:02 | #3 |
Posts: n/a
|
Thank you for your reply. I forgot about ds.b.
The manual definitely states prefixing binary numbers with a '%'. I tried the '@' for octal notation and that works, as does '$' for hexadecimal, and no prefix for decimal numbers. I tried an '&' for binary, but that didn't work. Justin. |
10 April 2014, 20:14 | #4 |
Posts: n/a
|
A tilde - '~' - seems to assemble without error, but don't know if it actually works yet.
Thanks for your help. |
10 April 2014, 20:27 | #5 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
10 April 2014, 20:36 | #6 |
Posts: n/a
|
I don't know what to do then, other than use hexadecimal.
Thanks. |
10 April 2014, 21:18 | #7 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
if you're using inline assembler, the syntax could be a little different than when having assembler code in a separate file, because the inline stuff is passed through the c compiler..
|
10 April 2014, 23:30 | #8 |
Posts: n/a
|
|
11 April 2014, 06:45 | #9 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
It does choke on extraneous spaces between operands, maybe it doesn't like trailing spaces either, or requires tabs instead of spaces somewhere? Sometimes shift+space or shift+return will produce a different character, have you tried re-typing the line? What if you put a single operand on each line?
It seems to work correctly in SAS/C 6.58, if you want to try that instead: https://www.dropbox.com/s/rt23fhty36...sc658.lha?dl=1 Last edited by Leffmann; 21 December 2016 at 20:34. |
11 April 2014, 13:10 | #10 | |
Posts: n/a
|
Quote:
move.b #%10001000,d0 so it seems it will work with binary notation, just not in a "dc" directive. I purchased the 6.3 version back in the first half of the 90s, and I don't think I would have a license to use the 6.58 upgrade. I wouldn't like to use that version, really. It seems like the problem could be a bug with 6.3. I'll work around it. Thank you for your help. |
|
22 July 2015, 20:19 | #11 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
If move.w #%1000100010001000,d0 does NOT work, then the problem might be that the compiler only handles bytes. Then you can split the dc.w into dc.b. Or, since the sprite smiley face in the tutorial is quite ugly, you can just put dc.w $ffff,$ffff instead of each binary line
You can also try removing leading spaces before dc.w or add a tab or spaces to put the "d" in dc.w at the same position as the "m" in your move.b example. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SAS C v6.50 | Avanaboy | request.Apps | 2 | 22 April 2012 02:48 |
Sas C 6.58 | AmiCoder | request.Apps | 3 | 06 February 2010 01:19 |
SAS/C v6.50 | zerostress | request.Apps | 3 | 08 October 2007 10:35 |
Sas C V 6.0 | Jherek Carnelia | request.Apps | 1 | 20 March 2007 10:13 |
Sas C | Scoglio | request.Apps | 0 | 28 October 2002 11:13 |
|
|