JWasm don't recognizes commands.

Started by psyhclo, November 19, 2010, 08:00:19 PM

Previous topic - Next topic

psyhclo

I'm trying to run JWasm on Ubuntu. But when I try to run the .asm programs for linux, like the one that is on the Samples folder Lin64_1.asm, it dont recognizes the ' ; ' and the commands, for every command it says on terminal screen, "command not found". Do you have any Idea of why this happens?? I really need help. Do you know another assembler compiler, or any solution for this problem. Thanks!!

drizz

It works, you just forgot to mark jwasm as executable (chmod).

#!/bin/bash
JWZIP=JWasm204cbl.zip
#
cd ~
mkdir jwasm
cd jwasm
wget -nc http://www.japheth.de/Download/JWasm/$JWZIP
file-roller -e . $JWZIP
chmod +x ./jwasm
#uncomment the next line to copy jwasm to path /usr/bin, /usr/local/bin, ...
#sudo cp jwasm /usr/local/bin
cd Samples
./../jwasm -elf64 -zcw -Fo=Lin64_1.o Lin64_1.asm
gcc -nostartfiles Lin64_1.o -o Lin64_1
./Lin64_1
#
save this to file.sh and execute "bash file.sh"
The truth cannot be learned ... it can only be recognized.

jj2007

There is a regression in JWasm v2.05 RC 3 12/12/2010.
The snippet below will choke with
Error A2247: Missing right parenthesis
print(1)[macros.asm]: Macro called from
  inkey(4)[macros.asm]
It works fine with ML 6.14, 6.15, 8.0, 9.0 and with JWasm JWasm v2.04c, Oct 17 2010 (the "green" version above version 2.05).

include \masm32\include\masm32rt.inc

.code
start: inkey "This is a test of line \
continuation"
exit
end start

japheth

I overlooked this one.

It's fixed now. Nevertheless there will be a slight regression in JWasm v2.05, due to increased Masm-compatibility:


.386
.model flat, stdcall

m1 macro text
db text,0
endm

.data

m1 "abc \
def"

;--- a semi-colon alone is no problem

m1 "abc ; def"

;--- a backslash alone is also no problem

m1 "abc \ def"

;--- sequence of backslash and semi-colon is a problem.
;--- it's accepted if the semi-colon is preceded by a '!', but
;--- the '!' will become part of the string then.

m1 "abc \!; def"

;--- this won't be accepted by either Masm or JWasm v2.05+
;--- it is accepted by JWasm v2.04 and below.
; m1 "abc \; def"

end


The last m1 macro invocation won't work anymore.

jj2007

Quote from: japheth on December 15, 2010, 08:35:58 AM
It's fixed now.

Thanks, japheth, that was fast (should I say: as usual? :clap:).

JWasm v2.05rc4 is again fully compatible with the 100+ MasmBasic commands, see testbed.

jj2007

Just one more:

.Repeat
dec eax
.Until eax==0


The eax==0 is or eax, eax for ml but cmp eax, 0 for JWasm - intentionally? cmp eax is closer to the original but also one byte longer...

japheth

Quote from: jj2007 on December 16, 2010, 01:00:06 PM
The eax==0 is or eax, eax for ml but cmp eax, 0 for JWasm - intentionally? cmp eax is closer to the original but also one byte longer...

Yes, intentionally. The -Zg switch should make the code generation more Masm-like.

japheth

Quote from: japheth on December 15, 2010, 08:35:58 AM
I overlooked this one.

It's fixed now. Nevertheless there will be a slight regression in JWasm v2.05, due to increased Masm-compatibility:


.386
.model flat, stdcall

m1 macro text
db text,0
endm

.data

m1 "abc \
def"

end


I'm probably going to revert this change. It isn't a convincing fix. And what Masm does isn't convincing either:


.386
.model flat, stdcall

m1 macro text
db text,0
endm

m2 macro text
local xxx
.const
xxx db text,0
.code
exitm <offset xxx>
endm

.code

;--- 1. won't work with Masm
db "abc \
def"

;--- 2. macro procedure: works with Masm
m1 "abc \
def"

;--- 3. macro function: won't work with Masm
mov eax,m2("abc \
def")

    end


In short: with Masm, a backslash within quoted strings has no special meaning - unless the string is a macro procedure argument.

With JWasm v2.04, cases 1-3 were all accepted - because the backslash line continuation handling was done at very low level.

There's a workaround: if line continuation is to work within quoted strings, enclose the string in angle brackets!

jj2007

A related problem:
QuotePrint "The line",CrLf$,CrLf$,"GetFiles \Masm32\include\*.inc, ", '"rect struct"', ", ",'"ends"',", 9", CrLf$,\
      CrLf$, "returned in Files$(1) and Files$(2) the following matches:",CrLf$,CrLf$, Files$(1), CrLf$, CrLf$, Files$(2)

JWasm expands the Files$() macro inside the quoted text.

japheth

Quote from: jj2007 on December 20, 2010, 11:37:09 AM
A related problem:
QuotePrint "The line",CrLf$,CrLf$,"GetFiles \Masm32\include\*.inc, ", '"rect struct"', ", ",'"ends"',", 9", CrLf$,\
      CrLf$, "returned in Files$(1) and Files$(2) the following matches:",CrLf$,CrLf$, Files$(1), CrLf$, CrLf$, Files$(2)

JWasm expands the Files$() macro inside the quoted text.

I wouldn't call it "related".

Anyway, I'd prefer NOT to use this board for JWasm bug reports.