08 April 2020, 18:33 | #1 |
Registered User
Join Date: Feb 2020
Location: USA
Posts: 41
|
Vasm “so.” directive
Among other things I’m doing to learn assembler for the Amiga, I’m attempting to port some old (Alpha Micro) universal files (like include files), which would be the first step in porting some old Alpha Micro code. While attempting to port the first universal file, I’m running into a Vasm assembly error of unknown mnemonic <mnemonic?>
Called from a macro, any suggestion on what I goofed up? command line: curbie@curbie-main:~/bin$ vasmm68k_mot -Fhunkexe -o soplay soplay.s vasm 1.8g (c) in 2002-2019 Volker Barthelmann vasm M68k/CPU32/ColdFire cpu backend 2.3f (c) 2002-2019 Frank Wille vasm motorola syntax module 3.13 (c) 2002-2019 Frank Wille vasm hunk format output module 2.11 (c) 2002-2019 Frank Wille error 2 in line 1 of "OFDEF": unknown mnemonic <JobBuf> called from line 45 of "soplay.s" > \1 so.b \2 ; lable equals structure offset counter plus number of bytes error 2 in line 1 of "OFDEF": unknown mnemonic <JobUse> called from line 46 of "soplay.s" > \1 so.b \2 ; lable equals structure offset counter plus number of bytes error 2 in line 1 of "OFSIZ": unknown mnemonic <ImpSiz> called from line 60 of "soplay.s" > \1 so.b __SO ; lable equals structure offset counter From Vasm.pdf: <label> so.<size> <expression> Assigns the current value of the structure offset counter to <label>. Afterwards the counter is incremented by the instruction’s <size> multiplied by <expres- sion>. Any valid M68k size extension is allowed for <size>: b, w, l, q, s, d, x, p. The offset counter can also be referenced directly under the name __SO. |
08 April 2020, 18:37 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
Shared Objects (.so files) aren't supported by Amiga's operating system. You have to convert them into Amiga style shared library files (.library files) using jump tables and so on.
|
09 April 2020, 02:31 | #3 |
Registered User
Join Date: Feb 2020
Location: USA
Posts: 41
|
Thanks for the reply, but I don't think we're on the same page...VAsm assembler directive, Chapter 4: Mot Syntax Module, page 31 of vasm.pdf
|
09 April 2020, 08:50 | #4 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Let me guess... there is a space before \1 in your macro, isn't it ?
There must be no space or tabs before a label, otherwise it will be interpreted as a directive - and end up with some error message telling said directive is unknown. |
09 April 2020, 09:56 | #5 | |
Registered User
Join Date: Feb 2020
Location: USA
Posts: 41
|
Quote:
But in fix that error, I'm getting another: curbie@curbie-main:~/bin$ vasmm68k_mot -Fhunkexe -o soplay soplay.s vasm 1.8g (c) in 2002-2019 Volker Barthelmann vasm M68k/CPU32/ColdFire cpu backend 2.3f (c) 2002-2019 Frank Wille vasm motorola syntax module 3.13 (c) 2002-2019 Frank Wille vasm hunk format output module 2.11 (c) 2002-2019 Frank Wille error 2 in line 1 of "OFDEF": unknown mnemonic <.> called from line 45 of "soplay.s" >\1 so.b \2 ; lable equals structure offset counter plus number of bytes error 2 in line 1 of "OFDEF": unknown mnemonic <.> called from line 46 of "soplay.s" >\1 so.b \2 ; lable equals structure offset counter plus number of bytes |
|
09 April 2020, 11:26 | #6 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
My guess would be that there is a '.' in a label your are passing into your OFDEF macro?
In its default setting vasm doesn't allow dots in a label, to avoid conflicts with size extensions (like .b, .w, .l). You can enable that feature nevertheless, if you really want it, or for testing, with the -ldots option. To come away from all that guessing you could also show us the complete OFDEF macro and the lines 45 and 46 of your source calling it. Also make sure to put the source text into [code]tags, which results in a monospaced font and makes it easier for us to spot syntax errors. |
09 April 2020, 15:57 | #7 | |
Registered User
Join Date: Feb 2020
Location: USA
Posts: 41
|
Quote:
; play with SO (structure offset) ; vasmm68k_mot -Fhunkexe -o soplay soplay.s ; ported macro macro OFDEF \1, \2 ; offset definition macro \1 so.b \2 ; lable equals structure offset counter plus number of bytes ifb \2 ; if argument 2 (size in bytes) blank setso __SO+1 ; increment structure offset counter by one endc ; end if argument 2 (size in bytes) blank condition ifnb \2 ; if argument 2 (size in bytes) NOT blank setso __SO+\2 ; add argument 2 (size in bytes) to structure offset counter endc ; end if argument 2 (size in bytes) not blank condition endm ; end OFDEF macro macro OFINI ; offset initialization definition macro ifb \1 ; if argument 1 (initial size in bytes) blank setso 0 ; initialize __SO (sturcture offset) counter to zero endc ; end if argument 1 (initial size in bytes) blank condition ifnb \1 ; if argument 1 (initial size in bytes) not blank setso \1 ; initialize __SO (sturcture offset) counter with it endc ; end if argument 1 (initial size in bytes) not blank condition endm ; end OFINI macro macro OFSIZ ; offset structure size macro \1 so.b __SO ; lable equals structure offset counter endm ; end OFSIZ macro ; ported from Alpha Micro macro ;$$OFLC=12 ;DEFINE OFDEF arg1,arg2 ; arg1=$$OFLC ; IF B, arg2, $$OFLC=$$OFLC+1 ; IF NB, arg2, $$OFLC=$$OFLC+arg2 ; ENDM ;DEFINE .OFINI arg1 ; IF B, arg1, $$OFLC=0 ; IF NB, arg1, $$OFLC=arg1 ; ENDM ;DEFINE .OFSIZ arg1 ; arg1=$$OFLC ; ENDM ; example of macros in use (Alpha Micro code) OFINI OFDEF JobBuf, 08. ; job and terminal name OFDEF JobUse, 04. ; jobs in use ; OFDEF TotJob, 04. ; total number of jobs ; OFDEF Jentry, 04. ; number of job entries ; OFDEF JobLog, 04. ; number of jobs logged in ; OFDEF SysDev, 04. ; number of devices on system ; OFDEF SFRBuf, 04. ; special functions rout addr (DD.BMS) ; OFDEF BmSize, 04. ; address of bitmap size (DD.BMS) ; OFDEF DevCnt, 04. ; device counter ; OFDEF LnkBuf, 04. ; link buffer ; OFDEF TotLnk, 04. ; number of linked systems ; OFDEF LnkFlg, 04. ; link flag and number ; OFDEF TbAddr, 04. ; system table address ; OFDEF BreFlg, 04. ; breif display flag (/N) ; OFDEF BlkFre, 04. ; blocks free OFSIZ ImpSiz ; imoure memory modual size ; vasm code testing ImpSiz length ;E68K EQU 1 ; no comment if assembling for EASY68K E68K EQU 0 ; no comment if assembling for Vasm IFNE E68K ; if assembling for EASY68K ORG $1000 ; where START: and first instruction of program is to be located in memory ENDC ; end if assembling for EASY68K condition ; Put program code here START: move.l X,d0 ; move SO to do rts ; return to OS IFNE E68K ; if assembling for EASY68K SIMHALT ; halt simulator ENDC ; end if assembling for EASY68K condition ; Put variables and constants here X: DC.L ImpSiz ; allocate one Lword and initialize it to ImpSiz IFNE E68K ; if assembling for EASY68K END START ; last line of "START:" source code block ENDC ; end if assembling for EASY68K condition |
|
09 April 2020, 16:19 | #8 |
Registered User
Join Date: Feb 2020
Location: USA
Posts: 41
|
I forgot, this type of discussion board, compresses excess white space out of posts, so here is a .txt type file, with a .s extension of the problem.
|
09 April 2020, 20:18 | #9 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Why is there a '.' after all the second arguments for the OFDEF macro? Your
OFDEF JobBuf, 08.macro call will transform into Code:
JobBuf so.b 08. |
09 April 2020, 20:55 | #10 |
Registered User
Join Date: Feb 2020
Location: USA
Posts: 41
|
It's an Alpha Micro 8 decimal, the period is the decimal operator. My apologies, I caught the dot offini, offdef, & ofsiz that you correctly guessed/knew was there and corrected it, but not the decimal dot, and that seems like the last error, thank you!
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Issues with ORG directive (vasm + FS-UAE) | Maggot | Coders. Asm / Hardware | 15 | 05 September 2023 11:56 |
vasm basereg example directive | mcgeezer | Coders. Asm / Hardware | 7 | 18 November 2020 19:58 |
DS directive - is it zeroed? | Antiriad_UK | Coders. Asm / Hardware | 88 | 13 June 2019 16:54 |
REPT directive in vasm | phx | Coders. Asm / Hardware | 8 | 01 October 2014 21:48 |
Invalid Directive | Kimmo | support.WinUAE | 1 | 23 July 2004 11:23 |
|
|