- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 14
- Posts with Upvotes
- 12
- Upvoting Members
- 12
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
- Interests
- Coding in Assembly! SIB!
| Re: That 16bit code in the .code section will/should work with any 16bit assembler that uses Intel syntax which NASM/NASMX uses... What you need to find out is the differences in sections between TASM and NASM, and the differences in the header of the asm files. FASM works on Linux, you … |
Re: [QUOTE]What is the lea instruction? And how does that translate to NASM?[/QUOTE] there is no translation. It is a CPU mneumonic on x86 it means load effective address | |
Re: How would you fix it if you wanted the entry point of your program to be NewbieChameleon? You would use the -e or --entry command line option for ld: -eEntryPointLabel --entry=EntryPointLabel I use a makefile and used this for an example and 64bit O: ld -o $(APP) $(APP).o -melf_i386 -eNewbieChameleon … | |
Re: First thing, arraylen does not contain what you think. It contains 20: 5 dword sized elements. To get the number of elements divide by 4 ` arraylen equ ($ - array) / 4 ` Next, you cannot print a number, you first need to convert it to ASCII. For your … | |
Re: You need to install the 32 bit libraries: ia32-libs or ia32-libs-multiarch With your package manager or: > sudo apt-get install ia32-libs | |
Re: It really is not hard at all to use libcurl. You read the [docs](http://curl.haxx.se/libcurl/c/) pass some parameters and call the functions. The following simple code will get googles robots.txt file and display it in the terminal. It is 64-bit using NASM tested on Linux %define CURL_GLOBAL_SSL (1<<0) %define CURL_GLOBAL_WIN32 (1<<1) … | |
Re: Nobody is taught to use comments anymore? It is so important to comment your code in Assembly, ESPECIALLY in ancient 16bit code where functions don't have names but numbers!! Your getting weird characters because after you get the input character, you are modifying it by adding 20h to `dl`. To … | |
Re: Your program starts executing at the start label and goes right to the WinProc, this won't work since you have not registered the window class yet. Move this: invoke GetModuleHandle, NULL mov hInstance, eax invoke WinMain, hInstance, NULL, NULL, 0 invoke ExitProcess, eax from the end to right after `start:` … | |
| |
Re: What do you think the answer to no.1 is? The answer to no.2 is in the AMD and INTEL manuals of course and plenty of docs on the net. Do you know what a "register" is? All it is, is memory directly on the CPU die, which makes it the … | |
Re: Maybe. What OS? Which Assembler? "Do you want fries with that?" | |
Re: You will never compile it! You Assemble and Link. Your stack is a MESS! Your pushes are not paired with pops. For every push you should have a pop or adjust esp manually. where is this address > 0xb7? Why use a hardcoded address? use a label. It won't print … | |
Re: You don't need many buffers. You have one buffer for your input right? That is all you need. Write a conversion function (or find one on the net, but you will better yourself writing it on your own) that takes a pointer to your input buffer, and goes thourgh each … | |
Re: Go to preferences and select the terminal tab. Uncheck "Follow the path of the current file" Check "Don't use run script" and to use the Geany terminal, check "Execute programs in VTE" | |
Re: What does "I can't run my program" mean? What errors are you getting? Why are you using an emulator? Do you not have an INTEL PC? | |
Re: 2 things: 1. All of this code: FullVertWait: mov dx,3dah vr: in al,dx test al,8 jnz vr ; wait until Vertical Retrace starts nvr: in al,dx test al,8 jz nvr ; wait until Vertical Retrace Ends add word[count1],1 add eax,0 ret Delay: mov word[count1],0 ddf: call FullVertWait cmp word [count1],700 … | |
Re: Yes there IS a really BIG difference writing 64bit Assembly code verses 32bit code. Especially when it comes to Windows Programming (I am sure Linux is the same). You have a different calling convention, "shadow space", more memory addresses, more registers, stack should be/has to be aligned. Learn 32bit first … | |
Re: Well, if you like MASM take a look at JWASM. It is fully MASM compatable (Meaning if you have an app written in MASM, JWASM will Assemble it without many complaints) Plus, it is 64bit compatible AND cross-platform | |
Re: Logic is a bit wrong. No need for the variables biggest or counter. si = counter and di = biggest This should work: [CODE] mov cx, 32 NextOne: shr a, 1 jnc ItsZero mov si, 0 jmp Next ItsZero: inc si cmp si, di jbe Next mov di, si Next: … | |
Re: Think of your matrix like this: it does not look like this in memrory [CODE] 1 2 3 4 5 6 7 8 9[/CODE] it looks like: 1 2 3 4 5 6 7 8 9 (spaces added for clarity) So, load the array, print the first number then add … | |
Re: Actually, you cannot run Turbo C or any DOS programs in Windows 7 and above as DOS is dead an not included in any current version of Windows. If you really want to use Turbo C with Windows 7, then you should download a DOS Emulator such as DosBox or … | |
Re: What Assembler? In MASM [CODE]MyInt DWORD 3 MyIntPointer DWORD MyInt[/CODE] [CODE] mov eax, MyIntPointer mov eax, [eax] PrintDec eax[/CODE] | |
Re: Works for me: [CODE]1,1,1,1 2,2,2,2 3,3,3,3 4,4,4,4 5,5,5,5[/CODE] :-) You are telling WriteFile to write 40 bytes (your buffer size) so it will write what you grab from the console, write them to file then write nulls. That second CreateFile is NOT needed! You already created the file, and have … | |
Re: Usually the value is returned in R0. So in your sumR, after you do your stuff, place what you want myvar to equal in R0 | |
Re: Sounds similar to a question asked here before in this thread. [url]http://www.daniweb.com/software-development/assembly/threads/386136[/url] my reply is there also :) | |
Re: Few things, why do folks who use Irvine, not use the correct case for the function calls? There is no such function as CRLF, instead it is Crlf. I don't know how the Irvine users don't get errors when Assembling! Put your 2 buffers in the uninitialized data section - … | |
Re: Uh, = is not equals it should be 2 equal signs == as in (ecx == 0) || (ecx == 2) etc... The funny thing with macros (yes .if/.while are macros) is the error number will happen after the macro call... | |
Re: Exactly what the error description says - you cannot nest procedures. Try this instead: INCLUDE Irvine32.inc [CODE] .data ccolor DWORD 13 bcolor DWORD 16 SetColor PROTO,cc:DWORD,bc:DWORD prompt BYTE "Hi",0 .code main PROC INVOKE SetColor,ccolor,bcolor mov edx,OFFSET prompt call WriteString exit main ENDP SetColor PROC,cc:DWORD,bc:DWORD mov eax,cc add eax,bc call SetTextColor … | |
Re: Ah, the Assembler Newbie mantra: I Need, I want, Give me the code! :) Auto-Completion is NOT an Assembler feature but an IDE feature, since you are using MASM, look for RadASM or WinASM both are good free IDE's for MASM When you Assemble with MASM it WILL show you … |