sbprojects / sbasm3 Goto Github PK
View Code? Open in Web Editor NEWSB-Assembler Version 3 - Cross Macro Assembler
Home Page: https://www.sbprojects.net/sbasm
License: Creative Commons Zero v1.0 Universal
SB-Assembler Version 3 - Cross Macro Assembler
Home Page: https://www.sbprojects.net/sbasm
License: Creative Commons Zero v1.0 Universal
In the Z180 overlay the INO and OUTO commands are available, but they should be named IN0 and OUT0.
This can be changed in the files "crz80.py" and "crz180.py". Look for occurences of OUTO and INO and add/change the corresponding code to cover IN0 and OUT0
I was pleased to see that you have made changes to the relative addressing on the SC/MP module, and I have been trying to re-assemble the MK14 SCIOS ROM from source.
I installed SBASM from sbasm-master.zip downloaded from here and the scios assembled without errors.
However,there seems to be a problem on negative offsets calculated from P3:
0052- 115 ; Tape Interface Routines.
0052- 116 ; ****************************************************************************
00D5- 117 Count .EQ 0D5h
00D6- 118 Len .EQ 0D6h
0052- 119 ; ****************************************************************************
0052- 120 ; Store to Tape. P1^Data,@Count is the bytes
0052- 121 ; ****************************************************************************
0052-C5 01 122 ( 18) ToTape: ld @1(1) ; E := (P1), increment P1
0054-01 123 ( 7) xae
0055-C4 01 124 ( 10) ldi 1 ; A := 1 (the bit pattern)
0057-CB 00 125 ( 18) Next1: st Count(3) ; Save in Count (P3)
0059-C4 01 126 ( 10) ldi 1 ; set F0 to 1
005B-07 127 ( 6) cas
005C-8F 08 128 ( 13+) dly 8 ; Delay 8 Cycles
005E-C3 00 129 ( 18) ld Count(3) ; A = Count & E
0060-50 130 ( 6) ane ; test if bit is set...
0061-98 07 131 (9/11) jz Zero
0063-8F 18 132 ( 13+) dly 018h ; (bit is 1) Delay $18 cycles
0065-C4 00 133 ( 10) ldi 0 ; set F0 to 0 again
0067-07 134 ( 6) cas
0068-90 05 135 ( 11) jmp CDone
006A-C4 00 136 ( 10) Zero: ldi 0 ; bit is zero (set F0 to 0)
006C-07 137 ( 6) cas
006D-8F 18 138 ( 13+) dly 018h ; Delay $18 Cycles
The instruction "sta Count(3)" should generate CB D5 whereas it is generating CB 00.
I compared the output with a listing someone had done with TASM and verified that this was the case.
For your conveience I have attached the source for SCIOS in case it is useful.
scios.zip
.CR Z180
.EF macrotest.err
.LF macrotest.lst
head .MA name
.AS "]1"
.EM
>head "Marten"
>head "Marten\"Feldtmann"
.EN
Is there anyway to produce a list of cross references, or a map if you like, of where symbols were referenced please?
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..
I would like to see, that the expression could at least use "(" and ")" to make more complex calculation.
I mainly define textual constants and use these constants in my code, but very often I have to make calculation based on several constants with arithmetics like "*4", "*128" etc ...
Without thinking, I today used the following construct in an 8048 assembly file.
STROBE .EQ 080H
N_STROBE .EQ ~STROBE
When I assmebled it, I got
*** Error: Bad Operand
I 42 N_STROBE .EQ ~STROBE
I was surprised to see tilde didn't behave as the normal negate operand. In fact, I couldn't find such an operand anywhere in the documentation. Are there any plans for a negate operator please?. I've always found it very useful for making bit set and bit clear constants. Thanks.
Thanks for the great software.
I found a typo in "cr6800.py".
Could you Please check it out?
128 - 'BSR' : (Branch, 0x8D, '8', '3', '3'),
+ 'BSR' : (Branch, 0x8D, '8', '6', '5'),
$ ~/program/sbasm3/sbasm collatz.asm
SB-Cross Assembler version 3.03.07
Please visit www.sbprojects.net for a complete description.
Assembling....
Pass one
Loaded scmp overlay version 3.02.00
Source file: collatz.asm
*** Error: Bad Operand
107 DLY Delay(2)
1 Error found during assembly.
0 Warnings found during assembly.
$ echo $?
0
ERRLVL_PASS1 = 1 # Errors found during pass 1
ERRLVL_PASS2 = 2 # Errors found during pass 2
are never used
I may be wrong but I believe that the code generated for the following test cases is incorrect:
LDA $1234,PC
LDA -$1234,PC
03DA-A6 8D 12 34 468 (10) LDA $1234,PC
03DE-A6 8D ED CC 469 (10) LDA -$1234,PC
The offset of $1234 looks incorrect for a PC relative address. I believe that the correct code for test.hex should be:
A6 8D 0E56
A6 8D E9EA
This would be based on a PC of $3DA, and an address target of $1234. Computing the PCR Offset is then $1234 - $3DA - 4 bytes for instruction length = $E56. My own 6809 assembler and EDTASM+ seem to agree. As does the example provided in Barden's TRS-80 Color Computer Assembly Language book p224.
Here is the .hex output file diff from test/motorola/6809.asm from my assembler to yours:
62,63c62,63
< :1003D000ABE6AB96ABB5ABDBABF6A68D0E56A68DFA
< :0203E000E9EA48
---
> :1003D000ABE6AB96ABB5ABDBABF6A68D1234A68D18
> :0203E000EDCC62
If you agree LMK if you'd like me to send a PR.
https://download.sbprojects.net/sbasm/sbasm30307.zip does not contain the LICENSE file.
Have you thought about tagging versions and creating respective releases on Github - then Github takes care to include everything. ๐
when I use the " to get a negative ascii value, to set bit 8 to a 1 it does nothing see code output:
9536-83 3378 .DB 83H ; BYE
9537-42 59 3379 .DB 'BY'
9539-45 3380 .DB 'E'
953A-45 3381 .DB "E"
953B-C5 3382 .AS -/E/
Work around is to use .AS -/blabla/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.