News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

need help getting started

Started by John T, March 14, 2015, 07:03:39 AM

Previous topic - Next topic

dedndave

he's popular among teachers and universities
they have to select books that are approved for accredited courses
if you want to write such a text book - getting that approval is a big step for sales  :P
of course, it's unlikely anyone on the board that makes the approvals knows assembly language

Gunther

Quote from: dedndave on March 23, 2015, 09:17:38 AM
they have to select books that are approved for accredited courses
if you want to write such a text book - getting that approval is a big step for sales  :P
of course, it's unlikely anyone on the board that makes the approvals knows assembly language

What then is the basis of the decision?

Gunther
You have to know the facts before you can distort them.

FORTRANS

Hi Gunther,

Quote from: Gunther on March 24, 2015, 12:39:43 AM
Quote from: dedndave on March 23, 2015, 09:17:38 AM
they have to select books that are approved for accredited courses
if you want to write such a text book - getting that approval is a big step for sales  :P
of course, it's unlikely anyone on the board that makes the approvals knows assembly language

What then is the basis of the decision?

   Feedback from the teachers and students, after the first year, I
would hope.

Regards,

Steve N.

dedndave

i don't really know how universities do it in the US
but, i know how public school books and curriculum are approved
an independant panel of educators in Texas selects all text books for the country   ::)
hopefully, the universities have something better

Kip has a little clout, here - as he is a professor, i believe

http://users.cis.fiu.edu/~irvinek/

Rabbit2

Hi:
I did quite a bit of Fortran ages ago, but have been forced to get into assembly for a project i'm working on.  I'm still trying to find the bolts to attach the training wheels to my PC.  Cheers.

As to the text selection - i got involved in that in the D.C. area a few years ago.  When a uni wants to introduce a course in "widgeting" say, it first finds a Subject Matter Expert (SME) to develop the course (normally they won't have one on staff already).  The SME is told what level of expertise is desired of his "graduates", and how many contact hours he has for the course.  He lays the course out, and normally is asked what he'd recommend for a text (since he is supposedly the SME, he should have one or two in mind).  Normally, that text is used for the first semester or two, at least until feedback is received from the students and other faculty on the selected text. 

I was once asked (whilst i was a graduate student), what did i think of a certain text (MacWilliams & Sloan) on error correcting code.  I was apprehensive, because i thought that one of the authors might be a close friend of my instructor.  I said that i found the section of Viterbi decoding to be "somewhat obscure".  The instructor laughed.  He said that he tried to explain that subject to the authors twice, and they missed it both times.  Apparently that section of the book is foolishness.  Don't believe it, just cause it's in a book!  *g*

I've found the earlier 16 bit texts (with attached disks) valuable, as i've never done this before.  I  tried to find a student or two in the D.C. area that was interested in writing a couple of short programs to read some disk files but was unsuccessful.  Consequently, i'm trying to do it myself.  This looks like a worthwhile place to start.  Cheers.

dedndave

as mentioned....

in the upper right corner of the forum page is a link to download the masm32 package
it has help files, many examples, tutorials, etc

welcome to the forum   :t

viterbi isn't easy to understand - lol

dedndave

maybe Kip was selected as the subject matter expert
i can understand that, based on the success of his 16-bit texts
he missed the mark in a few places when it came to 32-bit code for windows

Rabbit2

Hi:
I heard this story some time ago.  I believe that the person involved was Dick Fineman (the youngest guy on the Manhattan project - but i might have that wrong.  According to the story, the person (who was a Nobel prize winner) was asked to review several books for public school use (high school, as i recall).  He was a little slow getting started, so had to hustle to make the deadline.  As he was reading through the books, he discovered that several were blank.  They had finished covers, but all internal pages were unprinted - absolutely nothing on them.  He turned in ratings on the books with printing in them, but didn't fill out the rating sheets for the blank ones.  When the "committee" convened to review the ratings, all the other committee members had rated ALL the books - including the blank ones.  Comments were solicited from the reviewers.  Several reviewers commented that they liked or didn't like parts of the BLANK books.  The Nobel prizewinner was taken to task by the chairman of the committee for not filling out all the review forms.  He replied that something must be wrong, because the copies that he had received were blank.  The publisher was asked about this, and said that the authors didn't have the proofs ready in time, so to make the book review deadline, they had furnished blank books - with the previously approved covers.  The Nobel holder asked HOW the other reviewers could have made comments on non-existent books.  This was covered up.  So much for "committee approval".  Cheers.

AssemblyChallenge

QuoteI've found the earlier 16 bit texts (with attached disks) valuable, as i've never done this before.  I  tried to find a student or two in the D.C. area that was interested in writing a couple of short programs to read some disk files but was unsuccessful.  Consequently, i'm trying to do it myself.  This looks like a worthwhile place to start.  Cheers.

I assume you need some stuff for DOS, right? If that's the case, you can still use Borland Pascal (Turbo Pascal 7) or Turbo C++, they both include Assembly natively along with their procedural and POO stuff.  :bgrin:

John T

Hi, John T again..

Now I'm wondering: Is it possible to do SOURCE level debugging (for MASM) in Visual Studio 2013 Community?
It looks like (hmmm) I finally got VS set up to work in MASM but before I get more gray-hairs I was wondering if its worth pursuing.
If not I'll just stick with Notepad++ and OllyDbg.

nidud

#25
deleted

jj2007

Quote from: John T on June 16, 2015, 04:27:16 AMNow I'm wondering: Is it possible to do SOURCE level debugging (for MASM) in Visual Studio 2013 Community?

You can convince Olly to show you symbols, i.e. the names of your global variables, by specifying /Zi for the assembler and /debug for the linker. Symbols are really helpful for debugging, but there are limits, especially with macros. For example, a simple Print Str$("That's a number: %i\n", eax*xmm0/123) translates to 20 lines in the disassembly. OTOH, there is rarely a need to understand macros, unless they don't work (and then it's a case for the author, who is morally obliged to know what the 20 lines mean...).

And in any case, you can have symbols with qEditor, Notepad, Notepad++, RichMasm, RadAsm, ... no need to launch that behemoth of VS 8)

habran

I only use Visual Studio 2013 Community for programming in ASM or C
you can find here how to set it up
Cod-Father

rrr314159

I have the idea that Visual Studio is not very appropriate for using macros in asm. As jj2007 mentions, debugger doesn't handle them as u might wish. Also, with VS u probably wouldn't use macros much, for that type of thing (more complicated routines) you'd use C. Does that make sense? Habran, do u use macros particularly? Does VS make sense for a macros "fan"?
I am NaN ;)

Zen

#29
GUNTHER,
Quote from: GUNTHERIt seems that Kip is very popular among students, isn't he? What's the reason for that?

An excellent question. I bought the Fifth Edition of his book (Assembly Language for x86 Processors, 7th edition, 2014),...it's really the only thing out there like a textbook, for beginning assembly programming. I think he originally included 16-bit DOS programming, when it was impossible to find anything useful on the subject, except the Intel Software Developers Manuals (and, all the 16-bit DOS programming is still a large part of his book even though it's obsolete).
I found the Fifth Edition in the Library at the University of California,...and, I couldn't find anything else at that level, so I bought it.
It has many problems, though,...and, we get a lot of questions here at the MASM Forum from novices trying to use his source code examples and compiled libraries with the usual header files and libraries that are an integral part of the MASM package. They are not really compatible. Kip write overly simplistic code, and his examples are designed to be used only with other routines from the Irvine library (his routines usually don't take any parameters, and don't return anything). This just confuses novice MASM programmers, who when compiling simple programs generate a lot of annoying errors, and, are lost when trying to call routines from Irvine's libraries that are included in the typical initial code of a MASM program.

The best way for novices to test Irvine's code is to just copy a routine from Irvine's source code and paste it into the typical MASM program as an include file (that way they can simply just comment out the line that indicates the include file, and the program will initially compile and work correctly). Irvine's code must be modified to work with a typical MASM program, though, because it usually calls other Irvine routines (and they don't efficiently return useful data to a data variable stored in memory).

Here's a typical simple example program (from Chapter Three, Fifth Edition). Just to add and subtract a couple of integers, you have to build all this:
TITLE Add and Subtract          (AddSub.asm)

; This program adds and subtracts 32-bit integers.

INCLUDE Irvine32.inc

.code
main PROC

mov eax,10000h ; EAX = 10000h
add eax,40000h ; EAX = 50000h
sub eax,20000h ; EAX = 30000h
call DumpRegs

exit
main ENDP
END main


...and, then you must locate the DumpRegs routine, which is in the Irvine32 library (which a novice would link to):

;---------------------------------------------------
DumpRegs PROC
;
; Displays EAX, EBX, ECX, EDX, ESI, EDI, EBP, ESP in
; hexadecimal. Also displays the Zero, Sign, Carry, and
; Overflow flags.
; Receives: nothing.
; Returns: nothing.
; Last update: 6/22/2005
;
; Warning: do not create any local variables or stack
; parameters, because they will alter the EBP register.
;---------------------------------------------------
.data
saveIP  DWORD ?
saveESP DWORD ?
.code
pop saveIP ; get current EIP
mov saveESP,esp ; save ESP's value at entry
push saveIP ; replace it on stack
push eax ; save EAX (restore on exit)

pushfd ; push extended flags

pushfd ; push flags again, and
pop  eflags ; save them in a variable

call Crlf
mShowRegister EAX,EAX
mShowRegister EBX,EBX
mShowRegister ECX,ECX
mShowRegister EDX,EDX
call Crlf
mShowRegister ESI,ESI
mShowRegister EDI,EDI

mShowRegister EBP,EBP

mov eax,saveESP
mShowRegister ESP,EAX
call Crlf

mov eax,saveIP
mShowRegister EIP,EAX
mov eax,eflags
mShowRegister EFL,EAX

; Show the flags (using the eflags variable). The integer parameter indicates
; how many times EFLAGS must be shifted right to shift the selected flag
; into the Carry flag.

ShowFlag CF,1
ShowFlag SF,8
ShowFlag ZF,7
ShowFlag OF,12
ShowFlag AF,5
ShowFlag PF,3

call Crlf
call Crlf

popfd
pop eax
ret
DumpRegs ENDP


mShowRegister is a macro, which is located in a file, Macros.inc


;---------------------------------------------------
mShowRegister MACRO regName, regValue
LOCAL tempStr
;
; Displays a 32-bit register name and contents.
; Receives: the register name, the register value.
;---------------------------------------------------
.data
tempStr BYTE "  &regName=",0
.code
push eax

; Display the register name
push edx
mov edx,OFFSET tempStr
call WriteString
pop edx

; Display the register contents
mov eax,regValue
call WriteHex
pop eax
ENDM


All of Kip Irvine's source code examples and compiled libraries can be downloaded here:
Link Libraries and Example Programs
Zen