News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Irvine32 library

Started by jj2007, May 09, 2016, 06:45:51 PM

Previous topic - Next topic

jj2007

Since we get frequent requests to help on Irvine32 code, I've resuscitated my dedicated code adapting such examples for use with a more advanced tool, the MasmBasic library. Inter alia, this allows to use the deb macro.

To install the additional macros,
- follow steps 1-6 here
- run the setup in the attachment (if you antivirus barks at you, post a complaint here)

When you see the example below in front of you, hit F6 to build it. Then start reflecting what to put into "MyProc" 8)

include \masm32\MasmBasic\MasmBasic.inc           ; ## little demo using Kip Irvine's library with Masm32 ###
include \masm32\MasmBasic\IrvineMb\Irvine32Mb.inc ; needed to build Irvine's 32-bit examples
.data
somevar      dd 123    ; example
  Init
  call MyProc
  mov eax, 11111111h
  mov ebx, 22222222h
  mov ecx, 33333333h
  mov edx, 44444444h           ; load regs with hex values
  call DumpRegs                ; DumpRegs displays the regs in hexadecimal format

  ; for comparison, an example with MasmBasic:
  mov eax, 55555555            ; load regs with decimal values, put PI on FPU
  mov ebx, 66666666
  mov ecx, 77777777
  movd xmm0, eax
  fldpi
  deb 4, "MasmBasic:", eax, ebx, ecx, xmm0, ST(0), flags      ; see MbGuide.rtf - deb can display regs, variables, strings, flags, constants
  Inkey CrLf$, "bye"
  Exit
MyProc proc uses esi edi ebx            ; do whatever you want down here, this is just a template ;-)
  Print "This is MyProc", CrLf$
  ret
MyProc endp
end start

jj2007


Zen

JOCHEN and beginner assembly programmers using the Irvine32 library,
You know,...we get so many posts from beginner assembly programmers that are trying to integrate routines included with the Irvine32 library and current compiled routines that are provided with the typical MASM32 Project version 11 package,...that we should create a couple of tutorials explaining the problems and provide rewritten Irvine routines that are compatible with the MASM32 Project routines.
The structure of the routines in the Irvine32 library is largely incompatible with existing MASM32 Project routines. Clearly, though, the routines developed by various assembly programmers and included with the MASM32 Project libraries are superior in every way. They are faster, more reliable, and, well, way cooler than the Irvine32 routines. In fact, if a beginner assembly programmer were just to read the source code for these routines provided with the MASM 32 Project libraries, they would learn a better way to program in assembly language, than is demonstrated in Kip Irvine's book: Assembly Language for x86 Processors, 7th Edition, 2014.

...But, in all seriousness,...if you are just learning assembly language programming,...you should be learning 64-bit programming,...:bgrin:
Yes, 32-bit applications will still run on Windows 64-bit versions because of WOW64,...but, it's SO RETRO,...

jj2007

#3
Quote from: Zen on May 10, 2016, 06:08:28 AM... provide rewritten Irvine routines that are compatible with the MASM32 Project routines.

Problem is that those who come here for help are students attending a course - and their teacher has clear ideas: "Use ReadFloat to do xyz". They have no choice :(

That is why I wrote the interface, because it allows the student to write original "Irvine" code in a testing environment that is much more comfortable, especially with the deb macro; and it allows me (and a few others who use MB) to test their code and help.

Afterwards, user copies the tested whatever proc and pastes it between include irvine32.inc and invoke ExitProcess, as requested by the teacher, and voilĂ , mission accomplished :P

As regards 32-bit code being "so retro", we could argue a lot, of course. With the exception of Mikl, we have not yet seen any serious project written in 64-bit assembler. It doesn't have to be a library with 200+ functions, but maybe, for a modest start and as a challenge to the 64-bit fans, a tiny little editor...? Pure Masm32, 7k exe, with a really tiny source around 1,000 lines, negligible in comparison with the 17k lines of RichMasm. It should not take more than a day or two to translate the Tiny IDE source from 32-bit to 64-bit. So please, go ahead, show us that with 64-bit assembler you can do more than "hello world" 8)

Zen

JOCHEN,
Your comments, as always, are so sensible. :bgrin:

Mikl__

Hi, JOCHEN!
you won't share the link to a 32-bits source code
Quotea tiny little editor... with a really tiny source around 1,000 lines

jj2007

Hi Mikl,
Here it is (corrected also above): http://masm32.com/board/index.php?topic=103.0

Mikl__


Zen

JOCHEN,
What have you done ???

Mikl__

QuoteJOCHEN,
What have you done ???
Hi, Zen!
And what has made Jochen?

jj2007

Quote from: Mikl__ on May 12, 2016, 10:15:48 AM
QuoteJOCHEN,
What have you done ???
Hi, Zen!
And what has made Jochen?

Nothing serious, really :icon_cool:

It's just that Baltoro aka Zen has suffered some brain damage recently. He must have tried to use a new editor :eusa_boohoo:

Quote from: Zen on May 12, 2016, 06:24:03 AMhe causes my brain to hemorrhage,...:bgrin:

Zen

Hi, MIKI__ and JOCHEN,
:bgrin: HEY !!! You guys are making the rest of us look like slackers and nimrods !!!  :bgrin: