Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid escape sequences and directory not matching instructions #14

Open
Sunspark-007 opened this issue Apr 29, 2024 · 2 comments
Open

Comments

@Sunspark-007
Copy link

For the escape sequences:

C:\Assembler>C:\Apps\sbasm3\sbasm.py sbasmtest.s
C:\Apps\sbasm3\sbapack\direct.py:504: SyntaxWarning: invalid escape sequence '.'
"""
C:\Apps\sbasm3\sbapack\files.py:92: SyntaxWarning: invalid escape sequence '\ '
"""
SB-Cross Assembler version 3.03.07

The test file from the website built ok with no errors, but I am wondering about the escape sequences error. This is on the latest Python version.

For the directory, the installation instructions say to place the sbasm.py file along with the headers, opcodes and sbapack directories from the installation zip. The thing is, opcodes is a level lower in a directory called "test".. I dragged it out, but there are two other folders in "test" called directives and assem. Are we to leave those folders behind? I just feel if the instructions specifically say to obtain the opcodes folder, it shouldn't be a level lower in a folder named "test" leaving the end-user wondering about the other two..

@sbprojects
Copy link
Owner

For the escape sequence:

This is strange. Both references (direct.py:504 and files.py:92) are 3 double quotes, starting a comment block. There shouldn't be any error or warning there because a comment block isn't code.
You're using sbasmtest.s as source file. Can you include it please?
I have tested it on a Windows machine for a change, and it doesn't throw any warnings there. Tried it on Windows 10 with Python version 3.12.3.

The installation story perhaps wasn't really clear. I've changed it a bit in the latest version. The only things you need to copy somewhere are the sbasm.py file and the sbapack directory. Both need to be in the same directory. All the other stuff is there for documentation/reference only. None of the the files in the other directories are necessary to run the assembler. You can put them anywhere you like, even in the trash if you like.
The header files may be useful though. If a header file for your particular controller exists, including the header file in your source will automatically define registers and peripherals for you. That will save you a lot of time and may avoid typos.

@Sunspark-007
Copy link
Author

Sunspark-007 commented May 4, 2024

I am starting over so it is clean on a Windows system.

Python 3.12 installed.
System path defined so typing sbasm.py at the command prompt works.

Observation: The website's instructions for Windows diverge from the Linux one, it says "Then you can move the file sbasm.py and the entire directories sbapack, headers and opcodes into a newly created directory placed wherever you prefer (e.g. C:\sbasm3). The remaining directories can be copied into your projects directory, wherever you like."

The source for the sbasmtest.s file is the one found on https://www.sbprojects.net/sbasm/quickstart.php which I copy and pasted out of the page for testing.

Trying first with a directory containing just sbasm.py and sbapack directory.

C:\Apps\sbasm3>sbasm.py sbasmtest.s
C:\Apps\sbasm3\sbapack\direct.py:504: SyntaxWarning: invalid escape sequence '\.'
  """
C:\Apps\sbasm3\sbapack\files.py:92: SyntaxWarning: invalid escape sequence '\ '
  """

SB-Cross Assembler version 3.03.10

Test 2, copied the headers directory into the folder. Improvement!

C:\Apps\sbasm3>sbasm.py sbasmtest.s

SB-Cross Assembler version 3.03.10

I did have the headers directory in the initial issue report before, so I don't really know why there was an issue at that time but so far, so good.

Right now I don't have the opcodes directory.. should the instructions at https://www.sbprojects.net/sbasm/install.php be updated to remove that mention or does that directory found inside the test folder have value?

PS. Looking at this again, I am realizing the example program appears it may not be properly commented, it only has a single semi-colon present and no asterisks in column 4.. now I am puzzled because the commenting issue with the quickstart program aside, why does it throw a complaint when the headers folder is not present but no complaint when it is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants