I'm curious how many ways are there to set a register to zero in x86 assembly. Using one instruction. Someone told me that he managed to find at least 10 ways to do it.
The ones I can think of are:
xor ax,ax
mov ax, 0
and ax, 0
Test platform is 32 bit Linux.
Basically, I know gcc can be used to generate both Intel and At&T style
assembly code, but it seems that you can not directly use nasm/tasm to compile
the Intel style assembly code gcc generated.
I am conducting a…
ar db "Defference $"
What's the difference between
mov dx,offset ar
and
lea dx,ar
I think both are doing same work, but what is the difference between these two
I have this code here, but I'm unfamiliar with the syntax.
STACK16_SIZE = 100h
stack16 db STACK16_SIZE dup (?)
I think dup means we declare a variable of type array, as this is a stack, but I'm not sure. So what does dup mean…
My information is coming from here. The assignment asks for a program that reads in no more than 20 characters, converts those characters to upper case, and then prints the input as capitals.
I have no idea how to access the input from…
I'm new to assembly and I'm currently reading a guide that would frequently express things like ax:bx, ds:dx, ss:sp.
I'll use one of the above in an example from the book "Mastering Turbo Assembly" Page 85.
Notice that the logical address in ss:sp…
Configuration :
MS-DOS 16 BIT (writing in a .asm file, then compiling them with TASM and TLINK)
Windows 7 x64
I've made a simple program in Assembly that should only OPEN a file and write a text to it.
Here is the code to it:
assume cs:code,…
I am writing some little tools for MS-DOS. Now I'm writing a Shutdown.com, like for Windows XP and greater. I have already written the entire code, now I just need to pass the argument from DOS.
I need to pass the parameters "-r" to reboot and "-s"…
Consider the following macros:
pixelFast MACRO
; This macro draws a pixel, assuming the coordinates are already loaded in cx&dx and the color is in al.
xor bh, bh
mov ah, 0ch
int 10h
ENDM
drawRect MACRO x1, y1, x2, y2, color
…
I am learning TASM at University, but information regarding TASM on the web seems to be very limited. I have found more information on MASM.
My question is, what is the different between MASM and TASM?
I was helping a friend of mine debug his program, and we narrowed it down to an issue which occurs even here:
.MODEL small
.STACK 16
.CODE
start:
mov ax, 044c0h
mov bl, 85
idiv bl
exit:
mov ax, 4c00h
int 21h
end start
After…
As explained in the title, I need to make this code able to do the same things it do using just 16bit but adding .386 to the code so I can use 32bit registers. But when I add the .386 now my code isn't printing anything, any idea how I can fix this.…
I have an .ASM file in which I want to call procedures from another .ASM or .INC file.
I have tried writing the following into my main.asm file:
INCLUDE file_op.inc
However when I try to run it, it just says:
'the emulator is halted.'
It does…
I want to know how,by looking through a sample source code, recognise if the syntax used is em8086, TASM or NASM? I am a new to assembly..I would like to know more about emu8086 please.