flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
edfed
your code will be layered.
the application layer and the interface layer interface layer is the one connected to OS. |
|||
![]() |
|
revolution
Teehee: You have to know the system/OS GUI interface to be able to show things like MessageBox.
There are some cross-platform libraries that attempt to make this easier, e.g. QT is one such library. There are others also. |
|||
![]() |
|
Teehee
its something like:
Code: push 0 push 0 push text push 0 call [MessageBox] MessageBox: if (win) invoke Messagebox,etc else invoke LinuxMB,etc ret ? |
|||
![]() |
|
Borsuc
That's the Windows API, which would work under Linux only if Wine is installed.
|
|||
![]() |
|
LocoDelAssembly
Borsuc, I think you missed the conditional assembly part (although he should have used "call" without square brackets).
|
|||
![]() |
|
f0dder
Teehee: conditional assembly would work, but it'd be a maintenance nightmare - you'll need to write an OS abstraction layer if you plan on getting anything done, and only use that abstraction layer from your client code. And then you have the wonderful task of implementing the abstraction layer for each OS...
If you only need simple stuff (console mode apps, file handling, memory) then it's a sort of manageable task, but add in GUI and support for more complex features... well, good luck. |
|||
![]() |
|
DOS386
Teehee wrote: I'd like to know how my programs may run in Windows and Linux (for example). Impossible. You can mix Win32 with DOS, but NOT Win32 with Linux: Linux requires "?ELF" Sigi, while Windows needs "MZ" - one file can't have both. |
|||
![]() |
|
LocoDelAssembly
Actually, since you mentioned Win32, you could write a COM with embedded ELF and then, when the binary is running under ntvdm you would construct a temporary PE file at run-time and then execute it and when running on Linux you would do nothing as it is already executing in 32-bit mode (I think someone in this forum did that or posted something about it long ago).
|
|||
![]() |
|
revolution
LocoDelAssembly wrote: Actually, since you mentioned Win32, you could write a COM ..., when the binary is running under ntvdm you would construct a temporary PE file at run-time and then execute it ... |
|||
![]() |
|
baldr
revolution,
Yes, it can (plain int 21/ax 4B00). DOSONLY from CONFIG.NT (or PIF advanced setting for Win9x) selects whether MZ or PE will be run. |
|||
![]() |
|
ManOfSteel
@DOS386
I think he meant it to be assembled as one or the other depending on the target system. Something like: Code: SYSTEM equ 0 ; 0 = ELF (don't forget to link the ; object file with the appropriate libs) ;SYSTEM equ 1 ; 1 = PE match = 0,SYSTEM { format ELF public main } match = 1,SYSTEM { format PE GUI 4.0 entry main } main: ret |
|||
![]() |
|
ManOfSteel
@Teehee
The best way IMO is, like revolution said, to use cross-platform toolkits like GTK+ and Qt, along with code like the above for conditional inclusion of "headers". Other than that, you can try edfed's method, IOW something like fasm, with system-independent code inside .inc files (e.g. %FASMDIR%/SOURCE/*) and system-dependent UI and API inside the main .asm file of every platform (e.g. %FASMDIR%/SOURCE/LIBC/FASM.ASM, %FASMDIR%/SOURCE/DOS/FASM.ASM). |
|||
![]() |
|
Borsuc
LocoDelAssembly wrote: Borsuc, I think you missed the conditional assembly part (although he should have used "call" without square brackets). _________________ Previously known as The_Grey_Beast |
|||
![]() |
|
LocoDelAssembly
Finally, I found it: http://board.flatassembler.net/topic.php?t=5625
The part that can run in DOS/Linux is in this link posted by rugxulo in that thread: http://www.deater.net/weave/vmwprod/asm/ |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.