Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Output in ASM???


ghost's Avatar
0 0

I've been learning ASM for a few days (pretty crappy because I have exams soon) and I'd like to know, how the hell do you output anything in it…

I've tried all the "INT 20h", "INT 20", "INT 10" etc… and nothing works…

How do you just output text to the console?


ghost's Avatar
0 0

Zeke tAh FreKe wrote: lmao

Very constructive


ghost's Avatar
0 0
IncludeLib user32.lib
.386
.model flat, stdcall
ExitProcess      PROTO      ,:DWORD
MessageBoxA PROTO      ,:DWORD, :DWORD, :DWORD, :DWORD

.data
MsgBoxCaption  db "asdf",0
MsgBoxText     db "llama",0

.const
NULL     equ  0
MB_OKCANCEL    equ  1

.code
    Main:
     INVOKE    MessageBoxA, NULL, ADDR MsgBoxText, ADDR MsgBoxCaption, MB_OKCANCEL
     INVOKE    ExitProcess, NULL
    end Main ```

That will make a MsgBox appear with text in it. There is no "console window" for ASM programs, unless you make one.

ghost's Avatar
0 0

Good enough, slightly more constructive than Zeke's reply


Zeke tAh FreKe's Avatar
The Merchant
0 0

Happysmileman wrote: Good enough, slightly more constructive than Zeke's reply

Constructive would be actually LEARNING about ASM b4 asking how to output in a shell ..

htttp://www.justfuckingoogleityadumbasshappygayman.com


ghost's Avatar
0 0

wtf is wrong with you ztf? if you cant say anything helpful then shut up instead of saying "lmao"


ghost's Avatar
0 0

Hmm..is ASM worth learning?

Zeke why do you have three t's?


ghost's Avatar
0 0

Ponguile wrote: Hmm..is ASM worth learning?

Apps run faster and are smaller in ASM, so unless you need the performance, or want to do something other languages can't, it's not really worth learning (apart from using for cracking apps).


ghost's Avatar
0 0

Ponguile -> ASM worth learning it in some case, some algorythm can writen to be execute faster in ASM than C, but usually it don't make a difference since compile C is pretty much the same that you would have written in ASM.

Otherwise the main use of it is for small piece of code, that must be optimized to the maximum. It's really, really, really rare that a complete program is written in ASM. What I suggest you is to learn how to use it in C/C++ program.


Zeke tAh FreKe's Avatar
The Merchant
0 0

Folk Theory wrote: wtf is wrong with you ztf? if you cant say anything helpful then shut up instead of saying "lmao"

If you were smart enough to realize how stupid his question was, you would "lmao" as well.

GoOglE.com


ghost's Avatar
0 0

Everyone started wiht no knowledge whatsoever (no offense), it doesnt mean you can laugh at them…

And right now I am learning perl, then ill probably go onto to either C or C++ (I dont know the difference atm)


ghost's Avatar
0 0

Your ASM tutorial logs me out of HBH? Good one…


ghost's Avatar
0 0

I use emu8086, and here's a long but probably useful in your case way to do it

mov ah, 0eh

mov al, "P"
int 10h
mov al, "e"
int 10h
mov al, "e"
int 10h
mov al, "n"
int 10h

And basically, you're calling a functin with the mov ah, 0eh section, then you move whatever into al then use int 10h to print that character, that should work.


ghost's Avatar
0 0

Yeah and that's his website on his profile also…

And @ztf: I already said that i googled it and learned some basic ASM… And in my first post I even gave examples of what I tried, since most ASM tutorials are incredibly old and "INT 21h" would've worked back then, and if you want to verify this go google it yourself and look at the dates on the tutorials, and the commands they use to output to command line


ghost's Avatar
0 0

READ MY TUTORIAL ON ASM

It will tell you exactly how to start out and output stuff .. take a look at my FIBonacci program……………..


ghost's Avatar
0 0

Of course asm is worth learning. U learn how programs function and you develop a greater understanding on how things work. Plus it can everything.


ghost's Avatar
0 0

ASM may be really friggin hard (at least compared to some languages) to learn, but I find it a lot of fun. And if you know nothing about ASM, I doubt you'll be able to crack an app and know hwo you did it.


ghost's Avatar
0 0

Crack application ? Seriously, how many you will really need to crack app ?

It's sure that ASM give a better understand of how it work in general, but you don't need to have a very deep understanding of ASM to understand good part of it. Also most personn here aren't pretty good coder with experience in many language, so ASM won't bring them as much as it would for someone who have done lot of programming.


ghost's Avatar
0 0

Arto_8000 wrote: Crack application ? Seriously, how many you will really need to crack app ?

It's sure that ASM give a better understand of how it work in general, but you don't need to have a very deep understanding of ASM to understand good part of it. Also most personn here aren't pretty good coder with experience in many language, so ASM won't bring them as much as it would for someone who have done lot of programming.

You truly lack understanding on the subject in general, so I have 1 of 2 suggestions.

  1. Learn to speak English properly so people could have a fucking clue about what you're saying.

  2. Go read on the benefits of ASM before making outrageously stupid remarks.

Personally, I'd recommend you heed both suggestions.

P.S. - Life's harsh, deal with it.

~T


ghost's Avatar
0 0

For my english I know it's kindda hard to read it, but that's not my mothertongue.

For ASM, I know what it is and I've already read a lot about it, so don't take me for an idiot. From what I've seen and heard about, it's what I think and it will take a lot to make me come back on what I've said.


ghost's Avatar
0 0

Arto_8000 wrote: For ASM, I know was it is and I've already read a lot about it, so don't take me for an idiot. From what I've seen and heard about, it's what I think and it will take a lot to make me come back on what I've said.

Wtf? and can I get another beer?


ghost's Avatar
0 0

Zephyr_Pure wrote: [quote]Arto_8000 wrote: For ASM, I know was it is and I've already read a lot about it, so don't take me for an idiot. From what I've seen and heard about, it's what I think and it will take a lot to make me come back on what I've said.

Wtf? and can I get another beer? [/quote]

Judging by your recent bunch of useless posts, I can only assume you're desperate to raise your post count. Good luck. ;):p

~T


ghost's Avatar
0 0
int 21 ;call the function which value is stored in ah
mov dl, al ;store the value in dl which is passed to the output function
mov ah, 02 ;output the value stored in dl on screen
int 21 ;call the function which value is stored in ah
int 20 ;clean exit```

http://spike.scu.edu.au/~barry/interrupts.html

ghost's Avatar
0 0

Just quit coding 16-bit applications.

~T