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.
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?
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.
hi Evan - i thought we lost you
are you set up so that you can assemble programs ?
irvine library ?
Masm32 ?
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.
ok - but, i need to know which package you have working - or both ?
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?
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
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
ok - i am guessing A1 and A2 are registers
is that correct ?
Yeah that was my plan. But now I'm trying to convert my hackl assembly into masm assembly.
This was my idea
Carve myself out a something to use for counting so i can get a window going and draw a line.
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
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.
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.
here's another version
i added 5 more lines of code to show each step of the loop
in both of those, i used BYTE values for yallin and yallout
in 32-bit code, 32-bit values are often easier to work with (and sometimes faster)
in this version, i made everything DWORD's
in the above programs, we loaded yallin into EDX
we can compare a register value with another register value
we can also compare a register value directly with a memory value
we cannot compare a memory value directly with another memory value
cmp yallin,yallout
will not work
(it can be done with string instructions, but let's keep things simple)