News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Modified JWasm

Started by habran, March 01, 2012, 02:42:17 AM

Previous topic - Next topic

johnsa

Got it thanks!

And.. with only a few mods it builds and runs from inside the IDE!
Awesome.. I'll get cracking on hunting down the stuff for CV8.

habran


johnsa

I think i'm going to need it... lol

CV8 is undocumented, I see it's been partially implemented (at least some types and structs).

I found this: http://www.hackchina.com/en/r/48474/yasm-0.7.1-_-modules-_-dbgfmts-_-codeview-_-cv8.txt__html

Which is helpful.


habran

Interesting
that was taken from yasm
I downloaded yasm source and it is there
maybe you should look how it is implemented there

regards

johnsa

FYI...

http://www.fantastictimes.co.za/CodeView.pdf
http://www.fantastictimes.co.za/pecoff_v8.docx
http://www.fantastictimes.co.za/specs.html

I happen to have some very old MSDN collections lying around, and after much trawling.. found the elusive "Visual C++ 5.0 Symbolic Debug Information Specification" as linked above.
I extracted the CHM into a site there.

Still no CV8, BUT it can in theory be gleaned by updating CV5 with these notes

http://www.hackchina.com/en/r/48474/yasm-0.7.1-_-modules-_-dbgfmts-_-codeview-_-cv8.txt__html

habran

I remembered that strap89 wrote pecvt for fasm in 2009
http://board.flatassembler.net/topic.php?p=89369
it is interesting to look here how he implemented it in fasm
here it is

Ficko

Hi guys !

I see you are doing some serious work in absence of "Japheth". :wink

Could some of you make Jwasm able to switch between 64/32 bit code in the source file ?

Jwasm has ".x64" directive but seems get ignored if other directive implying 32 bit precedes it.

I wanna make some mixed code like:


include \masm32\include\masm32rt.inc
.code

start:
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    call main
    inkey
    exit
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc
    db      9ah            ;call 33h:proc64 - JWASM dosn't understand this have to be hard coded -
    dd      proc64
    dw      33h
    cls
    print "Back to 32-bit"
    ret
main endp

;64 - bit
.x64
align 16
proc64:
xor rax, rax
retf
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
end start



Thanks beforehand.


johnsa

Hi,

Not sure exactly what you're trying to achieve here?
You can't run a mixed 32/64 exe under windows..
If you're writing code that you'd want to use in a OS boot-loader etc, where you'd want to switch modes, jwasm should pick up what type of code to generate from the segment type.
.x64 is just going to enable assembly of 64bit instructions/registers etc depending on the output format.

So you'd use something like
Code16 segment para public use16 'code'

and Code64 segment para public use64 'code'

Theres an example file in the jwasm samples Dos64.asm ..

habran

johnsa, tank you for answering
that is what I wanted to answer
BTW, how are you going with V8?

regards

Ficko

Quote from: johnsa on March 23, 2012, 09:26:58 AM

Not sure exactly what you're trying to achieve here?
You can't run a mixed 32/64 exe under windows..

Of curse you can.  :toothy
See http://vxheavens.com/lib/vrg16.html

I tried with YASM - the only assambler support mixed code sofar I was able to find, NASM understands "call 0x33:proc64" but can't switch between the modes, I don't know about FASM -
it works like a charm can use 64-bit regs at will.  :P

qWord

FPU in a trice: SmplMath
It's that simple!

Ficko

Thanks qWord! :U

I didn't know you need "x64 SEGMENT EXECUTE USE64" before ".x64" that was the missing piece of data. :red

Asking for some implementation what allready given makes my request above NULL. :P

johnsa

I had no idea you could do this!
Very interesting :)

So you'd write a normal 32bit app, run it under win x64, and just make calls for blocks of 64bit code.. much like pmode under dos you could do that once, and then have macros that thunk back to ur code32 to make API calls.. I had that in my dos extender... hmm

I'm not sure what the use of this is tho? I'd probably just stick to one or the other.. as I'm sure the call-gate has a massive performance penalty.. so it's not something you'd want to be doing often.

jj2007

Quote from: johnsa on March 24, 2012, 07:23:41 PM
I'm not sure what the use of this is tho?

Good question indeed. More interesting would be the other way round: A stub in 64-bit that allows you to use your stock of 32-bit libraries...

johnsa

Oh heck yeah.. that would be brilliant :)
I wonder if there's another call-gate or if that one works from 64->32..