English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 08 April 2020, 18:33   #1
Curbie
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.
Curbie is offline  
Old 08 April 2020, 18:37   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
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.
Samurai_Crow is offline  
Old 09 April 2020, 02:31   #3
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Quote:
Originally Posted by Samurai_Crow View Post
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.
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
Curbie is offline  
Old 09 April 2020, 08:50   #4
meynaf
son of 68k
 
meynaf's Avatar
 
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.
meynaf is offline  
Old 09 April 2020, 09:56   #5
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Quote:
Originally Posted by meynaf View Post
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.
Let me guess, your guess was a guess of experience. It was a tab, Thank you!

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
Curbie is offline  
Old 09 April 2020, 11:26   #6
phx
Natteravn
 
phx's Avatar
 
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.
phx is offline  
Old 09 April 2020, 15:57   #7
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Quote:
Originally Posted by phx View Post
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.
No dot in the label, I wasn't trying to hide anything, just trying to prevent people from reading though a whole bunch of simple test code, but, as you wish:


; 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
Curbie is offline  
Old 09 April 2020, 16:19   #8
Curbie
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.
Attached Files
File Type: s soplay.s (3.1 KB, 73 views)
Curbie is offline  
Old 09 April 2020, 20:18   #9
phx
Natteravn
 
phx's Avatar
 
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.
You expect that to work?
phx is offline  
Old 09 April 2020, 20:55   #10
Curbie
Registered User
 
Join Date: Feb 2020
Location: USA
Posts: 41
Quote:
Originally Posted by phx View Post
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.
You expect that to work?
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!
Curbie is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:04.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11383 seconds with 16 queries