Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › Assembly › Humble Beginnings

Humble Beginnings

Posts 1–13 of 13 · Page 1 of 1
why06
why06
Humble Beginnings
I'm not even sure why I posted this here, except to show anyone interested that I am beginning asm and have compiled my first HLA program:
Code:
program helloWorld
#include("stdlib.hhf");

begin helloWorld;
	
	stdout.put("Hello, World of Assembly Language", nl);
	
end helloWorld;
Now some of you might notice this looks a lot like a HLL, well that is because HLA hooks our knowledge of HLL to accelerate its readers understanding of ASM, otherwise it would take weeks of work just to learn enough to create an I/O system so that we can see out progress. Later on HLA will start relying more on pure ASM once one has a good grasp of the elementary ideas.
#1 · 16y ago
B1ackAnge1
B1ackAnge1
Code:
.MODEL Small
    .STACK 100h
    .DATA
   msg db 'Way to Go Why!$'
    .CODE
  start:
  mov ah, 09h
  lea dx, msg
  int 21h
  mov ax,4C00h
  int 21h
  end start
lol
#2 · 16y ago
why06
why06
Quote Originally Posted by B1ackAnge1 View Post
Code:
.MODEL Small
    .STACK 100h
    .DATA
   msg db 'Way to Go Why!$'
    .CODE
  start:
  mov ah, 09h
  lea dx, msg
  int 21h
  mov ax,4C00h
  int 21h
  end start
lol
lol. I don't even know what that means yet, but thx anyway :P
#3 · 16y ago
why06
why06
Well, I suppose I will post my progress in this thread so I won't have to spam up the forum, since I am the only one posting. lol
Code:
program Test;
	
	#include ("stdlib.hhf")
	static
		input: int32;
		
	
begin Test;
	forever
		try
			stdout.put("Enter an integer value: ");
			stdin.get(input);
			stdout.put("The first input value was: ", input,nl);
			mov(0,eax);
			sub(input, eax);
			mov(eax, input);
			stdout.put("The input value has been negated: ", input, nl);
			
			unprotected
			break;
			
			exception(ex.ValueOutofRange)
				stdout.put("The value entered was too large, reenter value." nl);
			exception(e*****nversionError)
				stdout.put( "The input contained illegal characters, reenter." nl);
			
			
		endtry;
	endfor;
	
	stdout.put("Enter another number: ");
	stdin.get(input);
	mov(0,eax);
	sub(input, eax);
	mov(eax, input);
	stdout.put("The input value has been negated: ", input, nl);
	
end Test;
This new program has the incredible ability to negate numbers. Wow! Atleast I finally got to use some real opcodes.
#4 · 16y ago
B1ackAnge1
B1ackAnge1
lol that's high level indeed.. barely even recognize it as assembly..
Might as well code in C++ instead

Go Lower Why! You can do it! Come on - Int 33h Mouse handling!



oh the good ol' days... XD

p.s. what I posted was basically 'hello world' in assembly

Code:
.MODEL Small      //Set the memory model to 'Small'
    .STACK 100h  //Set the stack size to 0x100;
    .DATA           //data segment
   msg db 'Way to Go Why!$'  //Define a string variable 'msg' with the text
    .CODE          //code segment
  start:            //start label
  mov ah, 09h   //Set Command for 'in21h' later on - 0x09 = write to stdout
  lea dx, msg    //Load Effective Address of message into DX (in C++ it'd be: DX = &msg);
  int 21h         //Print the Text
  mov ax,4C00h   //Set AX to value to use with int21h :  0x4C00h  = exit program with return code 0 (AH = 0x4C and AL is return code in this case 0)
  int 21h             //Perform Exit Program
  end start   //end start label
#5 · edited 16y ago · 16y ago
why06
why06
Quote Originally Posted by B1ackAnge1 View Post
lol that's high level indeed.. barely even recognize it as assembly..
Might as well code in C++ instead

Go Lower Why! You can do it! Come on - Int 33h Mouse handling!



oh the good ol' days... XD

p.s. what I posted was basically 'hello world' in assembly
Believe me I will. The whole point of using HLA is to learn asm. The HLL parts just help the learning go a bit more quickly. Once I learn enough I will quit using the HLL parts altogether. And thanks for the explanation. Except I don't get how int 21h prints the message... And even after that the same line closes the program! o_O Also I thought the destination was the last variable not the first. At least in HLA it is, example

Code:
mov ax,4C00h   //Set AX to value to use with int21h :
so it would be like this.
Code:
mov 4C00h, ax
Right?
#6 · 16y ago
B1ackAnge1
B1ackAnge1
Nope, in normal 8086 (intel notation) assembly it's
MOV Dest,Source

INT21h Is basically a (software interrupt that maps to a) DOS System call and whatever you put in AH determines what it does. You can think of it as a 'function pointer' (Function 0x09) in a certain list of commands (int 21h - dos-calls )

This is really more 16-bit DOS Assembly programming which is what I did way back when. Not 'that' relevant anymore, but still interesting (You'd have to have a 16-bit linker to get that sample to work btw )

There's tons of lists available with all the different interrupts and their options/values etc..
Int 10h does graphical mode settings, int 33h does mouse handling etc etc

For instance if you were to say:
mov AX, 0x03
int 33h

Then after that call you'd get the following results:
CX = X Coordinate
DX = Y Coordinate
BX = Mouse Button Flags

I remember writing crap like that in MS-Dos programs to allow use of the mouse in a 'windows like' app I wrote
#7 · edited 16y ago · 16y ago
why06
why06
Oh well that is pretty cool!

And pretty complicated too xD. Lol. Do the commands go in order like: "1h,2h,3h" or do they skip around according to the size of the pointer like: "22h, something else..."?

But now I'm pissed... *looks through book to make sure I was right*... then Why the hell is this thing teaching me ass-backwards?! >:L
#8 · 16y ago
B1ackAnge1
B1ackAnge1
It's all an evil scheme to make sure that once you learn HLA you'll stick with it because then switching to the 'other way' is too confusing

They sorta jump around; e.g. for int21 you can pass 1,2,5,6,7,9.
doesn't necessarily mean 3,4, and 8 don't do anything - could be 'not documented' The pointer explanation was just to 'visualize' the concept in familiar terms, so nothing to do with pointers,pointersize etc

As far as the actual interrupts those are a select few. For instance there's no 'int 1h' if I remember correctly..

here's a bit of an overview:
8086 bios and dos interrupts (IBM PC)

Sad thing is that the above works for 16 bit, but to make a 32 bit Assembly hello world that is a console
program you'd have to do a LOT more work.
#9 · edited 16y ago · 16y ago
why06
why06
Quote Originally Posted by B1ackAnge1 View Post
It's all an evil scheme to make sure that once you learn HLA you'll stick with it because then switching to the 'other way' is too confusing

Sad thing is that the above works for 16 bit, but to make a 32 bit Assembly hello world that is a console
program you'd have to do a LOT more work.
Maybe your right o_O... I know you were just kidding, but seriously now I'm worried :{.

And that's just great. I can imagine what it will be like once they switch over to 64bit ...
#10 · 16y ago
B1ackAnge1
B1ackAnge1
Here's a masm32 version of your app (so i can be lazy and use invoke) without the loop or exception handling:
Btw to negate a number you can use 'neg'

Code:
.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
EnterValue db "Enter an integer value: ", 0
ValueWas db "The first input value was: ",0
Output db "The input value has been negated: ",0
endl db 13,10,0

.data?
number dw 20 dup(?)

.code
start:
invoke StdOut, addr EnterValue
invoke StdIn, addr number, lengthof number
invoke StdOut, addr ValueWas
invoke StdOut, addr number
invoke StdOut, addr endl
invoke atol, addr number
neg eax
invoke dwtoa, eax, addr number
invoke StdOut, addr Output
invoke StdOut, addr number
invoke StdOut, addr endl

invoke ExitProcess, 0
end start
#11 · 16y ago
B1ackAnge1
B1ackAnge1
Here's a version without the use of 'invoke'... (I kept it simple and used as few registers as possible)
Code:
.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
EnterValue db "Enter an integer value: ", 0
ValueWas db "The first input value was: ",0
Output db "The input value has been negated: ",0
endl db 13,10,0

.data?
number dw 20 dup(?)

.code
start:
lea eax, EnterValue
push eax
call StdOut

push lengthof number
lea eax, number
push eax
call StdIn

lea eax, ValueWas
push eax
call StdOut

lea eax, number
push eax
call StdOut

lea eax, endl
push eax
call StdOut

lea eax, number
push eax
call atol
neg eax

lea ebx, number
push ebx
push eax
call dwtoa

lea eax, Output
push eax
call StdOut
lea eax, number
push eax
call StdOut
lea eax, endl
push eax
call StdOut
push 0h
call ExitProcess

end start
Which in the debugger turns into this:
Code:
00401010 >|> \8D05 00404000 LEA EAX,DWORD PTR DS:[404000]
00401016  |.  50            PUSH EAX                                 ; /Arg1 => 00404000 ASCII "Enter an integer value: "
00401017  |.  E8 0C010000   CALL 00401128                            ; \StdOut
0040101C  |.  6A 14         PUSH 14                                  ; /Arg2 = 00000014
0040101E  |.  8D05 70414000 LEA EAX,DWORD PTR DS:[404170]            ; |
00401024  |.  50            PUSH EAX                                 ; |Arg1 => 00404170
00401025  |.  E8 36010000   CALL 00401160                            ; \StdIn
0040102A  |.  8D05 19404000 LEA EAX,DWORD PTR DS:[404019]
00401030  |.  50            PUSH EAX                                 ; /Arg1 => 00404019 ASCII "The first input value was: "
00401031  |.  E8 F2000000   CALL 00401128                            ; \StdOut
00401036  |.  8D05 70414000 LEA EAX,DWORD PTR DS:[404170]
0040103C  |.  50            PUSH EAX                                 ; /Arg1 => 00404170
0040103D  |.  E8 E6000000   CALL 00401128                            ; \StdOut
00401042  |.  8D05 58404000 LEA EAX,DWORD PTR DS:[404058]
00401048  |.  50            PUSH EAX                                 ; /Arg1 => 00404058 ASCII "
"
00401049  |.  E8 DA000000   CALL 00401128                            ; \StdOut
0040104E  |.  8D05 70414000 LEA EAX,DWORD PTR DS:[404170]
00401054  |.  50            PUSH EAX                                 ; /s => ""
00401055  |.  E8 46010000   CALL 004011A0                            ; \atol
0040105A  |.  F7D8          NEG EAX
0040105C  |.  8D1D 70414000 LEA EBX,DWORD PTR DS:[404170]
00401062  |.  53            PUSH EBX
00401063  |.  50            PUSH EAX
00401064  |.  E8 57000000   CALL 004010C0                            ;  Test1.dwtoa
00401069  |.  8D05 35404000 LEA EAX,DWORD PTR DS:[404035]
0040106F  |.  50            PUSH EAX                                 ; /Arg1 => 00404035 ASCII "The input value has been negated: "
00401070  |.  E8 B3000000   CALL 00401128                            ; \StdOut
00401075  |.  8D05 70414000 LEA EAX,DWORD PTR DS:[404170]
0040107B  |.  50            PUSH EAX                                 ; /Arg1 => 00404170
0040107C  |.  E8 A7000000   CALL 00401128                            ; \StdOut
00401081  |.  8D05 58404000 LEA EAX,DWORD PTR DS:[404058]
00401087  |.  50            PUSH EAX                                 ; /Arg1 => 00404058 ASCII "
"
00401088  |.  E8 9B000000   CALL 00401128                            ; \StdOut
0040108D  |.  6A 00         PUSH 0                                   ; /ExitCode = 0
0040108F  \.  E8 22000000   CALL 004010B6                            ; \ExitProcess
#12 · 16y ago
ZE
zeco
Wow I've been missing out on a lot. Actually i've ventured to learn scraps of ASM previously but things like what BA Showed me scared me off cause i was immensely confused of how the random data/code things worked, and the interrupts. But now it feels like something i could tackle =)!

And IMO, unless HLA is as efficient as Regular ASM, then it is kinda pointless, because i can barely recognize it as Assembly =/

P.S. I'm also more familiar with the (mov dest, source) way...

P.P.S what does db stand for?
#13 · 16y ago
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Tags for this Thread

#beginnings#humble