flat assembler
Message board for the users of flat assembler.

Index > Main > simply n00b question

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
sounds may lol, but how do i move a 8 bit to a ex 16 bit register, or 8 to 32 bit??.. FX moving AL to DX...

_________________
LOOOL
Post 07 Jan 2005, 09:01
View user's profile Send private message Reply with quote
Dryobates



Joined: 13 Jul 2003
Posts: 46
Location: Poland
Dryobates
Code:
movzx dx, al ; if you want extend to zero high order byte
movsx dx, al ; if you want preserve sign    

_________________
There's one more bug... Smile
Image
Post 07 Jan 2005, 10:44
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
Thanks, just donno if it works, i trying to make one there writes back what you write, but i got a problem too again
when i do this(becuase its need a $ for end the write)
mov [dx+1],'$'
its says error with that... any other ways i can do it on and not to be greedy Rolling Eyes how do i mov db(defined byte) to 8 bit register fx al?
Post 07 Jan 2005, 12:42
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 340
Location: Trollhättan, Sweden
bubach
La viro parolas Esperanton... Smile
Post 07 Jan 2005, 13:48
View user's profile Send private message Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
WHAT?
Post 07 Jan 2005, 17:03
View user's profile Send private message Reply with quote
beppe85



Joined: 23 Oct 2004
Posts: 181
beppe85
If you are programming in 16 bits, you do not use dx as a base register, but bx(usually) instead. On 32 bits, you must use 32 bits registers:

[codeedx+1], byte '$'[/code]

Note that I specified the size, byte.
Post 07 Jan 2005, 17:44
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 340
Location: Trollhättan, Sweden
bubach
It's a phrase in (the language) Esperanto.


Last edited by bubach on 13 Feb 2012, 15:25; edited 1 time in total
Post 07 Jan 2005, 18:08
View user's profile Send private message Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
how do i change that? or what you saying? ps bubach, i don't understand a shit of what you saying... Razz
Post 07 Jan 2005, 18:59
View user's profile Send private message Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin
bubach wrote:
La viro parolas Esperanton... Smile

Something like "Men speak in Esperanto"?
Post 07 Jan 2005, 20:53
View user's profile Send private message ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
OK, the poster have not exactly understood, where you're getting at:
I think I know what you need:
Code:
Sample db "onvrwovjw"
mov dx,Sample
mov byte[dx+10],'$' ;You don't need BYTE if you have defined "db"

;-OR-
mov edx,Sample
mov byte[edx+10],'$' ;Assembler understands that (e)dx is a byte variable(I think)

;You should use byte, word, dword for code readability or when you really would like to split DWORD into BYTEs or vice versa...
    
Post 07 Jan 2005, 21:26
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
its becuase, with one low bit(Cool i will may converter it to a 32 register, and also a 32 bit register i will conveter to 8 bit register... I got also another problem - its that i wanna make my program in full interrups, and found a few guides there show FindFirst & FindNextFile. And such things, but donno how to write to regedit... so my question is, how to set a reg_sz string to ms windows registry database...
Post 08 Jan 2005, 10:07
View user's profile Send private message Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
anybody?
Post 08 Jan 2005, 17:45
View user's profile Send private message Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin
RegSetValue, RegSetValueEx and other Reg....... functions from advapi32.dll
Code:
LONG RegSetValue(
    HKEY hKey,   // handle of key to set value for 
    LPCTSTR lpSubKey,     // address of subkey name 
    DWORD dwType, // type of value 
    LPCTSTR lpData,        // address of value data 
    DWORD cbData   // size of value data 
);
    

It's from Win32 SDK Reference help aka win32.hlp which I'm using hardly every day Smile
Post 08 Jan 2005, 18:23
View user's profile Send private message ICQ Number Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
... i know the api, but it is possible to do it with interrups...?
Post 08 Jan 2005, 18:45
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Quote:

... i know the api, but it is possible to do it with interrups...?

What's the point? The API will work on all win32 versions, using interrupts will lock you to NT (I believe 9x uses a funky r3->r0 method involving ARPL?)
Post 08 Jan 2005, 19:18
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
not in windoze, you don't use interrupt there anymore (well, only in some device drivers or so).
Post 08 Jan 2005, 19:22
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Well, on NT you can access the native API through interrupts... but the question is why you'd want to do it (at least for regular programs).
Post 08 Jan 2005, 20:01
View user's profile Send private message Visit poster's website Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin
Are you wanted something like this? Accesing to registry without APIs?
Maybe author of this tool can help you...


Description: RegView (for DOS, without APIs)
Download
Filename: regv.rar
Filesize: 21.7 KB
Downloaded: 204 Time(s)

Post 08 Jan 2005, 20:14
View user's profile Send private message ICQ Number Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis
there is no source in it...
Post 09 Jan 2005, 15:48
View user's profile Send private message Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin
Yes! And what? You can simply email the author or you can re-engeneering this file and try to understand the algorithms and concepts. Asm-coding is teaching us to dive deeper, imho.
Look at Privalov or JonhFound! They are incredible men! And I'm just an amateur next to them.
Well... If registry contains any kind of information it must have the format. And somethere in the world there is description of this format. And if you couldn't get it you can try to understand it by yourself.
But don't forget that registry format had changed from version to version. And this is may cause a problem...
Good luck! Smile
Post 09 Jan 2005, 20:59
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.