Converting Winape/MAXAM ASM files for VASM

This is not the website of VASM, and I am not it's author ... you can find VASM here!

<- Back to the Main Contents & Basic Z80 Assembly Lessons

Vasm is an open source, multi platform assembler, which can compile to the Z80, GBZ80 (gameboy CPU), 6502, 68000 and more!
Learn more about VASM

Download my Windows builds of VASM (32 bit) (Built 2023/1/13)
Vasm also supports multiple syntax options, and the 'OldStyle' option is most compatible with the WinAPE code we've looked at in these tutorials, unfortunately there are some compatibility issues, but it's relatively trivial to fix them

VASM Command Line
Let's take a look at a typical VASM command line!

We need to use a different EXE build of vasm, depending on our ASM source, and destination CPU

these tutorials use OldStyle for Z80 and 6502, and MOT for 68000 (68k)

There are various other commands switches you may want to use (In order of importance)

Source FileName - This is the ASM file we want to compile
Output file - Winape can specify a destination in the ASM code, but VASM cannot, you must specify it here on the command line and type -FBin means 'binary output'
Listing - this is a TXT output of the processing of the ASM file, it's useful to debug what went wrong if you end up with a corrupt binary, or one that's much bigger than you expected
nocase - Disable case sensitivity
chklabels - make sure no ASM commands are in the label area

Special options for special CPU's:

m68000 - Specify a 680xx CPU type
gbz80 - Build for the Gameboy CPU
c02 - Build for 65C02 / HUC6270 cpu

68000 only:

ELF link - if we want to use Vlink to create an Amiga or AtariST binary, we need to set the output to -Felf, and use vlink to build to our destination
Link format - binary format vlink should output to

Stuff I use, but you don't need to:

vasm definition - This will set vasm to 1... this does the same as 'vasm equ 1' in the code, and allows us to fix things that vasm needs doing differently to WinApe in the ASM file
Build definition - the same as 'BuildZXS equ 1' in the code - I use a different batch file for each destination

Differences between VASM and WinAPE

Winape Version Corrected Vasm Ver
WinApe doesn't mind commands being at the far left, but in VASM only Labels and EQU symbol definitions can be at the left,
We need to move the ORG and RET  statement to the right
Hint: use -chklabels to warn if any commands are in label area!
Winape uses MEND or ENDM for the end of a macro, but VASM can only use ENDM
I've been putting labels for self-modifying values on the right in WinAPE, but VASM requires them to be on the next line, at the far left
in VASM Macros need to have a comma , between the macro name and the first parameter,
also parameters need a \ before them in the macro definiton,

Unfortunately WinAPE will not like this, but if you need to compile both, you can use an 'ifdef vasm' option, and have a version for winape, and one for vasm
this 'nolist' statement is being mistaken for a label, what's worse, because it's before the ORG statement, it will be considered the first data in the output, and 32k of zeros will appear at the start of your output file!
there is no such command as ex hl,de... the correct one is ex de,hl
WinAPE would let us get away with it, but VASM says no!
in WinAPE, align is done by the byte boundary... VASM works differently, you specify the bit number you want aligned, so Align 256 becomes Align 8
If you want to compile on both, you'll have to have alternate versions for WinAPE and VASM
RST's in WinAPE can be specified by address or number, but in VASM they can only be specified by address... just multiply the RST number by 8!
Vasm is Case sensitive, so we need to ensure the case matches!

*** use the -nocase option to disable case sensitivity!

Useful Macros

If you want to compile with VASM and WinAPE , you may wish to use macro's to help you

For example, when you want zeros in your output file until a certain address, in WinAPE you need a local label and defs ... but in VASM you can just use ORG

READ (including another ASM file) is INCLUDE in VASM
PRINT,WRITE,SAVE and CLOSE have no equivalent in VASM... we specify the save file on the command line, and we'll just have to do without PRINT!

As previously mentioned ALIGN does not work the same, but we can define compatible macros to compile to both.


View Options
Default Dark
Simple (Hide this menu)
Print Mode (white background)

Top Menu
***Main Menu***
Youtube channel
Email Newsletter
Merch Store
Amazon Affiliate Link
AkuSprite Editor
Dec/Bin/Hex/Oct/Ascii Table

Alt Tech
Please note: I wlll upload more content to these alt platforms based on the views they bring in

Z80 Content
***Z80 Tutorial List***
Learn Z80 Assembly (2021)
Learn Z80 Assembly (old)
Hello World
Advanced Series
Multiplatform Series
Platform Specific Series
ChibiAkumas Series
Grime Z80
Z80 Downloads
Z80 Cheatsheet
DevTools kit
Z80 Platforms
Amstrad CPC
Elan Enterprise
Gameboy & Gameboy Color
Master System & GameGear
Sam Coupe
ZX Spectrum
Spectrum NEXT
Camputers Lynx

6502 Content
***6502 Tutorial List***
Learn 6502 Assembly
Advanced Series
Platform Specific Series
Hello World Series
Grime 6502
6502 Cheatsheet
DevTools kit
6502 Platforms
Apple IIe
Atari 800 and 5200
Atari Lynx
BBC Micro
Commodore 64
Commodore PET
Commander x16
Super Nintendo (SNES)
Nintendo NES / Famicom
PC Engine (Turbografx-16)
Vic 20

68000 Content
***68000 Tutorial List***
Learn 68000 Assembly
Hello World Series
Platform Specific Series
Grime 68000
68000 Cheatsheet
DevTools kit
68000 Platforms
Amiga 500
Atari ST
Neo Geo
Sega Genesis / Mega Drive
Sinclair QL
X68000 (Sharp x68k)

8086 Content
Learn 8086 Assembly
Platform Specific Series
Hello World Series
8086 Cheatsheet
DevTools kit
8086 Platforms

ARM Content
Learn ARM Assembly
Learn ARM Thumb Assembly
Platform Specific Series
ARM Downloads
ARM Cheatsheet
DevTools kit
ARM Platforms
Gameboy Advance
Nintendo DS
Risc Os

Risc-V Content
Learn Risc-V Assembly
Risc-V Downloads
Risc-V Cheatsheet
DevTools kit

PDP-11 Content
Learn PDP-11 Assembly
PDP-11 Downloads
PDP-11 Cheatsheet
DevTools kit

TMS9900 Content
Learn TMS9900 Assembly
TMS9900 Downloads
TMS9900 Cheatsheet
DevTools kit
TMS9900 Platforms
Ti 99

6809 Content
Learn 6809 Assembly
6809/6309 Cheatsheet
DevTools kit
6809 Platforms
Dragon 32/Tandy Coco
Fujitsu FM7
TRS-80 Coco 3

65816 Content
Learn 65816 Assembly
65816 Cheatsheet
DevTools kit
65816 Platforms

eZ80 Content
Learn eZ80 Assembly
eZ80 Downloads
eZ80 Cheatsheet
DevTools kit
eZ80 Platforms

Work in Progress

Misc bits
Ruby programming

Buy my Assembly programming book
on Amazon in Print or Kindle!

Buy my Assembly programming book

Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!

Buy my Assembly programming book
on Amazon in Print or Kindle!

Buy my Assembly programming book

Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!