News:

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

GeneSysRt.inc

Started by Mark Jones, July 28, 2006, 07:04:38 PM

Previous topic - Next topic

Mark Jones

Hello friends,

Included in the new release is a "master include file" which functions much like the masm32rt.inc file in that it includes most of the common files and libraries. Students can use this as a "blanket" include file for most projects instead of manually including all the files individually. This should speed the learning process. Here is the contents of GeneSysRt.inc:


    .486                                    ; require a 486
    .model flat,stdcall                     ; flat memory model
    option casemap:none                     ; case sensitive

    include \GeneSys\include\windows.inc    ; windows statics
    include \GeneSys\include\gdi32.inc      ; graphics functions
    include \GeneSys\include\user32.inc     ; user functions
    include \GeneSys\include\kernel32.inc   ; os functions
    include \GeneSys\include\comctl32.inc   ; common controls
    include \GeneSys\include\comdlg32.inc   ; common dialogs
    include \GeneSys\include\advapi32.inc   ; registry functions
    include \GeneSys\include\shell32.inc    ; shell functions
    include \GeneSys\include\msvcrt.inc     ; visual c run-time
    include \GeneSys\include\GeneSys.inc

    includelib \GeneSys\lib\gdi32.lib
    includelib \GeneSys\lib\user32.lib
    includelib \GeneSys\lib\kernel32.lib
    includelib \GeneSys\lib\comctl32.lib
    includelib \GeneSys\lib\comdlg32.lib
    includelib \GeneSys\lib\advapi32.lib
    includelib \GeneSys\lib\shell32.lib
    includelib \GeneSys\lib\msvcrt.lib
    includelib \GeneSys\lib\GeneSys.lib     ; GeneSys functions


And an example using it:


; Library Name : GeneSys.lib
; Function Name: ConsoleOut (szString)
; Author Name  : Jake Commander
; Description  : Displays ASCII string in console (CUI) window
; Requirements : 386+
; Expects      : pointer to ASCII string
; Modifies     : EAX,ECX
; Returns      : EAX = number of bytes written

    include \GeneSys\include\GeneSysRt.inc

.const
    szGeneSys   db 'Hello from the GeneSys Project!',0
    szPause     db 13,10,'Press <enter> to exit.',0
.data?
    szBuffer    db ?
.data

.code
start:

    invoke ConsoleOut,ADDR szGeneSys        ; display text

    invoke ConsoleOut,ADDR szPause          ; display pause message
    invoke ConsoleIn,ADDR szBuffer,0        ; wait for user to press enter

    invoke ExitProcess,0                    ; exit gracefully with errorlevel 0

END start
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Vortex

It looks fine Mark, nice work :U