First post, by paprika
- Rank
- Newbie
Probably a long shot but maybe someone here knows.
I'm trying to cross-compile assembly code from a modern machine, using http://sun.hasenbraten.de/vasm/ compiler and http://sun.hasenbraten.de/vlink/ linker, to 8088 XT.
I am able to compile basic code (to display a string) on MS-DOS using MASM, but I'm unable to replicate that with vasm. I'm not sure the problem is in my syntax, or in how I call vasm.
This code (written, compiled, and linked in MASM) executes and correctly displays a string:
ASSUME CS :CODE, DS :DATA
DATA SEGMENT
MESSAGE DB 0DH, 0AH, " HELLO BELLO", 0DH, 0AH, "$"
DATA ENDS
CODE SEGMENT
START: MOV AX, DATA
MOV DS, AX
MOV AH, 09H
MOV DX, OFFSET MESSAGE
INT 21H
MOV AH, 4CH
INT 21H
CODE ENDS
END START
Whereas this code also compiles and executes, but displays garbage when run under DOS:
.code16
.org 0x100
start:
mov $0x9, %ah
lea msg, %dx
int $21
mov $0x4c, %ax
int $21
msg:
.byte "hello bello", 0x0a
This is how I run the compiler:
vasmx86_std -m8086 -Faout mmm.asm -o mmm.obj
and this is how I run the linker:
vlink mmm.obj -o mmm.exe
Any ideas?