News:

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

Main Menu

WARNING: CONFUSION A MUST

Started by Evan, December 02, 2013, 04:36:06 AM

Previous topic - Next topic

Evan


I'm trying to assemble but these things fall apart so easily.
;Warning i don't want to fry anything



;Goal: make a binary counter that outputs number sheets
;And clear out some registers
;I'm trying to own my computer



mov yallin BINARY(1000000)
mov yallout BINARY(0000001)
loopin
   move A2 yallin
   move A1 yallout
      yallin(A1 + 1)
         if A1 > A2
            end.
loopout


loopin(end.)
   move A2 0
   move A1 0
;I'm thinking I'm easing that A1 with that A2 maybe
loopout



Could you guys kinda help me?

I am really trying to start.

Evan

I assume I will be able to translate this through macros???

Can I just through this in a string or array or some shit and keep going if I write it right?

Evan

This code can show me it's output on a console when it is assembled correctly.
I got the console output macro down packed I'm thinking.

dedndave

#3
hi Evan - i thought we lost you

are you set up so that you can assemble programs ?
irvine library ?
Masm32 ?

Evan

Yep I can assemble my good old EXE files fine and dandy. I think the only macro I have is the console.
I'm a little funnied out. I wonder how extreme what which choices are when it comes to this stuff.

dedndave

ok - but, i need to know which package you have working - or both ?

Evan

Quote from: dedndave on December 02, 2013, 06:29:01 AM
ok - but, i need to know which package you have working - or both ?
Sorry I edit my comments so much.  What do you mean by packages? Oh! Those little pesky guys before my start?

dedndave

#7
the Masm32 package is the one that you download from this site
the Irvine library package goes with the book - and is available on Kip's site

maybe - show me a program that you can assemble

Evan

#8
Quote from: dedndave on December 02, 2013, 06:31:51 AMthe Masm32 package is the one that you download from this site
the Irvine library package goes with the book - and is available on Kip's site

maybe - show me a program that you can assemble

Yeah I get my assembly tools from MASM as much as I can.


Sorry I abuse my internet so much. It's that google fiber kickin in of something.




Idk I don't get it.





    .486                                    ; create 32 bit code
    .model flat, stdcall                    ; 32 bit memory model
    option casemap :none                    ; case sensitive
 
    include \masm32\include\windows.inc     ; always first
    include \masm32\macros\macros.asm       ; MASM support macros


  ; -----------------------------------------------------------------
  ; include files that have MASM format prototypes for function calls
  ; ;---------------------------yeah c;omputer destryed----------------------------------------
    include \masm32\include\masm32.inc
    include \masm32\include\gdi32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc


  ; ------------------------------------------------
  ; Library files that have definitions for function
  ; exports and tested reliable prebuilt code.
  ; ------------------------------------------------
    includelib \masm32\lib\masm32.lib
    includelib \masm32\lib\gdi32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\kernel32.lib


    .code                       ; Tell MASM where the code starts

dedndave

ok - i am guessing A1 and A2 are registers
is that correct ?

Evan

Yeah that was my plan. But now I'm trying to convert my hackl assembly into masm assembly.

Evan

This was my idea


Carve myself out a something to use for counting so i can get a window going and draw a line.

dedndave

let's see how this goes....
        INCLUDE    \Masm32\Include\Masm32rt.inc

;###############################################################################################

        .DATA

yallin  db 80h
yallout db 1

;***********************************************************************************************

        .DATA?

;###############################################################################################

        .CODE

;***********************************************************************************************

_main   PROC

        xor     eax,eax           ;EAX = 0
        xor     edx,edx           ;EDX = 0

        mov     al,yallout        ;AL = yallout = 1
        mov     dl,yallin         ;DL = yallin = 80h = 10000000b

loop00: inc     al                ;AL = AL +1
        cmp     al,dl             ;compare AL with DL
        jb      loop00            ;jump if below back to loop00

        print   uhex$(eax),13,10  ;show EAX in hexadecimal

;wait for a key, then exit

        print   chr$(13,10)
        inkey
        INVOKE  ExitProcess,0

_main   ENDP

;###############################################################################################

        END     _main

Evan

#13
I was thinking that if I just used the console for my window it would make this project even better. Kinda a lot.
The console is good for showing some forms of data.

Evan

Quote from: dedndave on December 02, 2013, 06:41:36 AM
let's see how this goes....
        INCLUDE    \Masm32\Include\Masm32rt.inc

;###############################################################################################

        .DATA

yallin  db 80h
yallout db 1

;***********************************************************************************************

        .DATA?

;###############################################################################################

        .CODE

;***********************************************************************************************

_main   PROC

        xor     eax,eax           ;EAX = 0
        xor     edx,edx           ;EDX = 0

        mov     al,yallout        ;AL = yallout = 1
        mov     dl,yallin         ;DL = yallin = 80h = 10000000b

loop00: inc     al                ;AL = AL +1
        cmp     al,dl             ;compare AL with DL
        jb      loop00            ;jump if below back to loop00

        print   uhex$(eax),13,10  ;show EAX in hexadecimal

;wait for a key, then exit

        print   chr$(13,10)
        inkey
        INVOKE  ExitProcess,0

_main   ENDP

;###############################################################################################

        END     _main



Okay I will try to understand that really good and then most likely run it no matter what.