flat assembler
Message board for the users of flat assembler.

Index > Main > console mode

Author
Thread Post new topic Reply to topic
Hugh Aguilar



Joined: 15 Nov 2011
Posts: 62
Location: Arizona
Hugh Aguilar 25 Nov 2012, 06:19
I am very impressed with FASM's support for Windows GUI programs. This is the first time I've ever used an IDE with assembly language! (The only minor issue I noticed was that the tab key doesn't work in a way that makes sense, but that is not a big deal at all.)

I'm not really ready to tackle GUI myself though, and I don't need it for the program I'm writing right now.

Do you have any documentation or example programs for console-mode? I want the user to be able to type commands and hit the [enter] key, and my program will do something in response, typically displaying some data, and then get another command, and so forth --- all text.

The best solution would be if there is a Windows version of ncurses available. Any kind of a common API between Windows and Linux would be fine. I'm working with Windows right now, but I would like to make my program work under Linux too.

Thanks in advance for your help --- Hugh

P.S. --- The reason I'm switching over from HLA to FASM is that HLA doesn't support 64-bit x86, but only 32-bit x86 --- the 64-bit computers are common enough now that I think I can require that for my program, and all of those registers do make programming a lot easier.
Post 25 Nov 2012, 06:19
View user's profile Send private message Send e-mail Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 25 Nov 2012, 09:02
You can use ncurses on Windows. Check the ncurses site for documentation and installation packages.
Post 25 Nov 2012, 09:02
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 25 Nov 2012, 11:36
Hugh Aguilar,

For simple line-oriented I/O you can use C runtime from Microsoft (MSVCRT.DLL).

Fancy UI can be drawn with WinAPI console functions (e.g. WriteConsoleOutput()). Public Domain Curses is available too, but you may have to recompile it for x86-64 and write proper include file.
Post 25 Nov 2012, 11:36
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1627
Location: Toronto, Canada
AsmGuru62 25 Nov 2012, 12:48
I was hoping to finish a small library for this -- just for FASM.
I started long ago, but kind of stalled -- too much of other work I have.
Post 25 Nov 2012, 12:48
View user's profile Send private message Send e-mail Reply with quote
Hugh Aguilar



Joined: 15 Nov 2011
Posts: 62
Location: Arizona
Hugh Aguilar 26 Nov 2012, 00:05
baldr wrote:
Hugh Aguilar,

For simple line-oriented I/O you can use C runtime from Microsoft (MSVCRT.DLL).

Fancy UI can be drawn with WinAPI console functions (e.g. WriteConsoleOutput()). Public Domain Curses is available too, but you may have to recompile it for x86-64 and write proper include file.


Thanks everybody for the tips. I'll look into what is required to get ncurses running under Windows with FASM.

BTW: Another noobie question:
Can anybody provide a link to a document describing the 64-bit x86? I have the Intel manuals. They are very thorough, but rather cumbersome. Is there anything available that would allow me to quickly look up the instructions? I'm very rusty on this stuff, and I've only done 32-bit and 16-bit in the past, so I need a handy reference.
Post 26 Nov 2012, 00:05
View user's profile Send private message Send e-mail Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 26 Nov 2012, 00:46
Hugh Aguilar,

There is x86asm.net site, it's home for x86 instructions' reference (there are some useful articles too, e.g. x86-64 Tour of Intel Manuals).
Post 26 Nov 2012, 00:46
View user's profile Send private message Reply with quote
Hugh Aguilar



Joined: 15 Nov 2011
Posts: 62
Location: Arizona
Hugh Aguilar 26 Nov 2012, 01:23
baldr wrote:
Hugh Aguilar,

There is x86asm.net site, it's home for x86 instructions' reference (there are some useful articles too, e.g. x86-64 Tour of Intel Manuals).


Excellent! That is exactly what I wanted --- if I find an instruction that I don't know about, I look it up in the Intel manual for a detailed description, but this will speed up my work a lot on basic programming.

Yet more noobie questions:

Is it true that all reference to memory is relative, and there is no absolute addressing mode on the 64-bit x86? The rip register hold's the current instruction's address and is used internally for this?

It looks like mov is the only instruction that can use 64-bit immediate values. If I use another instruction with a 64-bit register and a smaller immediate value (such as 32-bit), will that immediate value get sign-extended or zero-extended? Does it depend on which instruction this is?
Post 26 Nov 2012, 01:23
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.