emu8086

Variable in memory not updated by a store to that symbol

妖精的绣舞 提交于 2020-04-07 07:49:50
问题 When I run the emu8086, this result(ans) return to me 0 ..Why ? data segment ans dw ? ends stack segment dw 128 dup(0) ends code segment start: mov ax,@data mov dx,ax mov ax,2 mov bl,2 mul bl mov ans,ax mov ax, 4c00h int 21h ends end start 回答1: mov ax,@data mov dx,ax This part of the code must setup the DS segment register. You made a typo and wrote DX instead! mov ax, @data mov ds, ax Because of this error, the result of your AL * BL multiplication (4) was still written in memory by mov ans

How to create and draw sprites in emu8086?

做~自己de王妃 提交于 2020-01-25 00:23:14
问题 I have obtained an assignment where I need to create a game using emu8086. But the problem is I don't know how to draw a sprite. Can anyone help me by explaining sprite creation to me? 回答1: Can you tell me how to draw on emu8086 ? First you setup a graphics video mode. Next code selects the 320x200 256-color mode: mov ax, 0013h ; AH=00h is BIOS.SetVideoMode, AL=13h is 320x200 mode int 10h Now you can plot any pixel you like. Below is an example that plots a single pixel in the center of the

Why operand must have size in one line but not the other in x86 assembly

回眸只為那壹抹淺笑 提交于 2020-01-11 14:06:50
问题 Looking at the picture, on line 34 I had to write the word ptr for this to work, while on line 44 I didn't. Why is that? Can't the compiler know that 0020h is a word just like 0FF20h is a word? Adding 0 to 0020h making it 00020h or anything like that doesn't work either. I am using MASM on 80x86. emu8086, also tried on dosbox v0.74 回答1: The difference is because your assembler strangely and dangerously accepts 0FF20h as implying word operand-size. But even for your assembler, leading zeros

Why operand must have size in one line but not the other in x86 assembly

十年热恋 提交于 2020-01-11 14:06:27
问题 Looking at the picture, on line 34 I had to write the word ptr for this to work, while on line 44 I didn't. Why is that? Can't the compiler know that 0020h is a word just like 0FF20h is a word? Adding 0 to 0020h making it 00020h or anything like that doesn't work either. I am using MASM on 80x86. emu8086, also tried on dosbox v0.74 回答1: The difference is because your assembler strangely and dangerously accepts 0FF20h as implying word operand-size. But even for your assembler, leading zeros

x86 Assembly: Having hard time finding ideas for an infinite loop challenge

。_饼干妹妹 提交于 2020-01-04 07:27:05
问题 I'm going to intend a competition similar to "corewars" with my friends (We are using the same memory grid as the original game) In the game each one of us supposes to write a "safe" which is an infinite loop that is not longer then 25 lines. each "safe" has a trick or a code that can stop the loop, hence breaking the "safe". for example: ;Safe safe: mov ax, [1000] cmp ax, 9999 jne safe This safe can be broken if we pass the correct code (9999) to the [1000], which will break the safe:

DosBox how to fix character attribute?

安稳与你 提交于 2020-01-02 09:43:10
问题 I wrote my assembly code just to write a character with a blue background and white foreground. It works in emu8086's emulator but when I open it on DosBox it does not show the background color. With Emu8086: With DosBox: mov ax,0012h int 10h mov ah,9 mov al,31h mov bl,1fh int 10h 回答1: In the graphics video modes, the BL parameter for BIOS function 09h only defines the foreground color. It is always applied to a black background. Below is my implementation of an extension of the functionality

Graphics mode in assembly 8086

谁说胖子不能爱 提交于 2019-12-28 04:17:44
问题 I have a variable that is called average and in my DATASEG , it changes every time because the user enters a different input every time. What I want to do is to go to the graphics mode (VGA) and then print there Your average is: and then the average I know how to change to the graphics mode like this: mov ax, 13h int 10h After printing the average I want to print below if the average is above 75 You are a good student, keep up the good work and if not. Don't worry you will get better! Thanks

Finding first and last capital letter in user input

走远了吗. 提交于 2019-12-24 03:47:06
问题 Input is to be taken from a-z or A-Z and the input is ended by an asterisk * . We need to have the first and last Capital letters of the input characters as the output. Also, we should show the input we have taken each time. N.B. We take the inputs character by character, not as a string. Test case 1: input: aAbCcP* output: AP Test case 2: input: ZabCBc* output: ZB I have written this code below, which satisfies Test Case 1, but not 2: .MODEL .STACK 100H .DATA STR DB 'Enter letters:$' .CODE

Displaying the sum of a table using assembler 8086

淺唱寂寞╮ 提交于 2019-12-24 00:56:37
问题 I am writing some code that allows me to sum a table and then display its result using assembler language. Here is what I've come up with so far: data segment tab db 9 dup(3 5 8 4 7 1 6 7 0) resultat db ? data ends code segment xor di, di mov cx, 9 Prog: mov al, tab[di] add ax, al inc di loop prog mov resultat ,ax mov ah, 09h int 21h end code 回答1: I made some changes in your code and stole proc number2string from another answer (full of comments to help you understand) : data segment tab db 3

MOV 8 bit to 16 bit register (al to bx)

你。 提交于 2019-12-20 05:46:08
问题 How can I fix the problem of moving 8 bit value to the BX register (16 bit)? mov al, 10h mov bx, al for this I get: operands do not match: 16 bit and 8 bit register 回答1: The answer depends on whether you want to zero extend or sign extend the value and on whether you can or cannot use instructions available starting with the 80386. For better performance, the 80386 or later code should be used if movzx and movsx are available. zero extend on an 8086 or 80286 Zero the upper half, then move to