News:

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

what happend to ah, al, bh, bl, ect. ect. ect....

Started by *DEAD*, August 05, 2006, 09:09:44 AM

Previous topic - Next topic

*DEAD*

hi, im a complete newbie to asm, and ive been digging up various tutorials from wherever i could find them. ive worked my way through a couple shorter ones, but what got me when i found iczelion's tutorials is that the first page didnt have anything about ax, ah, al, bx, bh, bl, ect. im sure anyone who can answer my question will know the rest. From the other tutorials, id put values into all these registers, and then call int 21h to display a character. what my question comes down to is basically all the other tutorials ive read have something on the registers, yet when i opened up iczelions i didnt find anything. where did they go. since many people on this forum recomend his tutorials, and i must admit id been struggling to find anything decent to learn from, im just curious why his are so different. also, other tutorials had things on using machine insturctions to add, increment, jump, and a whole bunch of other things. im just curious why there not there, have they become redundant or something?

hutch--

Its you DOS assumptions that are getting in the way. All of the BYTE sized registers are there but they are only used for BYTE sized operations in 32 bit mode. Interrupts are not used at all after win95 oem and you perform the system functions by calling Window API functions instead of the DOS interrupt based ones.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

*DEAD*

well then im certainly glad i found these sets of tutorials. i was under the assumption that the tutorials i was reading were old, but not that old. (im actually young enough to have never seen a computer running DOS)

hutch--

You are blessed by that, DOS was an antique pig in comparison with lousy segmented addressing that was no fun to work in. The newer 32 bit stuff is far faster, clearer and more powerful.

Get the correct reference material from Intel, get yourself the Microsoft reference material for the API calls and you have enough to start but you have a lot of work to do to get there. have a look at the forum links and website to get most of this stuff.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dsouza123

32 bit Windows assembly programming normally uses the 32 bit versions of the registers.
eax, ebx, ecx, edx, esi, edi though the smaller parts such as 8 bit al, ah, and 16 bit ax can still be accessed
if a byte or word from the register is needed for something.


.data
  var8a db 0    ; create a byte  ( 8 bit) variable, with a starting value of 0
  var8b db 0    ; create another
  var16 dw 0    ; create a word  (16 bit) variable
  var32 dd 0    ; create a dword (32 bit) variable

.code
  mov ecx,   258  ;
  mov eax,   ecx  ;
  mov var8a,  cl  ; var8a gets 2, 258 = 1*256 + 2
  mov var8b,  ch  ; var8b gets 1, 258 is 102h in hex, is 00 00 01 02 using four bytes
  mov var32, eax  ; var32 gets 258
  add ecx,   eax  ; ecx = ecx + eax   ; 516


MASM supports high level syntax that is replaced with a few assembly instructions.

  mov eax 7
  .if eax >= 3
     mov ecx, 99
  .else
     mov ecx, 0
  .endif
  mov edx, 15

  mov eax, 7
  cmp eax, 3     ; compare eax with 3
  jb  DoElse     ; jump if below (less than) to the else part
  mov ecx, 99   ; is greater than or equal so ecx gets 99
  jmp PastEndif
DoElse:
  mov ecx, 0
PastEndif:
  mov edx, 15


MASM32 comes with an extensive set of assembly programming tools and refrences
including much of iczelion's tutorials with both source code and assembled executables.

With MASM32 either console (with output like the DOS Int 21) text mode character programs or
GUI programs (with windows, messageboxes and dialogboxes) can be written and assembled.

Dasar

#5
Quotebut what got me when i found iczelion's tutorials is that the first page didnt have anything about ax, ah, al, bx, bh, bl, ect



hi *DEAD*

some times you have to focus on every word you read  :)



these are the first words in the first tutorial of iczelion ^_^

QuoteTutorial 1: The Basics
This tutorial assumes that the reader knows how to use MASM. If you're not familiar with MASM, download win32asm.exe and study the text inside the package before going on with the tutorial. Good. You're now ready. Let's go!

Good Luck !

*DEAD*

your a life saver dasar. and yes ... i should learn to read