English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 01 May 2022, 14:20   #301
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by hop View Post
Is it possible to use environment variables in vasm args?
Just reading up on this in the vscode docs:
Why aren't variables in tasks.json being resolved

"only command, args, and options support variable substitution".

In this case the property is 'vasm.args', so it won't automatically be expanded. I'd suspect that there might be an API that the extension could use to add support though. I'll look into this.

Last edited by gigabates; 01 May 2022 at 14:22. Reason: missing quote for reply
gigabates is offline  
Old 01 May 2022, 16:49   #302
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Well spotted thanks. I hope there is a straightforward solution.
hop is offline  
Old 02 May 2022, 21:48   #303
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by hop View Post
Well spotted thanks. I hope there is a straightforward solution.
I've opened a pull request to add this feature so hopefully it will be available soon.
gigabates is offline  
Old 02 May 2022, 23:39   #304
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Quote:
Originally Posted by gigabates View Post
I've opened a pull request to add this feature so hopefully it will be available soon.
@gigabates Thanks for the PR.
The 1.3.4 pre-release is done it should be available in the next hour on the market place.
prb28 is offline  
Old 03 May 2022, 18:54   #305
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
1.3.4 pre-release

I've updated to the latest pre-release build. It didn't work at first, but started working once I restarted the IDE. At first it complained about binaries, so I forced a download and then it started working.

Many thanks this is great.

It would be great if env vars could be used in the vlink exefilename field to specify an absoute path for the output. This would allow all executables in a workspaced to build to a common (shared) build folder. My current working solution is to use relative paths:

Code:
"exefilename": "../../../../../build/copperbars"
I would like to be able to do something like this:

Code:
"exefilename": "${env:BUILD}/copperbars",
Where

Code:
Executing task: echo workspaceFolder=C:\GitHub\hop\amiga-assembly\target\samples\hardware\copper\copperbars  env:INCLUDE=C:\GitHub\hop\amiga-assembly\target\include env:Build=C:\GitHub\hop\amiga-assembly\target\build <

workspaceFolder=C:\GitHub\hop\amiga-assembly\target\samples\hardware\copper\copperbars
env:INCLUDE=C:\GitHub\hop\amiga-assembly\target\include
env:Build=C:\GitHub\hop\amiga-assembly\target\build
However the macro is not expanded in this field, so this results in:

Code:
Linking_________________________________________
c:\Users\hop\AppData\Roaming\Code\User\globalStorage\prb28.amiga-assembly\downloads\vscode-amiga-assembly-binaries-@-1.3.4\vscode-amiga-assembly-binaries-windows_x64/vlink -bamigahunk -Bstatic -o c:\GitHub\hop\amiga-assembly\target\samples\hardware\copper\copperbars\build\${env:BUILD}\copperbars c:\GitHub\hop\amiga-assembly\target\samples\hardware\copper\copperbars\build\copperbars.o
Error 29: Can't create output file c:\GitHub\hop\amiga-assembly\target\samples\hardware\copper\copperbars\build\${env:BUILD}\copperbars.

Linker error: Error 29: Can't create output file c:\GitHub\hop\amiga-assembly\target\samples\hardware\copper\copperbars\build\${env:BUILD}\copperbars.
Linker error: Error 29: Can't create output file c:\GitHub\hop\amiga-assembly\target\samples\hardware\copper\copperbars\build\${env:BUILD}\copperbars..
Perhaps one possible solution would allow the extension's global "Build Dir" to be overridden in the vasm and vlink tasks. This would allow intermediates (.o) to build to an ignored local intermediates folder, and the final executables to build to a common folder.

Code:
"vasm": {
    ...
    "buildDir": "intermediates",  // I'm only assembling, not linking
    <snip>
 
"vlink": {
   "buildDir": "${env:BUILD}",  // all my projects build into here
   "exefilename": "copperbars",
Would something like this be possible?
hop is offline  
Old 04 May 2022, 09:49   #306
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Yeah it needs to be applied on a per-field basis. I only added it for the args arrays but it shouldn't be a problem to add it for others.
gigabates is offline  
Old 04 May 2022, 15:03   #307
hop
Registered User
 
Join Date: Apr 2019
Location: UK
Posts: 172
Excellent. If the 'exeFilename' field supports variable substitution and absolute paths that would be great.
hop is offline  
Old 07 May 2022, 13:47   #308
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Pull request from gigabates in 1.3.5 pre-release.
I'll do a real release soon.
prb28 is offline  
Old 05 July 2022, 18:58   #309
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 189
I'm trying to get the current version 1.4.0 of this great plugin to run in a kinda strange hybrid mode:

- Visual Studio Code runs in normal Windows mode (Not in WSL mode)
- But the files to build (the include dir etc) are on a WSL share which is accessed like "\\wsl$\Debian\home\{username}\winuae-share\Workbench\dev\asm\Amiga-hardware-coding\build\SimpleCopper.o

And the assembly works so far:

Code:
Compiling current editor file...
building \\wsl$\Debian\home\{username}\winuae-share\Workbench\dev\asm\Amiga-hardware-coding\build\SimpleCopper.o
c:\Users\{username}\AppData\Roaming\Code\User\globalStorage\prb28.amiga-assembly\file-downloader-downloads\vscode-amiga-assembly-binaries-@-1.2.0\prb28-vscode-amiga-assembly-binaries-4afbaa0/vasmm68k_mot -m68000 -Fhunk -linedebug -o \\wsl$\Debian\home\{username}\winuae-share\Workbench\dev\asm\Amiga-hardware-coding\build\SimpleCopper.o \\wsl$\Debian\home\{username}\winuae-share\Workbench\dev\asm\Amiga-hardware-coding\src\03-SimpleCopper\SimpleCopper.asm
vasm 1.8j (c) in 2002-2020 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.3n (c) 2002-2020 Frank Wille
vasm motorola syntax module 3.14c (c) 2002-2020 Frank Wille
vasm hunk format output module 2.13 (c) 2002-2020 Frank Wille

CODE(acrx2):             372 bytes
customchips(adrw4):               76 bytes


Terminal will be reused by tasks, press any key to close it.
But then, when I try to start a debug session using Amiga-Assembly: WinUAE Debug there is a vlink related error:

Code:
Starting build...
Compiling_________________________________________
Linking_________________________________________
c:\Users\{username}\AppData\Roaming\Code\User\globalStorage\prb28.amiga-assembly\file-downloader-downloads\vscode-amiga-assembly-binaries-@-1.2.0\prb28-vscode-amiga-assembly-binaries-4afbaa0/vlink -bamigahunk -Bstatic -o \\wsl$\Debian\home\{username}\winuae-share\Workbench\dev\asm\Amiga-hardware-coding\uae\dh0\myprogram
Fatal error 6: No input files.
Aborting.

Linker error: Fatal error 6: No input files.
Linker error: Fatal error 6: No input files.
The terminal process failed to launch (exit code: 1).
What could be the problem here?
thyslo is offline  
Old 05 July 2022, 21:11   #310
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 189
Ah..I found the reason but currently not how to fix it: My source file SimpleCopper.asm is not located in the workspace directory but in a sub directory I created, src. Moving the .asm file to workspace directory fixes it. But I'd like to have that src directory..
thyslo is offline  
Old 05 July 2022, 23:05   #311
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Quote:
Originally Posted by thyslo View Post
Ah..I found the reason but currently not how to fix it: My source file SimpleCopper.asm is not located in the workspace directory but in a sub directory I created, src. Moving the .asm file to workspace directory fixes it. But I'd like to have that src directory..

You can change the includes / excludes pattern for the vlink task in the .vscode/tasks.json.
https://github.com/prb28/vscode-amig...the-build-task
prb28 is offline  
Old 06 July 2022, 06:58   #312
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 189
I changed the tasks.json vlink includes to

Code:
"includes": "src/*.{s,S,asm,ASM}"
and now it works. Thank you!
thyslo is offline  
Old 06 July 2022, 13:20   #313
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 189
I run unto another question: When I build the project using the default build task in VSCode (Ctrl + Shift + b) the task amigaassembly: build is run. This task is defined in .vscode/tasks.json.

But when I save the current asm file I'm working on (using Ctrl +s), it seems to start a different build task, one that only assembles that file. The terminal output starts with Compiling current editor file...

Where is this task defined?
thyslo is offline  
Old 08 August 2022, 00:43   #314
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Quote:
Originally Posted by thyslo View Post
Where is this task defined?
@thyslo sorry, I've just seen you question today
Here is the answer in the wiki https://github.com/prb28/vscode-amig...yntax-checking
prb28 is offline  
Old 14 August 2022, 13:16   #315
seth_g
Registered User
 
Join Date: Dec 2021
Location: Germany
Posts: 3
Rom

Hello. Maybe you can help me on the vasm extension for VS Code. How can I define the loaded ROM in the launch.json?

And is it possible to reliable use the A500 model for debugging? I wrote a little initialisation and encountered that UAE jumps to 1.3 DOS and loses the debug handler after jump subroutine to OpenLib.
seth_g is offline  
Old 15 August 2022, 10:08   #316
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Quote:
Originally Posted by seth_g View Post
Hello. Maybe you can help me on the vasm extension for VS Code. How can I define the loaded ROM in the launch.json?
https://github.com/prb28/vscode-amig...nate-kickstart




Quote:
Originally Posted by seth_g View Post
And is it possible to reliable use the A500 model for debugging? I wrote a little initialisation and encountered that UAE jumps to 1.3 DOS and loses the debug handler after jump subroutine to OpenLib.

Stepping throw the rom/libs works better on winuae that the old version of fs-uae used. I'm not sure that everything is accessible.
prb28 is offline  
Old 17 August 2022, 17:01   #317
seth_g
Registered User
 
Join Date: Dec 2021
Location: Germany
Posts: 3
Thanks a lot, prb28
seth_g is offline  
Old 14 February 2023, 21:35   #318
iZero
Registered User
 
Join Date: Aug 2020
Location: Kokkola/Finland
Posts: 12
I decided to learn some Amiga asm and I'm going through the examples of Fabio Ciucci's assembler book. I have been using this extension to try the code (FS-UAE on MacOS). Now I run into some problems that I don't know how to resolve. The examples assemble fine with AsmPro on Amiga, but fails with the vasm/vlink.

One problem is these instructions:
Code:
	ANDI.L	D1,D0
	CMPI.L	D2,D0
I get an error on both:
Code:
error 9: instruction not supported on selected architecture
Is it so that those are just not supported in vasm and I should replace them with other instructions?

Second problem is the branches from includes. Example has two files, Lezione8r.s and startup1.s.

Lezione8r.s has include "startup1.s" and in that file there's a branch to label START which is in the main source file after the include. When trying to run the example, the linker says:

Code:
Startup1.o: In "HEAVYINIT":
                           Error 21: Startup1.o (CODE+0x2ba): Reference to undefined symbol START.
I guess that the difference is in the way how the includes are handled, but I don't know how to fix it. Hence the noobie question.

Last edited by iZero; 14 February 2023 at 21:47.
iZero is offline  
Old 15 February 2023, 10:13   #319
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by iZero View Post
One problem is these instructions:
Code:
    ANDI.L    D1,D0
    CMPI.L    D2,D0
I get an error on both:
ANDI/CMPI Dx,x is not a valid instruction - CMPI is compare immediate, meaning you would need an immediate value as the first argument (e.g. CMPI #10,D0).


Some assemblers will translate the variant of an instruction to the "appropriate" type based on the operands - your current vasm settings doesn't allow that, it seems.

Last edited by hooverphonique; 15 February 2023 at 12:03.
hooverphonique is offline  
Old 16 February 2023, 13:46   #320
iZero
Registered User
 
Join Date: Aug 2020
Location: Kokkola/Finland
Posts: 12
Thanks, that makes sense now that you wrote it. I also realised that by default the example project compiles every .s file separately so that's why the label issue. I put only the file I want to compile to includes and it works fine.
iZero 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
assembly code to test for assign (2.0+) jotd Coders. System 2 27 December 2017 23:16
very basic C/ASM/Visual Studio hand holding Sephnroth Coders. C/C++ 2 08 March 2016 20:15
Amiga Audio/Visual KhneFr request.Other 6 03 January 2015 10:25
Profiling WinUAE with Visual Studio 2013 mark_k support.WinUAE 3 14 January 2014 20:26
amiga visual editor thinlega request.Apps 1 22 January 2003 15:48

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 21:47.

Top

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