English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Releases

 
 
Thread Tools
Old 12 June 2024, 10:23   #21
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,797
Quote:
Originally Posted by phx View Post
The std-syntax module provides the
.irp
directive for "iterating repeat". You can specifiy some values which will be assigned to a symbol:
Code:
        .irp    sym,10,20,30,40
lab\sym:
        .byte   \sym
        .endr
Maybe I can implement an
IRP
directive into mot-syntax, if this is useful. (Although I don't like to invent new directives, which make vasm incompatible with other assemblers.)
No, everything fine...
I think I can work with that macro workaround you provided above, my friend...

Thanks for that...
Tigerskunk is offline  
Old 24 June 2024, 01:17   #22
frakswe
Registered User
 
frakswe's Avatar
 
Join Date: Jul 2018
Location: Laughingstock
Age: 45
Posts: 31
Code:
   
org 100h

start:

    mov $9,%ah
    mov $hello,%dx
    int $0x21
    ret

hello:
    db "Hello World",13,10,'$'
Code:
$ vasmx86_oldstyle -Fbin -m8086 hello.asm -o hello.com
Code:
0000000000000000 b409             mov ah, 0x9             
0000000000000002 66ba0901cd21     mov edx, 0x21cd0109     
0000000000000008 c3               ret                     
0000000000000009 48               dec ax                  
000000000000000a 656c             gs insb                 
000000000000000c 6c               insb                    
000000000000000d 6f               invalid                 
000000000000000e 20576f           and [bx+0x6f], dl       
0000000000000011 726c             jb 0x7f                 
0000000000000013 640d0a24         or ax, 0x240a
dx becomes edx , is this a limitation of the x86 module?
frakswe is online now  
Old 24 June 2024, 11:16   #23
frakswe
Registered User
 
frakswe's Avatar
 
Join Date: Jul 2018
Location: Laughingstock
Age: 45
Posts: 31
in cpu.c:

Code:
//static enum codetype mode_flag = CODE_32BIT;  /* 32 bit is default */
static enum codetype mode_flag = CODE_16BIT;
did the trick, although not a proper fix ofcourse.
frakswe is online now  
Old 24 June 2024, 11:37   #24
frakswe
Registered User
 
frakswe's Avatar
 
Join Date: Jul 2018
Location: Laughingstock
Age: 45
Posts: 31
ok the directive code16 also works. guess it's down to why -m8086 doesn't limit the opcodes then.

but i'll let you figure that one out.
frakswe is online now  
Old 24 June 2024, 18:21   #25
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,546
Quote:
Originally Posted by frakswe View Post
ok the directive code16 also works. guess it's down to why -m8086 doesn't limit the opcodes then.
Looks like
mode_flag
should be set to a sensible mode, according to the selected CPU. I wrote this backend 20 years ago and never really touched it again, so I don't remember why I chose not to do that.

What do you think which default mode make sense for which CPU? Besides writing this backend my experience with x86 is close to zero.

And you may also contact me by email, as this is possibly the wrong forum for discussing vasmx86.
phx is offline  
Old 24 June 2024, 19:05   #26
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,215
Just one final note on vasmx86 (that I haven't used before), and not to knock on phx's good work in general there, but it's probably not well tested for <386 targets. In particular it won't error out on non-short Jcc's, but will instead emit the 386+ disp16/32 variant (0F 8x) even for -m8086. Likely won't be a problem if you're trying to make existing code work, but if you're trying to make something new targeting actual 8086 you need to be aware of it.

(Happy to continue discussion elsewhere)
paraj is offline  
Old 24 June 2024, 22:31   #27
frakswe
Registered User
 
frakswe's Avatar
 
Join Date: Jul 2018
Location: Laughingstock
Age: 45
Posts: 31
@phx
8086,186,286 - code16
386-686 - code32
amd64 - code64

https://en.wikipedia.org/wiki/X86

and why can't we discuss x86 here? aros is a thing :P
frakswe is online now  
Old Yesterday, 01:03   #28
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,546
Quote:
Originally Posted by paraj View Post
it's probably not well tested for <386 targets. In particular it won't error out on non-short Jcc's, but will instead emit the 386+ disp16/32 variant (0F 8x) even for -m8086.
Indeed, I doubt it was tested at all with this configuration (see below). I may fix that before the 2.0 release, but I fear there are multiple issues of this kind, and it needs some intensive testing.

Quote:
Originally Posted by frakswe View Post
8086,186,286 - code16
386-686 - code32
amd64 - code64
Thanks! Fixed and committed. Will be included in the next daily source snapshot in a few hours.

Quote:
and why can't we discuss x86 here? aros is a thing :P
In fact AROS was the only reason I wrote this backend 20 years ago. But it was only ever tested with the code generator of vbcci386 on some simple AROS test code - until all work on the i386-aros vbcc target was stopped. Unfortunately the AROS team decided early to lock their SDK to the gcc compiler and had no plans to make it portable.
phx is offline  
Old Yesterday, 21:16   #29
hop
Registered User
 
hop's Avatar
 
Join Date: Apr 2019
Location: UK
Posts: 248
For release 2.0 it would be great if the Makefiles could be updated so vasm can be built for/on Windows x64 with Visual Studio command line with no changes. Currently
Makefile.Win32
has to be manually edited to build sucessfully.

After downloading the latest snapshot, my process is:
1. Open Visual Studio 2022 x64 Native tools command prompt
2. CD to vasm dir
3.
nmake /f Makefile.Win32 CPU=m68k SYNTAX=mot


Code:
c:\Amiga\vasm\vasm.c : fatal error C1083: Cannot open compiler generated file: 'c:\Amiga\vasm\obj_win32\m68k_mot_vasm.o': No such file or directory
4. Edit
Makefile.Win32
to remove
_win32
from line 6
TARGET =

5.
nmake /f Makefile.Win32 CPU=m68k SYNTAX=mot

6. Success

I don't think separate
.Win32
and
.Win64
/
.x64
Makefiles are required - the same makefile should be usable from any of the 4 combinations of {host32,host64}x{target32,target64} toolchain.

Last edited by hop; Yesterday at 21:18. Reason: Formatting
hop is offline  
Old Yesterday, 22:32   #30
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,546
Quote:
Originally Posted by hop View Post
4. Edit
Makefile.Win32
to remove
_win32
from line 6
TARGET =
Ok... you may be right. When using Visual Studio on Windows, then you are compiling for your native host platform, so the
TARGET
extension can be removed and the existing
obj
directory can be used, in the same manner as with the default Unix Makefile.
Changed and committed for tomorrow's source snapshot.

Quote:
I don't think separate
.Win32
and
.Win64
/
.x64
Makefiles are required - the same makefile should be usable from any of the 4 combinations of {host32,host64}x{target32,target64} toolchain.
I don't understand. There is neither a
.Win64
nor
.x64
Makefile or target. And we have no plans to change that.
phx 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
Vasm freehand Coders. Asm / Hardware 2 25 November 2023 23:51
Question about XREF vs XDEF (vasm 1.8 vs vasm 1.9) roondar Coders. Asm / Hardware 8 01 May 2023 20:59
Vasm division by 0 Quagliarulo Coders. Asm / Hardware 4 27 July 2020 11:30
If statements with Vasm LaBodilsen Coders. Asm / Hardware 5 24 September 2019 17:55
vasm 1.5 RFC phx Coders. General 30 11 December 2010 02:08

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 09:10.

Top

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